]> granicus.if.org Git - clang/log
clang
14 years agoSerialize the NoReturn bit on FunctionTypes for precompiled headers
Douglas Gregor [Tue, 22 Dec 2009 18:11:50 +0000 (18:11 +0000)]
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

14 years agoEnter the scope of an initializer for direct-initialization as well as
Douglas Gregor [Tue, 22 Dec 2009 17:47:17 +0000 (17:47 +0000)]
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

14 years agoWhen transforming a C++ "new" expression that was not explicitly given
Douglas Gregor [Tue, 22 Dec 2009 17:13:37 +0000 (17:13 +0000)]
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

14 years agoSwitch parameter-passing for calls via function pointers (where we
Douglas Gregor [Tue, 22 Dec 2009 16:09:06 +0000 (16:09 +0000)]
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

14 years agoSwitch InitializedEntity from TypeLoc down to just QualTypes, since we don't use...
Douglas Gregor [Tue, 22 Dec 2009 15:35:07 +0000 (15:35 +0000)]
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

14 years agoMove the implementation of ASTContext::getTypeSizeInChars() to the .cpp file to
Ken Dyck [Tue, 22 Dec 2009 14:23:30 +0000 (14:23 +0000)]
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

14 years agoSwitch initialization of parameters in a call over to
Douglas Gregor [Tue, 22 Dec 2009 07:24:36 +0000 (07:24 +0000)]
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

14 years agoMake sure that we mangle overloaded operators that are member functions correctly...
Anders Carlsson [Tue, 22 Dec 2009 06:36:32 +0000 (06:36 +0000)]
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

14 years agoWork around PR5514.
Anders Carlsson [Tue, 22 Dec 2009 06:13:42 +0000 (06:13 +0000)]
Work around PR5514.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91891 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix a bug handling the gnu ?: extension. Patch by Storlek on IRC,
Chris Lattner [Tue, 22 Dec 2009 06:00:13 +0000 (06:00 +0000)]
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

14 years agoWhen we simply return a retained member expression when instantiating, we must also...
Anders Carlsson [Tue, 22 Dec 2009 05:24:09 +0000 (05:24 +0000)]
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

14 years agoZap CheckInitializerTypes.
Eli Friedman [Tue, 22 Dec 2009 02:50:30 +0000 (02:50 +0000)]
Zap CheckInitializerTypes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91884 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch default arguments over to InitializationSequence.
Eli Friedman [Tue, 22 Dec 2009 02:46:13 +0000 (02:46 +0000)]
Switch default arguments over to InitializationSequence.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91883 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch compound literals over to InitializationSequence.
Eli Friedman [Tue, 22 Dec 2009 02:35:53 +0000 (02:35 +0000)]
Switch compound literals over to InitializationSequence.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91882 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch file-scope assignment initialization over to InitializationSequence.
Eli Friedman [Tue, 22 Dec 2009 02:10:53 +0000 (02:10 +0000)]
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

14 years agox86_64: Structures with no fields but which have padding should be classified as
Daniel Dunbar [Tue, 22 Dec 2009 01:19:25 +0000 (01:19 +0000)]
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

14 years agoCentralize the emission/suppression/delay of diagnostics describing runtime before...
Douglas Gregor [Tue, 22 Dec 2009 01:01:55 +0000 (01:01 +0000)]
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

14 years agoStop diagnosing the use of inner classes as friends. ddunbar asked whether
John McCall [Tue, 22 Dec 2009 00:59:39 +0000 (00:59 +0000)]
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

14 years agoTemplate code for rewrite of __block variables - wip.
Fariborz Jahanian [Tue, 22 Dec 2009 00:48:54 +0000 (00:48 +0000)]
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

14 years agoEliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, since...
Douglas Gregor [Tue, 22 Dec 2009 00:34:07 +0000 (00:34 +0000)]
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

14 years agoWhen converting from a type to itself or one of its base classes via a
Douglas Gregor [Tue, 22 Dec 2009 00:21:20 +0000 (00:21 +0000)]
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

14 years agoWhen filling in value initializations within an initializer list, be
Douglas Gregor [Tue, 22 Dec 2009 00:05:34 +0000 (00:05 +0000)]
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

14 years agoProviding support for rewriting of block copy/dispose of
Fariborz Jahanian [Mon, 21 Dec 2009 23:31:42 +0000 (23:31 +0000)]
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

14 years agoARM: Honor -mfpu= and set __VFP_FP__ and __ARM_NEON__ "correctly".
Daniel Dunbar [Mon, 21 Dec 2009 23:28:17 +0000 (23:28 +0000)]
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

14 years agoImprove updating of test/Makefile for out-of-dir builds.
Daniel Dunbar [Mon, 21 Dec 2009 23:28:06 +0000 (23:28 +0000)]
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

14 years agoWhen a template-id refers to a single function template, and the
Douglas Gregor [Mon, 21 Dec 2009 23:17:24 +0000 (23:17 +0000)]
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

14 years agoIntroduce an assertion to ensure that template argument deduction does
Douglas Gregor [Mon, 21 Dec 2009 21:27:38 +0000 (21:27 +0000)]
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

14 years agoImprove on my previous fix for debug information. Rather than
Douglas Gregor [Mon, 21 Dec 2009 20:18:30 +0000 (20:18 +0000)]
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

14 years agoTeach debug info generation to handle TemplateSpecializationType,
Douglas Gregor [Mon, 21 Dec 2009 19:57:21 +0000 (19:57 +0000)]
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

14 years agoAdd ToolChain::getDriver() and use it instead of going through the HostInfo
Daniel Dunbar [Mon, 21 Dec 2009 18:54:17 +0000 (18:54 +0000)]
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

14 years agoAllow comparison of 'void *' with function pointer
Fariborz Jahanian [Mon, 21 Dec 2009 18:19:17 +0000 (18:19 +0000)]
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

14 years agoReorganize the base-lookup bits of ActOnMemInitializer in order to better
John McCall [Mon, 21 Dec 2009 10:41:20 +0000 (10:41 +0000)]
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

14 years agoAdd comments.
Zhongxing Xu [Mon, 21 Dec 2009 06:52:24 +0000 (06:52 +0000)]
Add comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91818 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix for PR5840: fix the kind of name lookup used for classes in
Eli Friedman [Mon, 21 Dec 2009 01:42:38 +0000 (01:42 +0000)]
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

14 years agoSmall comment fix.
Eli Friedman [Mon, 21 Dec 2009 01:26:45 +0000 (01:26 +0000)]
Small comment fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91808 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoindentation fix
Chris Lattner [Mon, 21 Dec 2009 01:10:56 +0000 (01:10 +0000)]
indentation fix

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91807 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd tests for structs inside anonymous namespaces.
Anders Carlsson [Mon, 21 Dec 2009 00:57:38 +0000 (00:57 +0000)]
Add tests for structs inside anonymous namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91806 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIncomplete structs should also have internal linkage.
Anders Carlsson [Mon, 21 Dec 2009 00:41:42 +0000 (00:41 +0000)]
Incomplete structs should also have internal linkage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91805 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCorrecly handle pointers to member pointer types where the class or the pointee is...
Anders Carlsson [Sun, 20 Dec 2009 23:37:55 +0000 (23:37 +0000)]
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

14 years agofix PR4010: add support for the warn_unused_result for function pointers
Nuno Lopes [Sun, 20 Dec 2009 23:11:08 +0000 (23:11 +0000)]
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

14 years agofix PR5500: clang fails to parse inline asm with :: in C++ mode
Chris Lattner [Sun, 20 Dec 2009 23:08:04 +0000 (23:08 +0000)]
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

14 years agorefactor asm stmt parsing to avoid nesting as much, and
Chris Lattner [Sun, 20 Dec 2009 23:00:41 +0000 (23:00 +0000)]
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

14 years agoa really old testcase I apparently forgot to 'svn add'.
Chris Lattner [Sun, 20 Dec 2009 23:00:15 +0000 (23:00 +0000)]
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

14 years agoRework the way pointer types are handled by the RTTI builder. We now get the right...
Anders Carlsson [Sun, 20 Dec 2009 22:30:54 +0000 (22:30 +0000)]
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

14 years agoMake sure we instantiate the destructor for variables initialized by
Eli Friedman [Sun, 20 Dec 2009 22:29:11 +0000 (22:29 +0000)]
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

14 years agoFix review comment; no visible change.
Eli Friedman [Sun, 20 Dec 2009 22:12:03 +0000 (22:12 +0000)]
Fix review comment; no visible change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91797 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch default-initialization of variables of class type (or array thereof) over...
Douglas Gregor [Sun, 20 Dec 2009 22:01:25 +0000 (22:01 +0000)]
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

14 years agoRevert accidental commit
Douglas Gregor [Sun, 20 Dec 2009 21:10:58 +0000 (21:10 +0000)]
Revert accidental commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91795 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix CMake build on windows, from Cedric Venet
Douglas Gregor [Sun, 20 Dec 2009 20:56:30 +0000 (20:56 +0000)]
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

14 years agoDon't inject the class name until that magical lbrace.
John McCall [Sun, 20 Dec 2009 07:58:13 +0000 (07:58 +0000)]
Don't inject the class name until that magical lbrace.

Because of the rules of base-class lookup* and the restrictions on typedefs, it
was actually impossible for this to cause any problems more serious than the
spurious acceptance of
  template <class T> class A : B<A> { ... };
instead of
  template <class T> class A : B<A<T> > { ... };
but I'm sure we can all agree that that is a very important restriction which
is well worth making another Parser->Sema call for.

(*) n.b. clang++ does not implement these rules correctly;  we are not ignoring
    non-type names

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91792 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest the lookup I wasn't sure would be done properly after the last patch.
John McCall [Sun, 20 Dec 2009 05:57:29 +0000 (05:57 +0000)]
Test the lookup I wasn't sure would be done properly after the last patch.
Clang reasonably adds all the base specifiers in one pass;  this is now required
for correctness to prevent lookup from going mad.  But this has the advantage of
establishing the correct context when looking up base specifiers, which will be
important for access control.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91791 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoParse base specifiers within the scope of the class. This is possibly not
John McCall [Sat, 19 Dec 2009 21:48:58 +0000 (21:48 +0000)]
Parse base specifiers within the scope of the class.  This is possibly not
quite right;  I'll come back to it later.  It does fix PR 5741.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91789 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agocomments shouldn't go in the AST, and we already make it easy
Chris Lattner [Sat, 19 Dec 2009 20:59:13 +0000 (20:59 +0000)]
comments shouldn't go in the AST, and we already make it easy
to go from a decl to the doc comments for it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91785 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove another ';' after method definition.
Daniel Dunbar [Sat, 19 Dec 2009 18:58:59 +0000 (18:58 +0000)]
Remove another ';' after method definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91781 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove ';' after method definition. Noticed by clang++, which one would think
Daniel Dunbar [Sat, 19 Dec 2009 17:50:07 +0000 (17:50 +0000)]
Remove ';' after method definition. Noticed by clang++, which one would think
would have a higher respect for its own code. This is getting old, is this
warning really adding value?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91779 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoKill off PreDeclaratorDC.
John McCall [Sat, 19 Dec 2009 10:53:49 +0000 (10:53 +0000)]
Kill off PreDeclaratorDC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91772 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRefactor to remove more dependencies on PreDeclaratorDC. I seem to have made
John McCall [Sat, 19 Dec 2009 10:49:29 +0000 (10:49 +0000)]
Refactor to remove more dependencies on PreDeclaratorDC.  I seem to have made
the redeclaration problems in the [temp.explicit]p3 testcase worse, but I can
live with that;  they'll need to be fixed more holistically anyhow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91771 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't use EnterDeclaratorContext when rebuilding a type in the current
John McCall [Sat, 19 Dec 2009 09:35:56 +0000 (09:35 +0000)]
Don't use EnterDeclaratorContext when rebuilding a type in the current
instantiation, since we're not using a Scope object for that anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91770 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoJust push a new scope when parsing an out-of-line variable definition.
John McCall [Sat, 19 Dec 2009 09:28:58 +0000 (09:28 +0000)]
Just push a new scope when parsing an out-of-line variable definition.
Magically fixes all the terrible lookup problems associated with not pushing
a new scope.  Resolves an ancient xfail and an LLVM misparse.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91769 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInitialization improvements: addition of string initialization and a few
Eli Friedman [Sat, 19 Dec 2009 08:11:05 +0000 (08:11 +0000)]
Initialization improvements: addition of string initialization and a few
small bug fixes in SemaInit, switch over SemaDecl to use it more often, and
change a bunch of diagnostics which are different with the new initialization
code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91767 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoA CXXExprWithTemporaries expression is an lvalue if its subexpression
Douglas Gregor [Sat, 19 Dec 2009 07:07:47 +0000 (07:07 +0000)]
A CXXExprWithTemporaries expression is an lvalue if its subexpression
is an lvalue. Fixes PR5787.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91765 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix tyop.
Anders Carlsson [Sat, 19 Dec 2009 06:37:03 +0000 (06:37 +0000)]
Fix tyop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91761 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSome small Builtins.def improvements.
Eli Friedman [Sat, 19 Dec 2009 05:23:20 +0000 (05:23 +0000)]
Some small Builtins.def improvements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91758 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoARM: Use front-end specific target features "soft-float" and "soft-float-abi" to...
Daniel Dunbar [Sat, 19 Dec 2009 04:15:38 +0000 (04:15 +0000)]
ARM: Use front-end specific target features "soft-float" and "soft-float-abi" to communicate FP mode to target; __SOFTFP__ is set correctly now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91755 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTargets: Allow CreateTargetInfo to mutate the target features.
Daniel Dunbar [Sat, 19 Dec 2009 03:30:57 +0000 (03:30 +0000)]
Targets: Allow CreateTargetInfo to mutate the target features.
 - In particular, it can claim features for itself instead of always passing them on to LLVM.
 - This allows using the target features as a generic mechanism for passing target specific options to the TargetInfo instance, which may need them for initializing preprocessor defines, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91753 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse the FunctionDecl's result type to know exactly if it returns a reference.
Zhongxing Xu [Sat, 19 Dec 2009 03:17:55 +0000 (03:17 +0000)]
Use the FunctionDecl's result type to know exactly if it returns a reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91751 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch more of Sema::CheckInitializerTypes over to
Douglas Gregor [Sat, 19 Dec 2009 03:01:41 +0000 (03:01 +0000)]
Switch more of Sema::CheckInitializerTypes over to
InitializationSequence. Specially, switch initialization of a C++
class type (either copy- or direct-initialization).

Also, make sure that we create an elidable copy-construction when
performing copy initialization of a C++ class variable. Fixes PR5826.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91750 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCorrectly initialize the PrimaryBaseInfo if a base is null. Fixes PR5832.
Anders Carlsson [Sat, 19 Dec 2009 02:13:41 +0000 (02:13 +0000)]
Correctly initialize the PrimaryBaseInfo if a base is null. Fixes PR5832.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91748 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUnresolved implicit member accesses are dependent if the object type is dependent.
John McCall [Sat, 19 Dec 2009 02:05:44 +0000 (02:05 +0000)]
Unresolved implicit member accesses are dependent if the object type is dependent.
Avoids an assertion arising during object-argument initialization in overload
resolution.  In theory we can resolve this at definition time if the class
hierarchy for the member is fully known.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91747 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd f80 entry for windows targets
Anton Korobeynikov [Sat, 19 Dec 2009 02:05:07 +0000 (02:05 +0000)]
Add f80 entry for windows targets

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91746 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse proper alignment for i16/i32 on msp430. This fixes PR5815.
Anton Korobeynikov [Sat, 19 Dec 2009 01:32:37 +0000 (01:32 +0000)]
Use proper alignment for i16/i32 on msp430. This fixes PR5815.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91739 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoeliminate a call to NextToken() when parsing ::foo
Chris Lattner [Sat, 19 Dec 2009 01:11:05 +0000 (01:11 +0000)]
eliminate a call to NextToken() when parsing ::foo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91738 91177308-0d34-0410-b5e6-96231b3b80d8

14 years ago<string> already comes in from CharUnits.h
Chris Lattner [Sat, 19 Dec 2009 01:08:23 +0000 (01:08 +0000)]
<string> already comes in from CharUnits.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91737 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach TryAnnotateTypeOrScopeToken to deal with already-annotated
John McCall [Sat, 19 Dec 2009 00:35:18 +0000 (00:35 +0000)]
Teach TryAnnotateTypeOrScopeToken to deal with already-annotated
scope specifiers.  Fix a tentative parsing bug that came up in LLVM.
Incidentally fixes some random FIXMEs in an existing testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91734 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix for PR5524: make reference binding in default argument work correctly.
Eli Friedman [Sat, 19 Dec 2009 00:20:10 +0000 (00:20 +0000)]
Fix for PR5524: make reference binding in default argument work correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91733 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWork in progress for setting the vtable pointers for all bases correctly in
Eli Friedman [Fri, 18 Dec 2009 23:47:41 +0000 (23:47 +0000)]
Work in progress for setting the vtable pointers for all bases correctly in
the constructor.  This doesn't handle cases requiring the VTT at the moment,
and generates unnecessary stores, but I think it's essentially correct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91731 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest for r91724.
Eli Friedman [Fri, 18 Dec 2009 23:42:55 +0000 (23:42 +0000)]
Test for r91724.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91730 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCleanup switch so it doesn't have a default case.
Eli Friedman [Fri, 18 Dec 2009 23:28:34 +0000 (23:28 +0000)]
Cleanup switch so it doesn't have a default case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91725 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix for PR5830: fix the computation of the offset to a virtual base.
Eli Friedman [Fri, 18 Dec 2009 23:27:44 +0000 (23:27 +0000)]
Fix for PR5830: fix the computation of the offset to a virtual base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91724 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd and tidy doxygen comments and move implementation of toString() to newly
Ken Dyck [Fri, 18 Dec 2009 21:51:03 +0000 (21:51 +0000)]
Add and tidy doxygen comments and move implementation of toString() to newly
created CharUnits.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91719 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoC++Tests: Add target paths for LLVM-Code-Compile checks as well.
Daniel Dunbar [Fri, 18 Dec 2009 21:27:23 +0000 (21:27 +0000)]
C++Tests: Add target paths for LLVM-Code-Compile checks as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91716 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a few MSVC warnings.
Daniel Dunbar [Fri, 18 Dec 2009 20:58:47 +0000 (20:58 +0000)]
Fix a few MSVC warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91714 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnhance GRExprEngine::VisitCallExpr() to be used in an lvalue context. Uncovered...
Ted Kremenek [Fri, 18 Dec 2009 20:13:39 +0000 (20:13 +0000)]
Enhance GRExprEngine::VisitCallExpr() to be used in an lvalue context.  Uncovered a new failing test case along the way, but we're making progress on handling C++ references in the analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91710 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse System/DataTypes.h, stdint.h isn't portable.
Daniel Dunbar [Fri, 18 Dec 2009 20:00:49 +0000 (20:00 +0000)]
Use System/DataTypes.h, stdint.h isn't portable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91707 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoARM: Define __thumb2__ for V6T2 targets and only define
Daniel Dunbar [Fri, 18 Dec 2009 19:57:13 +0000 (19:57 +0000)]
ARM: Define __thumb2__ for V6T2 targets and only define
__USING_SJLJ_EXCEPTIONS__ on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91705 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoExtend code-completion results with the type of each result
Douglas Gregor [Fri, 18 Dec 2009 18:53:37 +0000 (18:53 +0000)]
Extend code-completion results with the type of each result

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91702 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoARM: Fix predefines (__ARM_ARCH_..., __REGISTER_PREFIX).
Daniel Dunbar [Fri, 18 Dec 2009 18:42:37 +0000 (18:42 +0000)]
ARM: Fix predefines (__ARM_ARCH_..., __REGISTER_PREFIX).
 - This should be done leveraging the backend, but I'm a little refactored
   out. I'll fix it one day, I promise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91700 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen diagnosing that a decl ref expr is not a value, note the declaration
John McCall [Fri, 18 Dec 2009 18:35:10 +0000 (18:35 +0000)]
When diagnosing that a decl ref expr is not a value, note the declaration
with "declared at" rather than "previous declaration is here".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91699 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDebian has x86_64-linux-gnu, not x86_64-pc-linux-gnu, so add it.
Torok Edwin [Fri, 18 Dec 2009 17:43:54 +0000 (17:43 +0000)]
Debian has x86_64-linux-gnu, not x86_64-pc-linux-gnu, so add it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91698 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTry to de-bork DISABLE_SMART_POINTERS build
Douglas Gregor [Fri, 18 Dec 2009 17:31:58 +0000 (17:31 +0000)]
Try to de-bork DISABLE_SMART_POINTERS build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91696 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCK_UserDefinedConversion is a valid kind when doing copy ctor elision.
Anders Carlsson [Fri, 18 Dec 2009 17:29:21 +0000 (17:29 +0000)]
CK_UserDefinedConversion is a valid kind when doing copy ctor elision.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91695 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove the 4.4.2 c++ include search to the top, otherwise it was picking the 4.1.3
Torok Edwin [Fri, 18 Dec 2009 17:29:14 +0000 (17:29 +0000)]
Move the 4.4.2 c++ include search to the top, otherwise it was picking the 4.1.3
dirs on my system. Which is wrong, since it was missing the x86_64-pc-linux-gnu
suffix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91694 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange clang_codeComplete API to return the results in a structure on
Douglas Gregor [Fri, 18 Dec 2009 16:20:58 +0000 (16:20 +0000)]
Change clang_codeComplete API to return the results in a structure on
the heap, so that clients are not forced to copy the results during
the initial iteration. A separate clang_disposeCodeCompleteResults
function frees the returned results.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91690 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange the return type of ASTContext::getTypeSizeInChars() from uint64_t to the
Ken Dyck [Fri, 18 Dec 2009 15:55:54 +0000 (15:55 +0000)]
Change the return type of ASTContext::getTypeSizeInChars() from uint64_t to the
new opaque value type, CharUnits. This will help us avoid accidentally mixing
quantities that are in bit and character units.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91689 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename getByteSize() and getTypeSizeInBytes() in ASTContext to getCharWidth()
Ken Dyck [Fri, 18 Dec 2009 15:24:05 +0000 (15:24 +0000)]
Rename getByteSize() and getTypeSizeInBytes() in ASTContext to getCharWidth()
and getTypeSizeInChars() to reflect their basis in character type units, not
that of a possibly independent architecture-specific byte.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91688 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix regression I introduced when dynamic_cast-ing to a reference type.
Anders Carlsson [Fri, 18 Dec 2009 14:55:04 +0000 (14:55 +0000)]
Fix regression I introduced when dynamic_cast-ing to a reference type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91687 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIt's perfectly fine to see UserDefinedConversion casts when emitting scalar expressions.
Anders Carlsson [Fri, 18 Dec 2009 14:42:03 +0000 (14:42 +0000)]
It's perfectly fine to see UserDefinedConversion casts when emitting scalar expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91686 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTweaks for PS3 target.
John Thompson [Fri, 18 Dec 2009 14:21:08 +0000 (14:21 +0000)]
Tweaks for PS3 target.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91685 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemoving trailing directory separator, to make stat work
John Thompson [Fri, 18 Dec 2009 14:18:21 +0000 (14:18 +0000)]
Removing trailing directory separator, to make stat work

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91684 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInitial implementation of CharUnits, an opaque value class for representing
Ken Dyck [Fri, 18 Dec 2009 13:39:46 +0000 (13:39 +0000)]
Initial implementation of CharUnits, an opaque value class for representing
sizes, offsets, and alignments in character units.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91683 91177308-0d34-0410-b5e6-96231b3b80d8