Граф коммитов

18122 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 4c2458a5ae Switch parameter passing for overloaded binary operators to
InitializationSequence. Fixes the -fsyntax-only failure in
llvm/lib/Transforms/Scalar/InstructionCombining.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 21:44:34 +00:00
Douglas Gregor 9123666ed4 Serialize the NoReturn bit on FunctionTypes for precompiled headers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91911 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 18:11:50 +00:00
Douglas Gregor b4debaebed Enter the scope of an initializer for direct-initialization as well as
for copy-initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 17:47:17 +00:00
Douglas Gregor 5b5ad8453c When transforming a C++ "new" expression that was not explicitly given
a size, check whether the transformed type is itself an array type. If
so, take the major array bound as the size to allocate. Fixes PR5833.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91907 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 17:13:37 +00:00
Douglas Gregor a188ff2d8a Switch parameter-passing for calls via function pointers (where we
don't have a FunctionDecl) over to InitializationSequence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 16:09:06 +00:00
Douglas Gregor d6542d8efc Switch InitializedEntity from TypeLoc down to just QualTypes, since we don't use the location information but we did spend a bunch of time building faked-up TypeLocs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91905 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 15:35:07 +00:00
Ken Dyck bdc601b196 Move the implementation of ASTContext::getTypeSizeInChars() to the .cpp file to
avoid #including CharUnits.h in ASTContext.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91903 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 14:23:30 +00:00
Douglas Gregor aa03731079 Switch initialization of parameters in a call over to
InitializationSequence (when a FunctionDecl is present). This required
a few small fixes to initialization sequences:

  - Make sure to use the adjusted parameter type for initialization of
  function parameters.
  - Implement transparent union calling semantics in C



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91902 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 07:24:36 +00:00
Anders Carlsson 8257d411a7 Make sure that we mangle overloaded operators that are member functions correctly, giving them the correct arity.
With this seemingly insignificant fix, we are now able to build and link clang using clang itself! (LLVM still has to be built with gcc for the time being).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 06:36:32 +00:00
Anders Carlsson fc4020a4fa Work around PR5514.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 06:13:42 +00:00
Chris Lattner 813b70d6db fix a bug handling the gnu ?: extension. Patch by Storlek on IRC,
who prefers to be stealthy and mysterious.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 06:00:13 +00:00
Anders Carlsson 1f24032ea2 When we simply return a retained member expression when instantiating, we must also mark the member decl as referenced.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91887 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 05:24:09 +00:00
Eli Friedman bba48cbd77 Zap CheckInitializerTypes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 02:50:30 +00:00
Eli Friedman 4a2c19bf23 Switch default arguments over to InitializationSequence.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91883 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 02:46:13 +00:00
Eli Friedman 085446216a Switch compound literals over to InitializationSequence.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 02:35:53 +00:00
Eli Friedman a91eb541a6 Switch file-scope assignment initialization over to InitializationSequence.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91881 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 02:10:53 +00:00
Daniel Dunbar 4971ff8eea x86_64: Structures with no fields but which have padding should be classified as
integer.
 - This is consistent, but may not be correct. I will revisit x86_64 ABI handling for C++ as a whole at some point.
 - PR5831.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 01:19:25 +00:00
Douglas Gregor 1c7c3fb264 Centralize the emission/suppression/delay of diagnostics describing runtime before in the new function Sema::DiagRuntimeBehavior, addressing one of Chris' comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91870 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 01:01:55 +00:00
John McCall a236a55847 Stop diagnosing the use of inner classes as friends. ddunbar asked whether
this was useful, and on review Doug and I decided it was probably on the level
of a bug in the standard and therefore not worth a warning even in -pedantic.
If someone disagrees and urgently wants clang++ to warn about this in strict
c++98 mode, we can talk about it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91868 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 00:59:39 +00:00
Fariborz Jahanian 1be6b460d5 Template code for rewrite of __block variables - wip.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91865 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 00:48:54 +00:00
Douglas Gregor 9e9199d864 Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, since the context is available in the Decl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91862 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 00:34:07 +00:00
Douglas Gregor 0d6d12b2db When converting from a type to itself or one of its base classes via a
constructor call, the conversion is only a standard conversion
sequence if that constructor is a copy constructor. This fixes PR5834
in a semi-lame way, because the "real" fix will be to move over to
InitializationSequence. That will happen "soonish", but not now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 00:21:20 +00:00
Douglas Gregor d6d37dee48 When filling in value initializations within an initializer list, be
sure to fill in the initialized member of a union when a member was
explicitly designated. Fixes PR5843.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91858 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 00:05:34 +00:00
Fariborz Jahanian 4fcc4fd1ad Providing support for rewriting of block copy/dispose of
imported block variables. WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 23:31:42 +00:00
Daniel Dunbar a91320b8af ARM: Honor -mfpu= and set __VFP_FP__ and __ARM_NEON__ "correctly".
- Correctly is in quotes, because we are following what I interpreted as GCC's
   intent (which diverges from practice, naturally).
 - Also, fix the arch define for arm1136jf-s.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91855 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 23:28:17 +00:00
Daniel Dunbar a9829ae7a3 Improve updating of test/Makefile for out-of-dir builds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91854 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 23:28:06 +00:00
Douglas Gregor 4b52e25f3b When a template-id refers to a single function template, and the
explicitly-specified template arguments are enough to determine the
instantiation, and either template argument deduction fails or is not
performed in that context, we can resolve the template-id down to a
function template specialization (so sayeth C++0x
[temp.arg.explicit]p3). Fixes PR5811.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91852 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 23:17:24 +00:00
Douglas Gregor c78a69dd90 Introduce an assertion to ensure that template argument deduction does
not deduce an "overload" type. Such a deduction indicates a failure in
semantic analysis  (e.g., PR5811) that currently isn't caught until
code-generation time. This assertions makes it clearer that this
particular issue is a semantic-analysis problem, not a code-gen problem.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91844 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 21:27:38 +00:00
Douglas Gregor 840943d633 Improve on my previous fix for debug information. Rather than
recursing in CGDebugInfo::CreateTypeNode, teach
CanonicalizeTypeForDebugInfo---now called UnwrapTypeForDebugInfo---to
keep unwrapping the type until we hit something that can be
represented by debug information. Thanks to Anders for pointing this out!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91840 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 20:18:30 +00:00
Douglas Gregor 2101a821df Teach debug info generation to handle TemplateSpecializationType,
ElaboratedType, QualifiedNameType, and SubstTemplateTypeParmType type
nodes. Also, produce an "unsupported" diagnostic for C++0x type nodes
and "typeof" nodes, rather than asserting nondescriptly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 19:57:21 +00:00
Daniel Dunbar ee788e70fc Add ToolChain::getDriver() and use it instead of going through the HostInfo
object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 18:54:17 +00:00
Fariborz Jahanian 51874dd2ed Allow comparison of 'void *' with function pointer
as a g++ extension (fixes radar 7481987).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 18:19:17 +00:00
John McCall 2b194418b8 Reorganize the base-lookup bits of ActOnMemInitializer in order to better
support diagnostics and error recovery.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 10:41:20 +00:00
Zhongxing Xu 944ebc63c7 Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91818 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 06:52:24 +00:00
Eli Friedman 0f0615bba0 Fix for PR5840: fix the kind of name lookup used for classes in
Sema::getTypeName.

"LookupNestedNameSpecifierName" isn't quite the right kind of lookup, though; 
it doesn't ignore namespaces.  Someone more familiar with the lookup code
should fix this properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91809 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 01:42:38 +00:00
Eli Friedman b1df333e8b Small comment fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91808 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 01:26:45 +00:00
Chris Lattner caabf9bf33 indentation fix
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 01:10:56 +00:00
Anders Carlsson 610b0d94d7 Add tests for structs inside anonymous namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 00:57:38 +00:00
Anders Carlsson 625c1ae781 Incomplete structs should also have internal linkage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 00:41:42 +00:00
Anders Carlsson 17fa6f971c Correcly handle pointers to member pointer types where the class or the pointee is incomplete.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91804 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20 23:37:55 +00:00
Nuno Lopes d20254f287 fix PR4010: add support for the warn_unused_result for function pointers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20 23:11:08 +00:00
Chris Lattner 6405646cb6 fix PR5500: clang fails to parse inline asm with :: in C++ mode
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20 23:08:04 +00:00
Chris Lattner 64cb4757ac refactor asm stmt parsing to avoid nesting as much, and
pull ':' eating out of ParseAsmOperandsOpt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91801 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20 23:00:41 +00:00
Chris Lattner 5796df9464 a really old testcase I apparently forgot to 'svn add'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91800 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20 23:00:15 +00:00
Anders Carlsson 8d14515355 Rework the way pointer types are handled by the RTTI builder. We now get the right linkage for indirect pointers to incomplete structs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91799 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20 22:30:54 +00:00
Eli Friedman dd4e485a0d Make sure we instantiate the destructor for variables initialized by
assignment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20 22:29:11 +00:00
Eli Friedman 33c2da9b3a Fix review comment; no visible change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20 22:12:03 +00:00
Douglas Gregor 745880f350 Switch default-initialization of variables of class type (or array thereof) over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20 22:01:25 +00:00
Douglas Gregor 947f633616 Revert accidental commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20 21:10:58 +00:00
Douglas Gregor 04f81b1fa0 Fix CMake build on windows, from Cedric Venet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20 20:56:30 +00:00