]> granicus.if.org Git - clang/log
clang
13 years agoDon't emit nsw flags for vector operations; there's basically no benefit, and a lot...
Eli Friedman [Fri, 6 May 2011 18:04:18 +0000 (18:04 +0000)]
Don't emit nsw flags for vector operations; there's basically no benefit, and a lot of downside (like PR9850, which is about clang's xmmintrin.h making an unexpected transformation on an expression involving _mm_add_epi32).

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

13 years agoFix a couple of comments.
Eli Friedman [Fri, 6 May 2011 17:34:05 +0000 (17:34 +0000)]
Fix a couple of comments.

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

13 years agoAdd an implementation of thunks for varargs methods. The implementation is a bit...
Eli Friedman [Fri, 6 May 2011 17:27:27 +0000 (17:27 +0000)]
Add an implementation of thunks for varargs methods.  The implementation is a bit messy, but it is correct as long as the method in question doesn't use indirect gotos.  A couple of possible alternative implementations are outlined in FIXME's in this patch. rdar://problem/8077308 .

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

13 years agoIntroduce a new libclang parsing flag,
Douglas Gregor [Fri, 6 May 2011 16:33:08 +0000 (16:33 +0000)]
Introduce a new libclang parsing flag,
CXTranslationUnit_NestedMacroInstantiations, which indicates whether
we want to see "nested" macro instantiations (e.g., those that occur
inside other macro instantiations) within the detailed preprocessing
record. Many clients (e.g., those that only care about visible tokens)
don't care about this information, and in code that uses preprocessor
metaprogramming, this information can have a very high cost.

Addresses <rdar://problem/9389320>.

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

13 years agoReset the emitted initializers.
Axel Naumann [Fri, 6 May 2011 15:24:04 +0000 (15:24 +0000)]
Reset the emitted initializers.
This enables incremental codegen, where the initializer array can be removed from the module, such that only new initializers will be emitted and run.

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

13 years agoMove logic for passing down -mrelax-all / -relax-all into a common
Joerg Sonnenberger [Fri, 6 May 2011 14:35:16 +0000 (14:35 +0000)]
Move logic for passing down -mrelax-all / -relax-all into a common
function. Extend the logic to check if the input was compiled.
Use -relax-all as default only if -O0 is used for compilation.
Fixes bug 9290.

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

13 years agoWarn when trying to call a pure virtual member function in a class from the class...
Anders Carlsson [Fri, 6 May 2011 14:25:31 +0000 (14:25 +0000)]
Warn when trying to call a pure virtual member function in a class from the class constructor/destructor. Fixes PR7966.

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

13 years agoRename ContainsCompileAction to ContainsCompileOrAssembleAction to
Joerg Sonnenberger [Fri, 6 May 2011 14:05:11 +0000 (14:05 +0000)]
Rename ContainsCompileAction to ContainsCompileOrAssembleAction to
properly reflect its behavior.

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

13 years agoDo defaulted constructors properly.
Sean Hunt [Fri, 6 May 2011 01:42:00 +0000 (01:42 +0000)]
Do defaulted constructors properly.

Explictly defaultedness is correctly reflected on the AST, but there are
no changes to how that affects the definition of functions or much else
really.

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

13 years agoRevert r130912 in order to approach defaulted functions from the other
Sean Hunt [Fri, 6 May 2011 00:11:07 +0000 (00:11 +0000)]
Revert r130912 in order to approach defaulted functions from the other
direction and not introduce things in the wrong place three different
times.

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

13 years agoSlight tweak to alias template error handling: don't guess that a template-id in...
Richard Smith [Thu, 5 May 2011 22:36:10 +0000 (22:36 +0000)]
Slight tweak to alias template error handling: don't guess that a template-id in an alias declaration was meant to be a specialization. Use a generic, but more accurate, diagnostic.

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

13 years agoUpdate www: we now mangle references to function parameters properly. Also, this...
Richard Smith [Thu, 5 May 2011 22:07:51 +0000 (22:07 +0000)]
Update www: we now mangle references to function parameters properly. Also, this is really more a decltype issue rather than a late-specified return type issue.

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

13 years agotype of last arg of objc_assign_ivar is ptrdiff_t.
Fariborz Jahanian [Thu, 5 May 2011 22:00:38 +0000 (22:00 +0000)]
type of last arg of objc_assign_ivar is  ptrdiff_t.
// rdar://9362887

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

13 years agoImplement support for C++0x alias templates.
Richard Smith [Thu, 5 May 2011 21:57:07 +0000 (21:57 +0000)]
Implement support for C++0x alias templates.

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

13 years ago__alignof attribute on the field must consider
Fariborz Jahanian [Thu, 5 May 2011 21:19:14 +0000 (21:19 +0000)]
__alignof attribute on the field must consider
packed attribute on the field. //rdar://9217290

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

13 years agoWhen the environment variable LIBCLANG_RESOURCE_USAGE is set, teach
Douglas Gregor [Thu, 5 May 2011 20:27:22 +0000 (20:27 +0000)]
When the environment variable LIBCLANG_RESOURCE_USAGE is set, teach
libclang to emit information about resource usage after parsing, code
completion, etc.

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

13 years agoPR9849: Fix _mm_setr_pi32 and friends to actually work correctly. They broke with...
Eli Friedman [Thu, 5 May 2011 20:21:54 +0000 (20:21 +0000)]
PR9849: Fix _mm_setr_pi32 and friends to actually work correctly.  They broke with the MMX rewrite a while back.

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

13 years agotests: Force a triple in this test (so uint128 is present).
Daniel Dunbar [Thu, 5 May 2011 18:54:06 +0000 (18:54 +0000)]
tests: Force a triple in this test (so uint128 is present).

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

13 years agoWhen instantiating a block expression, the instantiated
Fariborz Jahanian [Thu, 5 May 2011 17:18:12 +0000 (17:18 +0000)]
When instantiating a block expression, the instantiated
blockScopeInfo's CapturesCXXThis field need get set as
well. // rdar://9362021. John M. please review.

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

13 years agoDo not drop uint128 on the floor.
Devang Patel [Thu, 5 May 2011 17:06:30 +0000 (17:06 +0000)]
Do not drop uint128 on the floor.

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

13 years agoScoped enumerations should not be treated as integer types (in the C
Douglas Gregor [Thu, 5 May 2011 16:13:52 +0000 (16:13 +0000)]
Scoped enumerations should not be treated as integer types (in the C
sense). Fixes <rdar://problem/9366066> by eliminating an inconsistency
between C++ overloading (which handled scoped enumerations correctly)
and C binary operator type-checking (which didn't).

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

13 years agoWhen providing code completions for an Objective-C property access,
Douglas Gregor [Thu, 5 May 2011 15:50:42 +0000 (15:50 +0000)]
When providing code completions for an Objective-C property access,
also include methods with zero-argument selectors. Implements
<rdar://problem/9048332>.

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

13 years agoIntroduce a Diagnostic::Report function that accepts and emits a StoredDiagnostic.
Argyrios Kyrtzidis [Thu, 5 May 2011 07:54:59 +0000 (07:54 +0000)]
Introduce a Diagnostic::Report function that accepts and emits a StoredDiagnostic.

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

13 years agoPlace "incompatible pointer types assigning..." warning under a flag, allowing it...
Ted Kremenek [Thu, 5 May 2011 04:37:05 +0000 (04:37 +0000)]
Place "incompatible pointer types assigning..." warning under a flag, allowing it to be surgically mapped to an error.

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

13 years agoAdd Checker callback for running a checker at the end of processing an entire Transla...
Ted Kremenek [Thu, 5 May 2011 03:41:17 +0000 (03:41 +0000)]
Add Checker callback for running a checker at the end of processing an entire TranslationUnit.  Patch by Lei Zhang.

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

13 years agoImplement some framework for defaulted constructors.
Sean Hunt [Thu, 5 May 2011 03:36:28 +0000 (03:36 +0000)]
Implement some framework for defaulted constructors.

There's some unused stuff for now.

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

13 years agoFrontend: Fix a crash in CC_LOG_DIAGNOSTICS handling.
Daniel Dunbar [Thu, 5 May 2011 02:12:02 +0000 (02:12 +0000)]
Frontend: Fix a crash in CC_LOG_DIAGNOSTICS handling.

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

13 years agoLook through block pointers and ObjC object pointers
Matt Beaumont-Gay [Thu, 5 May 2011 00:59:35 +0000 (00:59 +0000)]
Look through block pointers and ObjC object pointers

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

13 years agoWith invalid overloaded operators, we can get into funny cases where
Douglas Gregor [Thu, 5 May 2011 00:13:13 +0000 (00:13 +0000)]
With invalid overloaded operators, we can get into funny cases where
the overloading of member and non-member functions results in arity
mismatches that don't fit well into our overload-printing scheme. This
only happens for invalid code (which breaks the arity invariants for
these cases), so just suppress the diagnostic rather than inventing
anything new. Fixes <rdar://problem/9222009>.

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

13 years agoPreserve the full name of the file, so that '-c -o foo.pic.o' produces
Nick Lewycky [Thu, 5 May 2011 00:08:20 +0000 (00:08 +0000)]
Preserve the full name of the file, so that '-c -o foo.pic.o' produces
foo.pic.gcno instead of foo.gcno.

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

13 years agoChange cycle detection to be based off of a warning flag.
Sean Hunt [Thu, 5 May 2011 00:05:47 +0000 (00:05 +0000)]
Change cycle detection to be based off of a warning flag.

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

13 years agoWhen adding KVC code completions, keep track of all of the selectors
Douglas Gregor [Wed, 4 May 2011 23:50:46 +0000 (23:50 +0000)]
When adding KVC code completions, keep track of all of the selectors
that we've previously seen, both in declared methods and from previous
KVC completions, to eliminate duplicates. Fixes <rdar://problem/9162207>.

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

13 years agothere i fixed it
Sean Hunt [Wed, 4 May 2011 23:29:54 +0000 (23:29 +0000)]
there i fixed it

Increase robustness of the delegating constructor cycle detection
mechanism. No more infinite loops on invalid or logic errors leading to
false results. Ensure that this is maintained correctly accross
serialization.

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

13 years agoASTUnit::LoadFromASTFile(): recover the resources from an ASTReader if it crashes...
Ted Kremenek [Wed, 4 May 2011 23:27:12 +0000 (23:27 +0000)]
ASTUnit::LoadFromASTFile(): recover the resources from an ASTReader if it crashes during PCH validation.

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

13 years agoClean up Sema::BuildCXXNestedNameSpecifier()'s creation of TypeLoc
Douglas Gregor [Wed, 4 May 2011 23:05:40 +0000 (23:05 +0000)]
Clean up Sema::BuildCXXNestedNameSpecifier()'s creation of TypeLoc
information. Rather than looking at the declaration kind to figure out
what TypeLoc to build, look at the type; it makes so much more
sense. Fixes <rdar://problem/9086649>.

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

13 years agoImplement Sema::isExprCallable.
Matt Beaumont-Gay [Wed, 4 May 2011 22:10:40 +0000 (22:10 +0000)]
Implement Sema::isExprCallable.

We can use this to produce nice diagnostics (and try to fixit-and-recover) in
various cases where we might see "MyFunction" instead of "MyFunction()". The
changes in SemaExpr are an example of how to use isExprCallable.

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

13 years agoWhen converting an integral template argument value to a non-type
Douglas Gregor [Wed, 4 May 2011 21:55:00 +0000 (21:55 +0000)]
When converting an integral template argument value to a non-type
template parameter of type 'bool', force the value to be zero or
one. Fixes <rdar://problem/9169404>.

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

13 years agoPack ivar offsets together.
Bill Wendling [Wed, 4 May 2011 21:37:25 +0000 (21:37 +0000)]
Pack ivar offsets together.

Ivar offsets for synthesized ivars are wrong, which could end up with a large
number of dirty pages because of ivar fixups at runtime. When we pack all of the
synthesized ivars into the same section, it limits the number of dirty pages
created. Place them in the "__DATA,__objc_ivar" section.
<rdar://problem/9374905>

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

13 years agoRecord where the GCOV data files should be placed.
Nick Lewycky [Wed, 4 May 2011 20:46:58 +0000 (20:46 +0000)]
Record where the GCOV data files should be placed.

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

13 years agoSimplification noticed by Chris.
Bill Wendling [Wed, 4 May 2011 20:28:12 +0000 (20:28 +0000)]
Simplification noticed by Chris.

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

13 years agotests: Tweak test to at least use a standard arch, to ensure we try to invoke
Daniel Dunbar [Wed, 4 May 2011 19:52:08 +0000 (19:52 +0000)]
tests: Tweak test to at least use a standard arch, to ensure we try to invoke
Clang.

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

13 years agoAnd a test case for my last patch.
Fariborz Jahanian [Wed, 4 May 2011 18:58:27 +0000 (18:58 +0000)]
And a test case for my last patch.

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

13 years agoMore ms_struct bitfield stuff:
Fariborz Jahanian [Wed, 4 May 2011 18:51:37 +0000 (18:51 +0000)]
More ms_struct bitfield stuff:
Adjacent bit fields are packed into the same 1-, 2-, or
4-byte allocation unit if the integral types are the same
size. // rdar://8823265.

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

13 years agoChange test/PCH/cxx-static_assert.cpp so that it doesn't need a separate header.
Argyrios Kyrtzidis [Wed, 4 May 2011 14:58:28 +0000 (14:58 +0000)]
Change test/PCH/cxx-static_assert.cpp so that it doesn't need a separate header.

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

13 years agoFrom Vassil Vassilev:
Axel Naumann [Wed, 4 May 2011 12:59:24 +0000 (12:59 +0000)]
From Vassil Vassilev:
Like in r126648, provide (empty) default implementation for pure virtual getMemoryBufferSizes(). Not all use cases have meaningful implementations.

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

13 years agoAdd C++ include paths for libstdc++ with Ubuntu 11.04 and Debian's libstdc++6-4.5...
Axel Naumann [Wed, 4 May 2011 09:25:56 +0000 (09:25 +0000)]
Add C++ include paths for libstdc++ with Ubuntu 11.04 and Debian's libstdc++6-4.5, as collected from http://packages.ubuntu.com/search?mode=exactfilename&suite=natty&section=all&arch=any&searchon=contents&keywords=c%2B%2Blocale.h and http://packages.debian.org/wheezy/armel/libstdc++6-4.5-dev/filelist
Fixes compilation with clang++ on Ubuntu 11.04.

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

13 years agoImplement a better version of delegating constructor cycle detection.
Sean Hunt [Wed, 4 May 2011 05:57:24 +0000 (05:57 +0000)]
Implement a better version of delegating constructor cycle detection.

This is more efficient as it's all done at once at the end of the TU.
This could still get expensive, so a flag is provided to disable it. As
an added bonus, the diagnostics will now print out a cycle.

The PCH test is XFAILed because we currently can't deal with a note
emitted in the header and I, being tired, see no other way to verify the
serialization of delegating constructors. We should probably address
this problem /somehow/ but no good solution comes to mind.

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

13 years agoNo, fix this use after free properly.
Nick Lewycky [Wed, 4 May 2011 03:44:01 +0000 (03:44 +0000)]
No, fix this use after free properly.

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

13 years agoConvert the non-temporal store builtins to LLVM-native IR.
Bill Wendling [Wed, 4 May 2011 02:40:38 +0000 (02:40 +0000)]
Convert the non-temporal store builtins to LLVM-native IR.

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

13 years agoFix use after free through StringRef.
Nick Lewycky [Wed, 4 May 2011 02:06:19 +0000 (02:06 +0000)]
Fix use after free through StringRef.

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

13 years agoType prefixes of unresolved-names should only be mangled as unresolved-types
John McCall [Wed, 4 May 2011 01:45:19 +0000 (01:45 +0000)]
Type prefixes of unresolved-names should only be mangled as unresolved-types
if they match that production, i.e. if they're template type parameters
or decltypes (or, as an obvious case not yet described in the ABI document,
if they're template template parameters applied to template arguments).

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

13 years agoEnhance clang_getCXTUResourceUsage() to return the amount of memory used by the Prepr...
Ted Kremenek [Wed, 4 May 2011 01:38:46 +0000 (01:38 +0000)]
Enhance clang_getCXTUResourceUsage() to return the amount of memory used by the Preprocessor's bump allocator as well as those from the PreprocessingRecord.

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

13 years agoImplement serialization of delegating constructors.
Sean Hunt [Wed, 4 May 2011 01:19:08 +0000 (01:19 +0000)]
Implement serialization of delegating constructors.

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

13 years agoEnsure that delegating constructor loop detection uses canonical
Sean Hunt [Wed, 4 May 2011 01:19:04 +0000 (01:19 +0000)]
Ensure that delegating constructor loop detection uses canonical
declarations.

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

13 years agoFix the delegating constructors test to not rely on basic block names.
Sean Hunt [Wed, 4 May 2011 00:59:33 +0000 (00:59 +0000)]
Fix the delegating constructors test to not rely on basic block names.

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

13 years agoWhen tag lookup finds something ambiguous, and we're defining a new
Douglas Gregor [Wed, 4 May 2011 00:25:33 +0000 (00:25 +0000)]
When tag lookup finds something ambiguous, and we're defining a new
tag, filter out those ambiguous names that we found if they aren't
within the declaration context where this newly-defined tag will be
visible.

This is basically a hack, because we really need to fix the lookup of
tag declarations in this case to not find things it
shouldn't. However, it's better than what we had before, and it fixes
<rdar://problem/9168556>.

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

13 years agoFix a typo in a test.
Richard Trieu [Wed, 4 May 2011 00:16:24 +0000 (00:16 +0000)]
Fix a typo in a test.
CHEKC -> CHECK

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

13 years agoIntroduce a new libclang API, clang_isFileMultipleIncludeGuarded(),
Douglas Gregor [Wed, 4 May 2011 00:14:37 +0000 (00:14 +0000)]
Introduce a new libclang API, clang_isFileMultipleIncludeGuarded(),
which determines whether a particular file is actually a header that
is intended to be guarded from multiple inclusions within the same
translation unit.

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

13 years agoIntroduce ASTUnit::LoadFromCompilerInvocationAction that allows one to create an...
Argyrios Kyrtzidis [Tue, 3 May 2011 23:26:34 +0000 (23:26 +0000)]
Introduce ASTUnit::LoadFromCompilerInvocationAction that allows one to create an ASTUnit
from a CompilerInvocation along with an ASTFrontendAction to invoke, and without all the goo
about the precompiled preamble.

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

13 years agoEnsure that destructors are properly inovked when an exception leaves
Sean Hunt [Tue, 3 May 2011 23:05:34 +0000 (23:05 +0000)]
Ensure that destructors are properly inovked when an exception leaves
the body of a delegating constructor call.

This means that the delegating constructor implementation should be
complete and correct, though there are some rough edges (diagnostic
quality with the cycle detection and using a deleted destructor).

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

13 years agoOnly the first zero-length bitfield decides alignment of
Fariborz Jahanian [Tue, 3 May 2011 22:07:14 +0000 (22:07 +0000)]
Only the first zero-length bitfield decides alignment of
the followup data member in an ms_struct struct.
// rdar:// 8823265

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

13 years agoMove the AST modifications to after the cycle detection in
Sean Hunt [Tue, 3 May 2011 20:43:02 +0000 (20:43 +0000)]
Move the AST modifications to after the cycle detection in
lib/Sema/SemaDeclCXX.cpp to avoid getting stuck in an infinite loop. See
the comment for more explanation.

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

13 years agoExtend -Wnon-pod-memset to also encompass memcpy() and memmove(),
Douglas Gregor [Tue, 3 May 2011 20:37:33 +0000 (20:37 +0000)]
Extend -Wnon-pod-memset to also encompass memcpy() and memmove(),
checking both the source and the destination operands, renaming the
warning group to -Wnon-pod-memaccess and tweaking the diagnostic text
in the process.

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

13 years agoSilence warnings.
Devang Patel [Tue, 3 May 2011 20:22:16 +0000 (20:22 +0000)]
Silence warnings.

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

13 years agoFinish off rules for z-length bitfields in ms_struct
Fariborz Jahanian [Tue, 3 May 2011 20:21:04 +0000 (20:21 +0000)]
Finish off rules for z-length bitfields in ms_struct
structs. // rdar://8823265

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

13 years agoFix delegating constructors stylistic issues.
Sean Hunt [Tue, 3 May 2011 20:19:28 +0000 (20:19 +0000)]
Fix delegating constructors stylistic issues.

Material bugfixes to come this afternoon.

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

13 years agoSeparate the -Wnon-pod-memset warnings into two separate warnings:
Douglas Gregor [Tue, 3 May 2011 20:05:22 +0000 (20:05 +0000)]
Separate the -Wnon-pod-memset warnings into two separate warnings:
  - a default-on warning for pointers to dynamic classes (= classes with vtables)
  - a default-off warning for other non-POD types

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

13 years agoRemove unused but set variable.
Benjamin Kramer [Tue, 3 May 2011 18:46:17 +0000 (18:46 +0000)]
Remove unused but set variable.

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

13 years agoFix a double free when parsing malformed code. Fixes rdar://9173693.
Argyrios Kyrtzidis [Tue, 3 May 2011 18:45:38 +0000 (18:45 +0000)]
Fix a double free when parsing malformed code. Fixes rdar://9173693.

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

13 years agoWhen parsing a template friend declaration we dropped the template
Chandler Carruth [Tue, 3 May 2011 18:35:10 +0000 (18:35 +0000)]
When parsing a template friend declaration we dropped the template
parameters on the floor in certain cases:
class X {
  template <typename T> friend typename A<T>::Foo;
};

This was parsed as a *non* template friend declaration some how, and
received an ExtWarn. Fixing the parser to actually provide the template
parameters to the freestanding declaration parse triggers the code which
specifically looks for such constructs and hard errors on them.

Along the way, this prevents us from trying to instantiate constructs
like the above inside of a outer template. This is important as loosing
the template parameters means we don't have a well formed declaration
and template instantiation will be unable to rebuild the AST. That fixes
a crash in the GCC test suite.

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

13 years agoOnly check the use of memset() if we're refering to a C function named
Douglas Gregor [Tue, 3 May 2011 18:11:37 +0000 (18:11 +0000)]
Only check the use of memset() if we're refering to a C function named
'memset' with external linkage.

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

13 years agoAdd a few ARM coprocessor builtins. The llvm side of the commit contains the intrinsi...
Bruno Cardoso Lopes [Tue, 3 May 2011 17:29:43 +0000 (17:29 +0000)]
Add a few ARM coprocessor builtins. The llvm side of the commit contains the intrinsics and matching patterns.

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

13 years agoRemove several more rvalue references from swap arguments in libstdc++4.4.
Jeffrey Yasskin [Tue, 3 May 2011 17:28:13 +0000 (17:28 +0000)]
Remove several more rvalue references from swap arguments in libstdc++4.4.

unique_ptr and shared_ptr changes by Daniel Mierswa!

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

13 years agoRemoving strncpy() checking in CString checker for now. Some significant changes...
Lenny Maiorani [Tue, 3 May 2011 16:34:26 +0000 (16:34 +0000)]
Removing strncpy() checking in CString checker for now. Some significant changes need to be made to properly support modeling of it since it potentially leaves strings non-null terminated.

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

13 years agoUpdate metadata id number in string compare check.
Devang Patel [Tue, 3 May 2011 16:19:38 +0000 (16:19 +0000)]
Update metadata id number in string compare check.

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

13 years agoRevert r130750, "Make the mno flags match GCC. Patch by Alexander Best!", it breaks...
Daniel Dunbar [Tue, 3 May 2011 15:34:01 +0000 (15:34 +0000)]
Revert r130750, "Make the mno flags match GCC. Patch by Alexander Best!", it breaks tests.

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

13 years agoMake the mno flags match GCC. Patch by Alexander Best!
Michael J. Spencer [Tue, 3 May 2011 04:35:54 +0000 (04:35 +0000)]
Make the mno flags match GCC. Patch by Alexander Best!

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

13 years agoUse the canonical decl when generating the locations for USRs.
Ted Kremenek [Tue, 3 May 2011 01:33:35 +0000 (01:33 +0000)]
Use the canonical decl when generating the locations for USRs.

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

13 years agoAdded an assert to IntegerLiteral to ensure that the integer type passed in has the...
Richard Trieu [Mon, 2 May 2011 23:00:27 +0000 (23:00 +0000)]
Added an assert to IntegerLiteral to ensure that the integer type passed in has the same size as the APInt passed in.  Also, updated the comments around IntegerLiteral.

Changed the integer type that range-based for-loops used.  Switched to pointer difference type, which satisfies the new assert in IntegerLiteral.

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

13 years agoFunction with internal linkage name do not have mangled name.
Devang Patel [Mon, 2 May 2011 22:49:30 +0000 (22:49 +0000)]
Function with internal linkage name do not have mangled name.

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

13 years agoDo not try to get mangled name of block helpers. Apply a stopgap measure to fix Singl...
Devang Patel [Mon, 2 May 2011 22:37:48 +0000 (22:37 +0000)]
Do not try to get mangled name of block helpers. Apply a stopgap measure to fix SingleSource/UnitTests/block-copied-in-cxxobj compile time crash.

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

13 years agoTweak the retain/release checker to not stop tracking retained objects when calling...
Ted Kremenek [Mon, 2 May 2011 21:21:42 +0000 (21:21 +0000)]
Tweak the retain/release checker to not stop tracking retained objects when calling C++ methods.  This is a temporary solution to prune false positives until we have a general story using annotations.

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

13 years agoAdd the -mstackrealign option which just communicates the need to
Eric Christopher [Mon, 2 May 2011 21:18:22 +0000 (21:18 +0000)]
Add the -mstackrealign option which just communicates the need to
force align the stack to the backend.

Fixes rdar://9289631

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

13 years agoDriver/Darwin: Honor --sysroot= when invoking the linker, on Darwin.
Daniel Dunbar [Mon, 2 May 2011 21:03:47 +0000 (21:03 +0000)]
Driver/Darwin: Honor --sysroot= when invoking the linker, on Darwin.

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

13 years agoFixed test case asserts due to checkin of r130710.
Chad Rosier [Mon, 2 May 2011 20:39:21 +0000 (20:39 +0000)]
Fixed test case asserts due to checkin of r130710.

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

13 years agoEmit debug info for __destroy_helper_block_ and __copy_helper_block.
Devang Patel [Mon, 2 May 2011 20:37:08 +0000 (20:37 +0000)]
Emit debug info for __destroy_helper_block_ and __copy_helper_block.

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

13 years agoSkip extra copy from aggregate where it isn't necessary; rdar://problem/8139919 ...
Eli Friedman [Mon, 2 May 2011 20:24:29 +0000 (20:24 +0000)]
Skip extra copy from aggregate where it isn't necessary; rdar://problem/8139919 .  This shouldn't make much of a difference at -O3, but should substantially reduce the number of generated memcpy's at -O0.

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

13 years agoAugment retain/release checker to not warn about tracked objects passed as arguments...
Ted Kremenek [Mon, 2 May 2011 19:42:42 +0000 (19:42 +0000)]
Augment retain/release checker to not warn about tracked objects passed as arguments to C++ constructors.  This is a stop-gap measure for Objective-C++ code that uses smart pointers to manage reference counts.

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

13 years agoWhen using -std= flag added check to make sure language and standard are compatable
Chad Rosier [Mon, 2 May 2011 19:24:53 +0000 (19:24 +0000)]
When using -std= flag added check to make sure language and standard are compatable

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

13 years agoImplements strncasecmp() checker and simplifies some of the logic around creating...
Lenny Maiorani [Mon, 2 May 2011 19:05:49 +0000 (19:05 +0000)]
Implements strncasecmp() checker and simplifies some of the logic around creating substrings if necessary and calling the appropriate StringRef::compare/compare_lower().

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

13 years agoDon't abuse reinterpret cast to do something the API of PointerUnion
Chandler Carruth [Mon, 2 May 2011 18:54:36 +0000 (18:54 +0000)]
Don't abuse reinterpret cast to do something the API of PointerUnion
provides proper support for. This was caught by
-Wundefined-reinterpret-cast, and I think a reasonable case for it to
warn on.

Also use is<...> instead of dyn_cast<...> when the result isn't needed.

This whole thing should probably switch to using UsuallyTinyPtrVector.

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

13 years agoAdds a test for the command line parser when a quoted string is not closed by a quote.
Manuel Klimek [Mon, 2 May 2011 18:27:26 +0000 (18:27 +0000)]
Adds a test for the command line parser when a quoted string is not closed by a quote.

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

13 years agoAdd a warning for when reinterpret_cast leads to undefined behavior, patch by Richard...
Argyrios Kyrtzidis [Mon, 2 May 2011 18:21:19 +0000 (18:21 +0000)]
Add a warning for when reinterpret_cast leads to undefined behavior, patch by Richard Trieu!

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

13 years agoSwitch CallArgList from an std::pair to a new CallArg struct (which will eventually...
Eli Friedman [Mon, 2 May 2011 18:05:27 +0000 (18:05 +0000)]
Switch CallArgList from an std::pair to a new CallArg struct (which will eventually gain more members). Working towards modifying call emission to avoid unnecessary copies.

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

13 years agoSimplify code a bit by using CallArgList::add. No intended functionality change.
Eli Friedman [Mon, 2 May 2011 17:57:46 +0000 (17:57 +0000)]
Simplify code a bit by using CallArgList::add.  No intended functionality change.

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

13 years agoDisable CFI if not using the integrated assembler. We should probably do this only for
Rafael Espindola [Mon, 2 May 2011 17:43:32 +0000 (17:43 +0000)]
Disable CFI if not using the integrated assembler. We should probably do this only for
OS X, but it is probably not all that important.

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

13 years agoMore rule enforcement of zero bitfields for ms_struct.
Fariborz Jahanian [Mon, 2 May 2011 17:20:56 +0000 (17:20 +0000)]
More rule enforcement of zero bitfields for ms_struct.

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

13 years agolib/Frontend/InitHeaderSearch.cpp: Tweak AddPath() to accept "/foo/bar" (not "X:...
NAKAMURA Takumi [Mon, 2 May 2011 04:50:10 +0000 (04:50 +0000)]
lib/Frontend/InitHeaderSearch.cpp: Tweak AddPath() to accept "/foo/bar" (not "X:\foo\bar") with -isysroot. test/PCH/reloc.c can pass.

FIXME: We should consider better isysroot scheme on Win32 hosts.

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

13 years agotest/CodeGenCXX/vtable-debug-info.cpp: It does not crash on mingw.
NAKAMURA Takumi [Mon, 2 May 2011 04:50:00 +0000 (04:50 +0000)]
test/CodeGenCXX/vtable-debug-info.cpp: It does not crash on mingw.

FIXME: It would crash with -integrated-as. Implement -g on MCCOFF.

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

13 years agotest/CodeGenCXX/debug-info-namespace.cpp: Add explicit -fverbose-asm to cc1 to let...
NAKAMURA Takumi [Mon, 2 May 2011 04:49:53 +0000 (04:49 +0000)]
test/CodeGenCXX/debug-info-namespace.cpp: Add explicit -fverbose-asm to cc1 to let cygming pass.

This test seeks a verbose comment in output. By default, "-integrated-as" sets verbose-asm. Cygming is not ready for -integrated-as yet.

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