]> granicus.if.org Git - clang/log
clang
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

14 years agoSet up the semantic context correctly when declaring a friend class template.
John McCall [Fri, 18 Dec 2009 11:25:59 +0000 (11:25 +0000)]
Set up the semantic context correctly when declaring a friend class template.

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

14 years agoLook through using decls when checking whether a name is an acceptable
John McCall [Fri, 18 Dec 2009 10:48:10 +0000 (10:48 +0000)]
Look through using decls when checking whether a name is an acceptable
nested-name specifier name.

I accidentally checked in the test case for this in the last commit ---
fortunately, that refactor was inspired by having debugged this problem already,
so I can fix the bug quick (though probably not fast enough for the buildbots).

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

14 years agoPull Sema::isAcceptableLookupResult into SemaLookup. Extract the criteria into
John McCall [Fri, 18 Dec 2009 10:40:03 +0000 (10:40 +0000)]
Pull Sema::isAcceptableLookupResult into SemaLookup.  Extract the criteria into
different functions and pick the function at lookup initialization time.
In theory we could actually divide the criteria functions into N different
functions for the N cases, but it's so not worth it.

Among other things, lets us invoke LookupQualifiedName without recomputing
IDNS info every time.

Do some refactoring in SemaDecl to avoid an awkward special case in LQN
that was only necessary for redeclaration testing for anonymous structs/unions ---
which could be done more efficiently with a scoped lookup anyway.

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

14 years agoclang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias...
Daniel Dunbar [Fri, 18 Dec 2009 06:30:12 +0000 (06:30 +0000)]
clang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias driver/backend option.

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

14 years agoAddress some of Anders comments
Douglas Gregor [Fri, 18 Dec 2009 05:19:44 +0000 (05:19 +0000)]
Address some of Anders comments

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

14 years agoSwitch the initialization required by return statements over to the
Douglas Gregor [Fri, 18 Dec 2009 05:02:21 +0000 (05:02 +0000)]
Switch the initialization required by return statements over to the
new InitializationSequence. This fixes some bugs (e.g., PR5808),
changed some diagnostics, and caused more churn than expected. What's
new:

  - InitializationSequence now has a "C conversion sequence" category
    and step kind, which falls back to
  - Changed the diagnostics for returns to always have the result type
    of the function first and the type of the expression second.
    CheckSingleAssignmentConstraints to peform checking in C.
  - Improved ASTs for initialization of return values. The ASTs now
    capture all of the temporaries we need to create, but
    intentionally do not bind the tempoary that is actually returned,
    so that it won't get destroyed twice.
  - Make sure to perform an (elidable!) copy of the class object that
    is returned from a class.
  - Fix copy elision in CodeGen to properly see through the
    subexpressions that occur with elidable copies.
  - Give "new" its own entity kind; as with return values and thrown
    objects, we don't bind the expression so we don't call a
    destructor for it.

Note that, with this patch, I've broken returning move-only types in
C++0x. We'll fix it later, when we tackle NRVO.

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

14 years agoAdd -dwarf-debug-flags, which provides a way to embed the cc1 level options used
Daniel Dunbar [Fri, 18 Dec 2009 02:43:17 +0000 (02:43 +0000)]
Add -dwarf-debug-flags, which provides a way to embed the cc1 level options used
to compile a translation unit into the debug info for that file.
 - Used by parts of Darwin build process to check compiler flags, etc.
 - <rdar://problem/7256886> clang does not emit AT_APPLE_flags

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

14 years agoHandle case when DestPtr is 0.
Mike Stump [Fri, 18 Dec 2009 02:14:27 +0000 (02:14 +0000)]
Handle case when DestPtr is 0.

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

14 years agoImplemented rewriting of invocation of a block ivar.
Fariborz Jahanian [Fri, 18 Dec 2009 01:15:21 +0000 (01:15 +0000)]
Implemented rewriting of invocation of a block ivar.
(radar 7482224).

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

14 years agoTemporarily XFAIL this test.
Eli Friedman [Fri, 18 Dec 2009 00:23:19 +0000 (00:23 +0000)]
Temporarily XFAIL this test.

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

14 years agoTestcase fixes to reflect instruction table changes in the LLVM backend
Sean Callanan [Fri, 18 Dec 2009 00:04:09 +0000 (00:04 +0000)]
Testcase fixes to reflect instruction table changes in the LLVM backend
(http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091214/092780.html)
The instruction fixes were checked and approved by Chris Lattner, but
these testcase fixes are mine; please yell at me if there are any
problems with either.

* PR5050-constructor-conversion.cpp
* array-construction.cpp
* constructor-conversion.cpp
* cast-conversion.cpp
* constructor-default-arg.cpp
* derived-to-base-conv.cpp
* ptr-to-member-function.cpp
* call-arg-zero-temp.cpp
* default-destructor-synthesis.cpp
* global-array-destruction.cpp
* array-operator-delete-call.cpp
* decl-ref-init.cpp
* default-constructor-for-members.cpp
* convert-to-fptr.cpp
* constructor-for-array-members.cpp
* conversion-function.cpp
* objc-read-weak-byref.m
Fixed testcase to reflect call qualifier

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

14 years agoPatch over yet more problems with friend declarations which were provoking
John McCall [Thu, 17 Dec 2009 23:21:11 +0000 (23:21 +0000)]
Patch over yet more problems with friend declarations which were provoking
problems on LLVM-Code-Syntax.  This proved remarkably easy to "fix" once
I settled on how I was going to approach it.

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

14 years agoreword the help text of fno_assume_sane_operator_new, following Chris suggestion
Nuno Lopes [Thu, 17 Dec 2009 22:37:33 +0000 (22:37 +0000)]
reword the help text of fno_assume_sane_operator_new, following Chris suggestion

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

14 years agoRevert r91073.
Mike Stump [Thu, 17 Dec 2009 22:14:41 +0000 (22:14 +0000)]
Revert r91073.

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

14 years agoAdd a couple more paths to the LLVM-Code-Syntax test
Douglas Gregor [Thu, 17 Dec 2009 21:51:02 +0000 (21:51 +0000)]
Add a couple more paths to the LLVM-Code-Syntax test

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

14 years agoTweak formatting and comments.
Ted Kremenek [Thu, 17 Dec 2009 20:10:17 +0000 (20:10 +0000)]
Tweak formatting and comments.

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

14 years agoConvert GRExprEngine::VisitCallExpr() to use a worklist instead of recursion to evalu...
Ted Kremenek [Thu, 17 Dec 2009 20:06:29 +0000 (20:06 +0000)]
Convert GRExprEngine::VisitCallExpr() to use a worklist instead of recursion to evaluate the arguments of a CallExpr.  This simplifies the logic and makes it easier to read.  (it also avoids any issues with blowing out the stack if the CallExpr had a ridiculous number of arguments)

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

14 years agoReduce nesting by using early exits. No functionality change.
Ted Kremenek [Thu, 17 Dec 2009 19:17:27 +0000 (19:17 +0000)]
Reduce nesting by using early exits.  No functionality change.

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

14 years agoimplement PR3962: diagnose more faulty cases of usage of the restrict qualifier....
Nuno Lopes [Thu, 17 Dec 2009 11:35:26 +0000 (11:35 +0000)]
implement PR3962: diagnose more faulty cases of usage of the restrict qualifier. this also removes a FIXME

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

14 years agorevert part of my last patch, and mark only the c++ global new operator as noalias...
Nuno Lopes [Thu, 17 Dec 2009 10:15:49 +0000 (10:15 +0000)]
revert part of my last patch, and mark only the c++ global new operator as noalias. the rest will be infered by llvm optz

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

14 years agodocument -fno-assume-sane-operator-new, per Chris request.
Nuno Lopes [Thu, 17 Dec 2009 10:00:52 +0000 (10:00 +0000)]
document -fno-assume-sane-operator-new, per Chris request.
please review for English grammar mistakes

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

14 years agoInclude <time.h> in order to use 'time_t'.
Chandler Carruth [Thu, 17 Dec 2009 09:27:29 +0000 (09:27 +0000)]
Include <time.h> in order to use 'time_t'.

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

14 years agoTest for errors during fread() inside c-index-test and handle them
Chandler Carruth [Thu, 17 Dec 2009 09:18:43 +0000 (09:18 +0000)]
Test for errors during fread() inside c-index-test and handle them
appropriately. This also silences some pedantic GCC warnings.

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

14 years agoSort switch statement. No functionality change.
Ted Kremenek [Thu, 17 Dec 2009 07:38:34 +0000 (07:38 +0000)]
Sort switch statement.  No functionality change.

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

14 years agoRename GetAddrOfRTTI to GetAddrOfRTTIDescriptor. Remove the overload that takes a...
Anders Carlsson [Thu, 17 Dec 2009 07:09:17 +0000 (07:09 +0000)]
Rename GetAddrOfRTTI to GetAddrOfRTTIDescriptor. Remove the overload that takes a CXXRecordDecl since we were just creating a QualType from it anyway.

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

14 years agoEnsure we run cleanups for CXXTemporaries on the exceptional edge. WIP.
Mike Stump [Thu, 17 Dec 2009 06:08:47 +0000 (06:08 +0000)]
Ensure we run cleanups for CXXTemporaries on the exceptional edge.  WIP.

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

14 years agoreimplement r90860, fixing a couple of problems:
Chris Lattner [Thu, 17 Dec 2009 05:29:40 +0000 (05:29 +0000)]
reimplement r90860, fixing a couple of problems:
1. Don't make a copy of LangOptions every time a lexer is created.
2. Don't make CharInfo global mutable state.
3. Fix the implementation to properly treat ^Z as EOF instead of as
   horizontal whitespace, which matches the semantic implemented by VC++.

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

14 years agoSimplify RTTIBuilder::finish.
Anders Carlsson [Thu, 17 Dec 2009 05:10:59 +0000 (05:10 +0000)]
Simplify RTTIBuilder::finish.

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

14 years agoMove the Info vector into the RTTIBuilder struct. No functionality change.
Anders Carlsson [Thu, 17 Dec 2009 05:06:03 +0000 (05:06 +0000)]
Move the Info vector into the RTTIBuilder struct. No functionality change.

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