]> granicus.if.org Git - clang/log
clang
13 years agoReflow to a style doug prefers, increasing indentation :-)
Chris Lattner [Thu, 2 Dec 2010 22:52:04 +0000 (22:52 +0000)]
Reflow to a style doug prefers, increasing indentation :-)

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

13 years agoWhen we're performing an explicit cast of some sort, don't complain
Douglas Gregor [Thu, 2 Dec 2010 21:47:04 +0000 (21:47 +0000)]
When we're performing an explicit cast of some sort, don't complain
about deprecated Objective-C pointer conversions. Plus, make sure to
actually set an appropriate AssignmentAction when performing an
implicit conversion from an InitializationSequence. Fixes regressions
in the GCC DejaGNU testsuite.

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

13 years agoImprove on objc diagnostics. // rdar://8721692
Fariborz Jahanian [Thu, 2 Dec 2010 21:00:16 +0000 (21:00 +0000)]
Improve on objc diagnostics. // rdar://8721692

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

13 years agoMerge transparent union types using member's unqualified type
Peter Collingbourne [Thu, 2 Dec 2010 21:00:06 +0000 (21:00 +0000)]
Merge transparent union types using member's unqualified type

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

13 years agoFix range in printf warnings for invalid conversion specifiers.
Ted Kremenek [Thu, 2 Dec 2010 20:57:51 +0000 (20:57 +0000)]
Fix range in printf warnings for invalid conversion specifiers.

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

13 years agoMerge transparent union types using member's canonical param type
Peter Collingbourne [Thu, 2 Dec 2010 20:02:29 +0000 (20:02 +0000)]
Merge transparent union types using member's canonical param type

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

13 years agoFix inverted return value in the ASTImporter. No matter how much LLVM
Douglas Gregor [Thu, 2 Dec 2010 19:33:37 +0000 (19:33 +0000)]
Fix inverted return value in the ASTImporter. No matter how much LLVM
code I wrote, returning "true" on error is still unnatural.

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

13 years agoFixed source range for MS asm statement.
Abramo Bagnara [Thu, 2 Dec 2010 18:34:55 +0000 (18:34 +0000)]
Fixed source range for MS asm statement.

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

13 years agofix PR8726 by teaching the aggregate init optimization code to handle
Chris Lattner [Thu, 2 Dec 2010 18:29:00 +0000 (18:29 +0000)]
fix PR8726 by teaching the aggregate init optimization code to handle
structs with references in them correctly.

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

13 years agoTest for // rdar://8594790
Fariborz Jahanian [Thu, 2 Dec 2010 17:58:10 +0000 (17:58 +0000)]
Test for // rdar://8594790

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

13 years agoAttempt to fix linux buildbots by adding -ffreestanding for arm_neon tests.
Bob Wilson [Thu, 2 Dec 2010 17:31:16 +0000 (17:31 +0000)]
Attempt to fix linux buildbots by adding -ffreestanding for arm_neon tests.
The arm_neon.h header includes stdint.h and it picks up the system header
without -ffreestanding.

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

13 years agoIR Gen. part of API support for __block cxx
Fariborz Jahanian [Thu, 2 Dec 2010 17:02:11 +0000 (17:02 +0000)]
IR Gen. part of API support for __block cxx
objects imported into blocks. //rdar://8594790.
Will have a test case coming (as well as one
sent to llvm test suite).

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

13 years agoDo not change the size of LookupResult::Filter based on the NDEBUG
Douglas Gregor [Thu, 2 Dec 2010 16:19:31 +0000 (16:19 +0000)]
Do not change the size of LookupResult::Filter based on the NDEBUG
macri; the extra bool fits into padding anyway.

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

13 years agoRemove NDEBUG-controlled extra data from
Douglas Gregor [Thu, 2 Dec 2010 16:14:14 +0000 (16:14 +0000)]
Remove NDEBUG-controlled extra data from
TemplateArgumentLocInfo. Unfortunately, this means that we lose some
internal consistency checking when building a debug Clang. However,
having data structures change size/layout depending on NDEBUG causes
pain for clients of the Clang API.

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

13 years agoTweaks.
John McCall [Thu, 2 Dec 2010 10:37:08 +0000 (10:37 +0000)]
Tweaks.

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

13 years agoObjC support in the XML dumper.
John McCall [Thu, 2 Dec 2010 10:24:56 +0000 (10:24 +0000)]
ObjC support in the XML dumper.

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

13 years agoMerge ValueManager into SValBuilder.
Ted Kremenek [Thu, 2 Dec 2010 07:49:45 +0000 (07:49 +0000)]
Merge ValueManager into SValBuilder.

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

13 years agoAdd a test for calling a Neon intrinsic macro with the wrong vector type.
Bob Wilson [Thu, 2 Dec 2010 07:13:31 +0000 (07:13 +0000)]
Add a test for calling a Neon intrinsic macro with the wrong vector type.
This does not work so well with the -fno-lax-vector-conversions option for
testing the arm_neon.h header but that is a really useful test, so I split
this out to a separate Sema test to check for the warning.

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

13 years agoImprove codegen for initializer lists to use memset more aggressively
Chris Lattner [Thu, 2 Dec 2010 07:07:26 +0000 (07:07 +0000)]
Improve codegen for initializer lists to use memset more aggressively
when an initializer is variable (I handled the constant case in a previous
patch).  This has three pieces:

1. Enhance AggValueSlot to have a 'isZeroed' bit to tell CGExprAgg that
   the memory being stored into has previously been memset to zero.
2. Teach CGExprAgg to not emit stores of zero to isZeroed memory.
3. Teach CodeGenFunction::EmitAggExpr to scan initializers to determine
   whether they are profitable to emit a memset + inividual stores vs
   stores for everything.

The heuristic used is that a global has to be more than 16 bytes and
has to be 3/4 zero to be candidate for this xform.  The two testcases
are illustrative of the scenarios this catches.  We now codegen test9 into:

 call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 400, i32 4, i1 false)
 %.array = getelementptr inbounds [100 x i32]* %Arr, i32 0, i32 0
 %tmp = load i32* %X.addr, align 4
 store i32 %tmp, i32* %.array

and test10 into:

  call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 392, i32 8, i1 false)
  %tmp = getelementptr inbounds %struct.b* %S, i32 0, i32 0
  %tmp1 = getelementptr inbounds %struct.a* %tmp, i32 0, i32 0
  %tmp2 = load i32* %X.addr, align 4
  store i32 %tmp2, i32* %tmp1, align 4
  %tmp5 = getelementptr inbounds %struct.b* %S, i32 0, i32 3
  %tmp10 = getelementptr inbounds %struct.a* %tmp5, i32 0, i32 4
  %tmp11 = load i32* %X.addr, align 4
  store i32 %tmp11, i32* %tmp10, align 4

Previously we produced 99 stores of zero for test9 and also tons for test10.
This xforms should substantially speed up -O0 builds when it kicks in as well
as reducing code size and optimizer heartburn on insane cases.  This resolves
PR279.

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

13 years agoattempt to fix a buildbot failure, apparently apache fails to build.
Chris Lattner [Thu, 2 Dec 2010 04:27:29 +0000 (04:27 +0000)]
attempt to fix a buildbot failure, apparently apache fails to build.

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

13 years agoAdd support for the common and nocommon attributes.
Eric Christopher [Thu, 2 Dec 2010 02:45:55 +0000 (02:45 +0000)]
Add support for the common and nocommon attributes.

rdar://8560647

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

13 years agoFileCheckize.
Eric Christopher [Thu, 2 Dec 2010 02:30:43 +0000 (02:30 +0000)]
FileCheckize.

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

13 years agoFileCheckize.
Eric Christopher [Thu, 2 Dec 2010 02:13:27 +0000 (02:13 +0000)]
FileCheckize.

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

13 years agoPerform lvalue-to-rvalue at the end of an expression statement in C.
John McCall [Thu, 2 Dec 2010 02:07:15 +0000 (02:07 +0000)]
Perform lvalue-to-rvalue at the end of an expression statement in C.

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

13 years agoEnhance the init generation logic to emit a memset followed by a few stores when
Chris Lattner [Thu, 2 Dec 2010 01:58:41 +0000 (01:58 +0000)]
Enhance the init generation logic to emit a memset followed by a few stores when
a global is larger than 32 bytes and has fewer than 6 non-zero values in the
initializer.  Previously we'd turn something like this:

char test8(int X) {
  char str[10000] = "abc";

into a 10K global variable which we then memcpy'd from.  Now we generate:

  %str = alloca [10000 x i8], align 16
  %tmp = getelementptr inbounds [10000 x i8]* %str, i64 0, i64 0
  call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 10000, i32 16, i1 false)
  store i8 97, i8* %tmp, align 16
  %0 = getelementptr [10000 x i8]* %str, i64 0, i64 1
  store i8 98, i8* %0, align 1
  %1 = getelementptr [10000 x i8]* %str, i64 0, i64 2
  store i8 99, i8* %1, align 2

Which is much smaller in space and also likely faster.

This is part of PR279

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

13 years agoSimplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ObjCPropertyRefExpr
John McCall [Thu, 2 Dec 2010 01:19:52 +0000 (01:19 +0000)]
Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ObjCPropertyRefExpr
into the latter.

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

13 years agoTest use of arm_neon.h with -fno-lax-vector-conversions.
Bob Wilson [Thu, 2 Dec 2010 01:18:30 +0000 (01:18 +0000)]
Test use of arm_neon.h with -fno-lax-vector-conversions.

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

13 years agoAdd a testcase for Radar 8228022.
Bob Wilson [Thu, 2 Dec 2010 00:25:18 +0000 (00:25 +0000)]
Add a testcase for Radar 8228022.
Make sure the -Wvector-conversions does not cause unnecessary warnings when
using Neon intrinsics with the correct types.

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

13 years agoSwap order of checking for compatible vector types.
Bob Wilson [Thu, 2 Dec 2010 00:25:15 +0000 (00:25 +0000)]
Swap order of checking for compatible vector types.
Check for compatible gcc, Altivec and Neon vectors before handling the
lax-vector-conversions case.  Otherwise there is no way to avoid the
warnings from -Wvector-conversions.

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

13 years agoEliminate two uses of NDEBUG in headers that cause different symbols
Douglas Gregor [Thu, 2 Dec 2010 00:22:25 +0000 (00:22 +0000)]
Eliminate two uses of NDEBUG in headers that cause different symbols
to be available in debug vs. release builds.

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

13 years agoMake TypeLocBuilder an implementation detail of Sema. Nobody else should be using it
Douglas Gregor [Thu, 2 Dec 2010 00:05:49 +0000 (00:05 +0000)]
Make TypeLocBuilder an implementation detail of Sema. Nobody else should be using it

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

13 years agoExtend ExternalASTSource with the ability to lazily complete the
Douglas Gregor [Wed, 1 Dec 2010 23:49:52 +0000 (23:49 +0000)]
Extend ExternalASTSource with the ability to lazily complete the
definition of an Objective-C class. Unlike with C/C++ classes, we
don't have a well-defined point in Sema where Objective-C classes are
checked for completeness, nor do we need to involve Sema when
completing a class. Therefore, we take the appropriate of having the
external AST source mark a particular Objective-C class as having an
external declaration; when using one of the accessors of an
Objective-C class that has an external declaration, we request that
the external AST source fill in the Objective-C class definition.

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

13 years agoSema/AST work for capturing copy init expression
Fariborz Jahanian [Wed, 1 Dec 2010 22:29:46 +0000 (22:29 +0000)]
Sema/AST work for capturing copy init expression
to be used in copy helper synthesis of __block
variables. wip.

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

13 years agoRename all 'AssumeXXX' methods in libChecker
Ted Kremenek [Wed, 1 Dec 2010 22:16:56 +0000 (22:16 +0000)]
Rename all 'AssumeXXX' methods in libChecker
to 'assumeXXX'.

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

13 years ago80-col fixups.
Eric Christopher [Wed, 1 Dec 2010 22:13:54 +0000 (22:13 +0000)]
80-col fixups.

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

13 years agoOptimized IR for vec_splat
Anton Yartsev [Wed, 1 Dec 2010 21:59:31 +0000 (21:59 +0000)]
Optimized IR for vec_splat

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

13 years agoRename all 'EvalXXX' methods in libChecker to
Ted Kremenek [Wed, 1 Dec 2010 21:57:22 +0000 (21:57 +0000)]
Rename all 'EvalXXX' methods in libChecker to
'evalXXX'.

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

13 years agoImprove our handling of cv-qualifiers in Objective-C pointer
Douglas Gregor [Wed, 1 Dec 2010 21:43:58 +0000 (21:43 +0000)]
Improve our handling of cv-qualifiers in Objective-C pointer
conversions. Previously, we would end up collapsing qualification
conversions into the Objective-C pointer conversion step, including
(possibly) stripping qualifiers that shouldn't be removed.

This generalizes BuildSimilarlyQualifiedPointerType() to also work on
Objective-C object pointers, then eliminates the (redundant, not
totally correct) BuildSimilarlyQualifiedObjCObjectPointerType()
function.

Fixes <rdar://problem/8714395>.

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

13 years agoRename 'SValuator' to 'SValBuilder'. The new name
Ted Kremenek [Wed, 1 Dec 2010 21:28:31 +0000 (21:28 +0000)]
Rename 'SValuator' to 'SValBuilder'.  The new name
reflects what the class actually does.

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

13 years agoFix build of in-tree libcxx. libcxx doesn't actually
Shantonu Sen [Wed, 1 Dec 2010 20:38:11 +0000 (20:38 +0000)]
Fix build of in-tree libcxx. libcxx doesn't actually
need any of the LLVM support libraries. Reviewed
by Daniel Dunbar.

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

13 years agoNot content to implement just "extern" explicit template
Douglas Gregor [Wed, 1 Dec 2010 20:32:20 +0000 (20:32 +0000)]
Not content to implement just "extern" explicit template
instantiations, GCC also supports "inline" and "static" explicit
template instantiations. Parse and warn about such constructs, but
don't implement the semantics of either "inline" or "static". They
don't seem to be widely used.

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

13 years agoAdd some comments.
Bob Wilson [Wed, 1 Dec 2010 19:50:20 +0000 (19:50 +0000)]
Add some comments.

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

13 years agoSerialization: support for CUDA language extensions
Peter Collingbourne [Wed, 1 Dec 2010 19:14:57 +0000 (19:14 +0000)]
Serialization: support for CUDA language extensions

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

13 years agoAfter parsing a ':' in an enum-specifier within class context,
Douglas Gregor [Wed, 1 Dec 2010 17:42:47 +0000 (17:42 +0000)]
After parsing a ':' in an enum-specifier within class context,
disambiguate between an expression (for a bit-field width) and a type
(for a fixed underlying type). Since the disambiguation can be
expensive (due to tentative parsing), we perform a simplistic
disambiguation based on one-token lookahead before going into the
full-blown tentative parsing. Based on a patch by Daniel Wallin.

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

13 years agoImprove the diagnostic when the fixed underlying type of a
Douglas Gregor [Wed, 1 Dec 2010 16:10:38 +0000 (16:10 +0000)]
Improve the diagnostic when the fixed underlying type of a
redeclaration of an enum type differs from that of the original
declaration, from Daniel Wallin

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

13 years agoAST printing for scoped enumerations and enumerations with a fixed underlying type...
Douglas Gregor [Wed, 1 Dec 2010 16:01:08 +0000 (16:01 +0000)]
AST printing for scoped enumerations and enumerations with a fixed underlying type, from Daniel Wallin

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

13 years agoEliminate vtables from the Type hierarchy.
John McCall [Wed, 1 Dec 2010 08:12:46 +0000 (08:12 +0000)]
Eliminate vtables from the Type hierarchy.

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

13 years agoRestore the lvalue-to-rvalue conversion patch with a minimal fix.
John McCall [Wed, 1 Dec 2010 04:43:34 +0000 (04:43 +0000)]
Restore the lvalue-to-rvalue conversion patch with a minimal fix.

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

13 years agoRemove stray emacs mode marker.
Nick Lewycky [Wed, 1 Dec 2010 04:33:27 +0000 (04:33 +0000)]
Remove stray emacs mode marker.

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

13 years agotest: add .cu extension
Peter Collingbourne [Wed, 1 Dec 2010 04:22:41 +0000 (04:22 +0000)]
test: add .cu extension

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

13 years agoBasic, Sema: add support for CUDA location attributes
Peter Collingbourne [Wed, 1 Dec 2010 03:15:31 +0000 (03:15 +0000)]
Basic, Sema: add support for CUDA location attributes

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

13 years agoDriver, Frontend: add CUDA language support
Peter Collingbourne [Wed, 1 Dec 2010 03:15:20 +0000 (03:15 +0000)]
Driver, Frontend: add CUDA language support

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

13 years agoBasic: Add CUDA language option
Peter Collingbourne [Wed, 1 Dec 2010 03:15:10 +0000 (03:15 +0000)]
Basic: Add CUDA language option

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

13 years agoDon't check the isysroot path for Path::isValid(); if the user has
Dan Gohman [Wed, 1 Dec 2010 02:59:44 +0000 (02:59 +0000)]
Don't check the isysroot path for Path::isValid(); if the user has
specified a syntactically invalid path, it's better to let the OS
diagnose the problem than to silently skip it.

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

13 years agoadd some infrastructure that will let us codegen
Chris Lattner [Wed, 1 Dec 2010 02:05:19 +0000 (02:05 +0000)]
add some infrastructure that will let us codegen
http://llvm.org/bugs/show_bug.cgi?id=279#c3 better.

No functionality change yet.

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

13 years agoHandle -nostartfiles.
Rafael Espindola [Wed, 1 Dec 2010 01:52:43 +0000 (01:52 +0000)]
Handle -nostartfiles.

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

13 years agoget some i32/i8/i1 constants from Builder, which is much less painful than
Chris Lattner [Wed, 1 Dec 2010 01:47:15 +0000 (01:47 +0000)]
get some i32/i8/i1 constants from Builder, which is much less painful than
using ConstantInt::get.

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

13 years agoImplement AST import support for class template specializations.
Douglas Gregor [Wed, 1 Dec 2010 01:36:18 +0000 (01:36 +0000)]
Implement AST import support for class template specializations.

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

13 years agoWhen unknown method is sent to a receiver of
Fariborz Jahanian [Wed, 1 Dec 2010 01:07:24 +0000 (01:07 +0000)]
When unknown method is sent to a receiver of
'Class' type, disgnostic should refere to a
class method. Fixes // rdar://8592156

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

13 years agoA CGRecordLayout object persists. Since its contained types may
John McCall [Tue, 30 Nov 2010 23:21:46 +0000 (23:21 +0000)]
A CGRecordLayout object persists.  Since its contained types may
refer to opaque types, they must be held via PATypeHolders.  I'm
not sure why this hasn't blown up before.

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

13 years agoCGRecordLayoutBuilder does not need to be exported from this module.
John McCall [Tue, 30 Nov 2010 23:17:27 +0000 (23:17 +0000)]
CGRecordLayoutBuilder does not need to be exported from this module.

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

13 years agoUpdate checker build.
Ted Kremenek [Tue, 30 Nov 2010 23:08:24 +0000 (23:08 +0000)]
Update checker build.

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

13 years agoDeclaring local static in global block
Fariborz Jahanian [Tue, 30 Nov 2010 23:07:14 +0000 (23:07 +0000)]
Declaring local static in global block
literal declaration caused crash in CodeGen.
This patch fixes it. pr8707

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

13 years agoFollow through references to catch returned stack addresses, local blocks, label...
Argyrios Kyrtzidis [Tue, 30 Nov 2010 22:57:32 +0000 (22:57 +0000)]
Follow through references to catch returned stack addresses, local blocks, label addresses or references to temporaries, e.g:

const int& g2() {
  int s1;
  int &s2 = s1; // expected-note {{binding reference variable 's2' here}}
  return s2; // expected-warning {{reference to stack memory associated with local variable 's1' returned}}
}

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

13 years agoImplement basic AST importing and merging support for class template
Douglas Gregor [Tue, 30 Nov 2010 19:14:50 +0000 (19:14 +0000)]
Implement basic AST importing and merging support for class template
declarations.

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

13 years agoEliminate more pointless default statements
Douglas Gregor [Tue, 30 Nov 2010 19:14:03 +0000 (19:14 +0000)]
Eliminate more pointless default statements

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

13 years agoAdd objc_getClass as an objc builtin function
Fariborz Jahanian [Tue, 30 Nov 2010 18:25:34 +0000 (18:25 +0000)]
Add objc_getClass as an objc builtin function
(// rdar://8592641). Also rename LANGUAGEID to
LanguageID.

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

13 years agoL-value to r-value conversion is not ready for prime-time.
John McCall [Tue, 30 Nov 2010 17:58:55 +0000 (17:58 +0000)]
L-value to r-value conversion is not ready for prime-time.

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

13 years agoSuch function decls,as objc's objc_msgSend, builtins in
Fariborz Jahanian [Tue, 30 Nov 2010 17:35:24 +0000 (17:35 +0000)]
Such function decls,as objc's objc_msgSend, builtins in
a specific language. We are adding such language info. by
extensing Builtins.def and via a language flag added
to LIBBUILTIN/BUILTIN and check for that when deciding
a name is builtin or not. Implements //rdar://8689273.

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

13 years agoIntroduce an r-value to l-value cast kind. I'm not promising anything
John McCall [Tue, 30 Nov 2010 10:13:06 +0000 (10:13 +0000)]
Introduce an r-value to l-value cast kind.  I'm not promising anything
about the reliability of this yet.

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

13 years agoMake the dumper safe against null declaration names.
John McCall [Tue, 30 Nov 2010 10:12:16 +0000 (10:12 +0000)]
Make the dumper safe against null declaration names.

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

13 years agoUpdate Xcode project: remove Action.cpp, add DumpXML.cpp.
John McCall [Tue, 30 Nov 2010 10:11:54 +0000 (10:11 +0000)]
Update Xcode project:  remove Action.cpp, add DumpXML.cpp.

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

13 years agoSystem was renamed Support. Fix the build.
Duncan Sands [Tue, 30 Nov 2010 09:08:23 +0000 (09:08 +0000)]
System was renamed Support.  Fix the build.

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

13 years agoTake John McCall's suggestion and fix this silly gcc warnings in a way that
Nick Lewycky [Tue, 30 Nov 2010 07:50:28 +0000 (07:50 +0000)]
Take John McCall's suggestion and fix this silly gcc warnings in a way that
Doug isn't likely to rip back out.

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

13 years agoI hate pointless default statements
Douglas Gregor [Tue, 30 Nov 2010 06:40:00 +0000 (06:40 +0000)]
I hate pointless default statements

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

13 years agoHarden CGDebugInfo::CreateType() a bit for cases where we couldn't generate type...
Douglas Gregor [Tue, 30 Nov 2010 06:38:09 +0000 (06:38 +0000)]
Harden CGDebugInfo::CreateType() a bit for cases where we couldn't generate type info for its component types

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

13 years agoAdd missing file from last commit
Douglas Gregor [Tue, 30 Nov 2010 06:17:12 +0000 (06:17 +0000)]
Add missing file from last commit

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

13 years agoWhen using a precompiled preamble with detailed preprocessing records,
Douglas Gregor [Tue, 30 Nov 2010 06:16:57 +0000 (06:16 +0000)]
When using a precompiled preamble with detailed preprocessing records,
trap the serialized preprocessing records (macro definitions, macro
instantiations, macro definitions) from the generation of the
precompiled preamble, then replay those when walking the list of
preprocessed entities. This eliminates a bug where clang_getCursor()
wasn't able to find preprocessed-entity cursors in the preamble.

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

13 years agoDe-C99-ify for loop
Douglas Gregor [Tue, 30 Nov 2010 06:04:54 +0000 (06:04 +0000)]
De-C99-ify for loop

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

13 years agoTeach c-index-test to reparse the source file a few times when testing
Douglas Gregor [Tue, 30 Nov 2010 05:52:55 +0000 (05:52 +0000)]
Teach c-index-test to reparse the source file a few times when testing
clang_getCursor() via -cursor-at=??? and CINDEXTEST_EDITING is set in
the environment. This mirrors how we test code completion and
source-loading in the presence of this environment variable.

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

13 years agoWhen loading a precompiled preamble, use the file ID of the
Douglas Gregor [Tue, 30 Nov 2010 05:23:00 +0000 (05:23 +0000)]
When loading a precompiled preamble, use the file ID of the
precompiled preamble as the "main" source file's file ID within the
source manager. This makes compiling with a precompiled preamble
produce the same source locations as when compiling without the
precompiled preamble; prior to this change, we ended up with different
file IDs for source locations within the precompiled preamble
vs. those after the precompiled preamble, even for entities (e.g.,
preprocessing entities) in the same file.

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

13 years agoFix bug in r120299 spotted by dgregor.
Nico Weber [Tue, 30 Nov 2010 04:44:33 +0000 (04:44 +0000)]
Fix bug in r120299 spotted by dgregor.

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

13 years agoFix another case of giving the wrong value kind to a dependent cast to
John McCall [Tue, 30 Nov 2010 02:05:44 +0000 (02:05 +0000)]
Fix another case of giving the wrong value kind to a dependent cast to
a non-dependent type.

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

13 years agoReplace \r\n with \n. No functional change.
Nick Lewycky [Tue, 30 Nov 2010 01:47:38 +0000 (01:47 +0000)]
Replace \r\n with \n. No functional change.

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

13 years agoAdd a default clause to avoid this GCC warning:
Nick Lewycky [Tue, 30 Nov 2010 01:28:32 +0000 (01:28 +0000)]
Add a default clause to avoid this GCC warning:
Type.cpp:1000: warning: control reaches end of non-void function

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

13 years agoRevert r120331 since it causes spurious warnings and a possible assertion hit when...
Argyrios Kyrtzidis [Mon, 29 Nov 2010 23:42:03 +0000 (23:42 +0000)]
Revert r120331 since it causes spurious warnings and a possible assertion hit when self-host.

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

13 years agoIncomplete enum types not to be treated as integer type
Fariborz Jahanian [Mon, 29 Nov 2010 23:18:09 +0000 (23:18 +0000)]
Incomplete enum types not to be treated as integer type
when checking for integer signed/unsigned-ness. PR8694,
// rdar://8707031

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

13 years agoEmit warnings if we are returning a reference to a local temporary.
Argyrios Kyrtzidis [Mon, 29 Nov 2010 22:32:08 +0000 (22:32 +0000)]
Emit warnings if we are returning a reference to a local temporary.
The issue was brought to our attention by Matthieu Monrocq.

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

13 years agoAlways use a function's decl context when building default arguments. Fixes http...
Nico Weber [Mon, 29 Nov 2010 18:19:25 +0000 (18:19 +0000)]
Always use a function's decl context when building default arguments. Fixes http://http://llvm.org/pr8479.

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

13 years agoMerge System into Support.
Michael J. Spencer [Mon, 29 Nov 2010 18:12:39 +0000 (18:12 +0000)]
Merge System into Support.

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

13 years agoRevert r120063, it was wrong.
John McCall [Mon, 29 Nov 2010 18:01:58 +0000 (18:01 +0000)]
Revert r120063, it was wrong.

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

13 years agoI hate default statements
Douglas Gregor [Mon, 29 Nov 2010 17:45:20 +0000 (17:45 +0000)]
I hate default statements

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

13 years agoAdd a test for C++ [stmt.label]p1, from Sashan!
Douglas Gregor [Mon, 29 Nov 2010 16:37:40 +0000 (16:37 +0000)]
Add a test for C++ [stmt.label]p1, from Sashan!

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

13 years agoWhen performing code completion within ASTUnit, allocate the AugmentedCodeCompleteCon...
Douglas Gregor [Mon, 29 Nov 2010 16:13:56 +0000 (16:13 +0000)]
When performing code completion within ASTUnit, allocate the AugmentedCodeCompleteConsumer on the heap, so it's always cleaned up properly

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

13 years agoTeach the ASTImporter how to create CXXMethodDecls. Somehow, this case was missed...
Douglas Gregor [Mon, 29 Nov 2010 16:04:58 +0000 (16:04 +0000)]
Teach the ASTImporter how to create CXXMethodDecls. Somehow, this case was missed previously

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

13 years agotest/CMakeLists.txt: Implement the target "check-all". For now, it has no dependencies.
NAKAMURA Takumi [Mon, 29 Nov 2010 01:18:56 +0000 (01:18 +0000)]
test/CMakeLists.txt: Implement the target "check-all". For now, it has no dependencies.

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

13 years agoDon't store the maximum alignment, we can trivially compute it.
Anders Carlsson [Sun, 28 Nov 2010 23:06:23 +0000 (23:06 +0000)]
Don't store the maximum alignment, we can trivially compute it.

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

13 years agoRevert parts of r120266 that I did not mean to commit
Nico Weber [Sun, 28 Nov 2010 22:58:38 +0000 (22:58 +0000)]
Revert parts of r120266 that I did not mean to commit

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

13 years agoMinor whitespace and comment fixes. No functionality change.
Nico Weber [Sun, 28 Nov 2010 22:53:37 +0000 (22:53 +0000)]
Minor whitespace and comment fixes. No functionality change.

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

13 years agoMore work on laying out virtual bases.
Anders Carlsson [Sun, 28 Nov 2010 19:18:44 +0000 (19:18 +0000)]
More work on laying out virtual bases.

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