]> granicus.if.org Git - clang/log
clang
14 years agoc-index-test: Be available on Cygwin by using Win32's logic.
NAKAMURA Takumi [Tue, 9 Nov 2010 03:25:16 +0000 (03:25 +0000)]
c-index-test: Be available on Cygwin by using Win32's logic.

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

14 years agosprintf -> snprintf conversion, from Vladimir Kirillov
Douglas Gregor [Tue, 9 Nov 2010 03:20:07 +0000 (03:20 +0000)]
sprintf -> snprintf conversion, from Vladimir Kirillov

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

14 years agoRemove this test for now.
Fariborz Jahanian [Tue, 9 Nov 2010 02:24:38 +0000 (02:24 +0000)]
Remove this test for now.

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

14 years agoReverse patch for // rdar://8632525. It might
Fariborz Jahanian [Tue, 9 Nov 2010 02:24:08 +0000 (02:24 +0000)]
Reverse patch for // rdar://8632525. It might
has broken a build.

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

14 years agoRemove space from rdar URIs.
Fariborz Jahanian [Tue, 9 Nov 2010 02:16:57 +0000 (02:16 +0000)]
Remove space from rdar URIs.

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

14 years agoTeach AttrNonNullChecker about transparent unions. Fixes crash reported in <rdar...
Ted Kremenek [Tue, 9 Nov 2010 02:11:43 +0000 (02:11 +0000)]
Teach AttrNonNullChecker about transparent unions.  Fixes crash reported in <rdar://problem/8642434>.

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

14 years agoFix InitListExpr::getSourceRange() to work in the case of no locations for '(' and...
Ted Kremenek [Tue, 9 Nov 2010 02:11:40 +0000 (02:11 +0000)]
Fix InitListExpr::getSourceRange() to work in the case of no locations for '(' and ')'.  This can happen
in the case of transparent unions.

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

14 years agoFix miscompilation regarding VLAs; subscription of VLA pointers was incorrect.
Argyrios Kyrtzidis [Tue, 9 Nov 2010 01:30:48 +0000 (01:30 +0000)]
Fix miscompilation regarding VLAs; subscription of VLA pointers was incorrect.
Fixes rdar://8644873 & http://llvm.org/PR8567.

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

14 years agoWhen re-using a vtable slot for the nearest overridden method, just because
John McCall [Tue, 9 Nov 2010 01:18:05 +0000 (01:18 +0000)]
When re-using a vtable slot for the nearest overridden method, just because
there's no return adjustment from the overridden to the overrider doesn't
mean there isn't a return adjustment from the overrider to the final
overrider.  This matters if we're emitting a virtual this-adjustment thunk
because the overrider virtually inherits from the class providing the
nearest overridden method.  Do the appropriate return adjustment in this case.

Fixes PR7611.

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

14 years agoFix warning about unused variable 'Fn' in no-asserts builds. Also reflow this
Nick Lewycky [Tue, 9 Nov 2010 00:19:31 +0000 (00:19 +0000)]
Fix warning about unused variable 'Fn' in no-asserts builds. Also reflow this
block so that it looks more like the rest of the file. No functional change.

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

14 years agoDon't lose track of previous-declarations when instantiating a class template.
Nick Lewycky [Mon, 8 Nov 2010 23:29:42 +0000 (23:29 +0000)]
Don't lose track of previous-declarations when instantiating a class template.
Fixes PR8001.

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

14 years agoProvide a precise builtin declaration for objc_msgSend
Fariborz Jahanian [Mon, 8 Nov 2010 22:53:18 +0000 (22:53 +0000)]
Provide a precise builtin declaration for objc_msgSend
to avoid a bogus warning. Fixes //rdar: //8632525

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

14 years ago1) Fix a typo in PPCallbacks: It's elif, not elfif. :-) This is
Craig Silverstein [Mon, 8 Nov 2010 21:43:51 +0000 (21:43 +0000)]
1) Fix a typo in PPCallbacks: It's elif, not elfif. :-)  This is
contentful, since the typo was in the method-name...

2) Clarify some comments in RecursiveASTVisitor.

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

14 years agoAdd CursorVisitor::VisitBinaryOperator() to explicitly handle the case where we can...
Ted Kremenek [Mon, 8 Nov 2010 21:14:15 +0000 (21:14 +0000)]
Add CursorVisitor::VisitBinaryOperator() to explicitly handle the case where we can blow out the stack due
to deeply nested BinaryOperators.  This is done by turning the explicit recursion into being data recursive.

Fixes: <rdar://problem/8289205>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118444 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIf an instance method messages is sending to an expression of type Class,
Douglas Gregor [Mon, 8 Nov 2010 21:12:30 +0000 (21:12 +0000)]
If an instance method messages is sending to an expression of type Class,
and we statically can compute a bound on the actual type (e.g.,
because it's a send to the the magic "class" instance method), code
complete as if we were performing a class message send to that class.

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

14 years agoDocument Clang's support for attributes on individual enumerators and
John McCall [Mon, 8 Nov 2010 19:48:17 +0000 (19:48 +0000)]
Document Clang's support for attributes on individual enumerators and
tweak the documentation for deprecation-with-message.  Provide __has_feature
tests for both.  rdar://problem/8605692

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

14 years agoAdd a forgotten break. Found by Rafael Espindola!
Roman Divacky [Mon, 8 Nov 2010 19:39:10 +0000 (19:39 +0000)]
Add a forgotten break. Found by Rafael Espindola!

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

14 years agoWhen building a compound literal, check that the base element of the array is complete.
Argyrios Kyrtzidis [Mon, 8 Nov 2010 19:14:19 +0000 (19:14 +0000)]
When building a compound literal, check that the base element of the array is complete.
Fixes rdar://8620582 & http://llvm.org/PR7905

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

14 years agoFixes a rewrite bug, rewriting nested property usage
Fariborz Jahanian [Mon, 8 Nov 2010 18:37:50 +0000 (18:37 +0000)]
Fixes a rewrite bug, rewriting nested property usage
inside blocks. Fixes //rdar: //8608293.

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

14 years agoUse integrated-as for processing .s files on FreeBSD. Copied
Roman Divacky [Mon, 8 Nov 2010 17:46:39 +0000 (17:46 +0000)]
Use integrated-as for processing .s files on FreeBSD. Copied
from Linux/OpenBSD code.

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

14 years agoImprove our handling of C++ [class.copy]p3, which specifies that a
Douglas Gregor [Mon, 8 Nov 2010 17:16:59 +0000 (17:16 +0000)]
Improve our handling of C++ [class.copy]p3, which specifies that a
constructor template will not be used to copy a class object to a
value of its own type. We were eliminating all constructor templates
whose specializations look like a copy constructor, which eliminated
important candidates. Fixes PR8182.

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

14 years agoOnly enable the ObjCAtSyncChecker when the translation unit uses Objective-C.
Ted Kremenek [Mon, 8 Nov 2010 16:52:54 +0000 (16:52 +0000)]
Only enable the ObjCAtSyncChecker when the translation unit uses Objective-C.

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

14 years agoWhen attempting reference binding to an overloaded function, also
Douglas Gregor [Mon, 8 Nov 2010 15:20:28 +0000 (15:20 +0000)]
When attempting reference binding to an overloaded function, also
consider that we might be trying to bind a reference to a class type,
which involves a constructor call. Fixes PR7425.

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

14 years agoPass "-z relro" as two arguments. This works with both gnu ld and gold.
Rafael Espindola [Mon, 8 Nov 2010 14:48:47 +0000 (14:48 +0000)]
Pass "-z relro" as two arguments. This works with both gnu ld and gold.
Patch by Frits van Bommel.

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

14 years agoClean up some of the comments in Index.h (e.g., misnamed or extra parameters in comme...
Ted Kremenek [Mon, 8 Nov 2010 04:28:51 +0000 (04:28 +0000)]
Clean up some of the comments in Index.h (e.g., misnamed or extra parameters in comments).

Patch by Chris Pick!

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

14 years agoAdd missing test case for PR8230
Douglas Gregor [Mon, 8 Nov 2010 03:58:01 +0000 (03:58 +0000)]
Add missing test case for PR8230

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

14 years agoProperly diagnose invalid casts to function references. Patch by
Douglas Gregor [Mon, 8 Nov 2010 03:40:48 +0000 (03:40 +0000)]
Properly diagnose invalid casts to function references. Patch by
Faisal Vali, tweaked by me. Fixes PR8230.

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

14 years agotest/CodeGenCXX/rtti-linkage.cpp: Get rid of sort(1) to remove XFAIL: win32.
NAKAMURA Takumi [Mon, 8 Nov 2010 01:05:10 +0000 (01:05 +0000)]
test/CodeGenCXX/rtti-linkage.cpp: Get rid of sort(1) to remove XFAIL: win32.

On the certain system, bogus SORT.EXE is picked up. Its sort-order is incompatible to POSIX.

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

14 years agoUse the integrated assembler when procession .s files on OpenBSD and Linux.
Rafael Espindola [Sun, 7 Nov 2010 23:13:01 +0000 (23:13 +0000)]
Use the integrated assembler when procession .s files on OpenBSD and Linux.
Original patch for OpenBSD by Vladimir Kirillov.

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

14 years agoRemove broken support for variadic templates, along with the various
Douglas Gregor [Sun, 7 Nov 2010 23:05:16 +0000 (23:05 +0000)]
Remove broken support for variadic templates, along with the various
abstractions (e.g., TemplateArgumentListBuilder) that were designed to
support variadic templates. Only a few remnants of variadic templates
remain, in the parser (parsing template type parameter packs), AST
(template type parameter pack bits and TemplateArgument::Pack), and
Sema; these are expected to be used in a future implementation of
variadic templates.

But don't get too excited about that happening now.

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

14 years agoAdd support for -rdynamic.
Rafael Espindola [Sun, 7 Nov 2010 22:57:16 +0000 (22:57 +0000)]
Add support for -rdynamic.

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

14 years agoUse ld directly on linux. Changes from the previous try:
Rafael Espindola [Sun, 7 Nov 2010 20:14:31 +0000 (20:14 +0000)]
Use ld directly on linux. Changes from the previous try:
*) Try to detect as much as possible from the system itself, not the distro.
   This should make it easier to port to a new distro and more likely to
   work on a unknown one.
*) The distro enum now doesn't include the arch. Just use the existing
   host detection support in LLVM.
*) Correctly handle --sysroot.

A small regression is that now clang will pass bitcode file to the linker.
This is necessary for the gold plugin support to work.

It might be better to detect this at configure/cmake time, but doing it in
c++ first is a lot easier.

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

14 years agoA union cannot contain static data members or data members of reference type.
Anders Carlsson [Sun, 7 Nov 2010 19:13:55 +0000 (19:13 +0000)]
A union cannot contain static data members or data members of reference type.

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

14 years agoChange the StringSet used by CalculateHiddenNames() to use a BumpPtrAllocator.
Ted Kremenek [Sun, 7 Nov 2010 06:11:36 +0000 (06:11 +0000)]
Change the StringSet used by CalculateHiddenNames() to use a BumpPtrAllocator.

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

14 years agoFix memory leak of IdentifierIterator object.
Ted Kremenek [Sun, 7 Nov 2010 06:11:33 +0000 (06:11 +0000)]
Fix memory leak of IdentifierIterator object.

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

14 years agoARM EH uses a different personality function in C.
John McCall [Sun, 7 Nov 2010 02:35:25 +0000 (02:35 +0000)]
ARM EH uses a different personality function in C.

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

14 years agoAdd a comment.
Argyrios Kyrtzidis [Sat, 6 Nov 2010 18:09:55 +0000 (18:09 +0000)]
Add a comment.

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

14 years agoDon't warn when matching %p to nullptr.
Anders Carlsson [Sat, 6 Nov 2010 14:58:53 +0000 (14:58 +0000)]
Don't warn when matching %p to nullptr.

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

14 years agoSimplify the logic for emitting guard variables for template static
John McCall [Sat, 6 Nov 2010 09:44:32 +0000 (09:44 +0000)]
Simplify the logic for emitting guard variables for template static
data members by delaying the emission of the initializer until after
linkage and visibility have been set on the global.  Also, don't
emit a guard unless the variable actually ends up with vague linkage,
and don't use thread-safe statics in any case.

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

14 years agoFix a bug where we were recursing on friend decls for friend
Craig Silverstein [Sat, 6 Nov 2010 06:25:02 +0000 (06:25 +0000)]
Fix a bug where we were recursing on friend decls for friend
functions, but not for friend types.

Reviewed by wan

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

14 years agoAdd PPCallbacks for #if/#ifdef/etc.
Craig Silverstein [Sat, 6 Nov 2010 01:19:03 +0000 (01:19 +0000)]
Add PPCallbacks for #if/#ifdef/etc.

The callback info for #if/#elif is not great -- ideally it would give
us a list of tokens in the #if, or even better, a little parse tree.
But that's a lot more work.  Instead, clients can retokenize using
Lexer::LexFromRawLexer().

Reviewed by nlewycky.

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

14 years agoWhen determining which template partial specialization is more specialized,
Argyrios Kyrtzidis [Fri, 5 Nov 2010 23:25:18 +0000 (23:25 +0000)]
When determining which template partial specialization is more specialized,
make sure to setup the instantiation stack. Fixes rdar://8620775 & http://llvm.org/PR8234

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

14 years agoWhen searching for an instantiated declaration requires instantiation
Douglas Gregor [Fri, 5 Nov 2010 23:22:45 +0000 (23:22 +0000)]
When searching for an instantiated declaration requires instantiation
of its parent context, be sure to update the parent-context pointer
after instantiation. Fixes two anonymous-union instantiation issues in
<rdar://problem/8635664>.

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

14 years agoCheck for an invalid field earlier in a constructor's initialization
Douglas Gregor [Fri, 5 Nov 2010 22:21:31 +0000 (22:21 +0000)]
Check for an invalid field earlier in a constructor's initialization
of that field. Otherwise, we can end up building and later trying to
instantiate a dependent member initializer that will fail at
instantiation time.

Unfortunately, I've only managed to trigger this bug with very large
sources, so there's no test case :(

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

14 years agoDon't write an empty DIAG_USER_MAPPINGS record.
Argyrios Kyrtzidis [Fri, 5 Nov 2010 22:20:49 +0000 (22:20 +0000)]
Don't write an empty DIAG_USER_MAPPINGS record.

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

14 years agoRead/write from/to PCH the diagnostic mappings that the user set so that e.g. #pragma...
Argyrios Kyrtzidis [Fri, 5 Nov 2010 22:10:18 +0000 (22:10 +0000)]
Read/write from/to PCH the diagnostic mappings that the user set so that e.g. #pragma clang diagnostic can be used in a PCH.
Fixes rdar://8435969.

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

14 years agoInitialize the array with the "C++ way".
Argyrios Kyrtzidis [Fri, 5 Nov 2010 22:10:14 +0000 (22:10 +0000)]
Initialize the array with the "C++ way".

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

14 years agoTeach clang_getCursorReferenced() that a
Douglas Gregor [Fri, 5 Nov 2010 21:11:19 +0000 (21:11 +0000)]
Teach clang_getCursorReferenced() that a
CXXConstructorExpr/CXXTemporaryObjectExpr references the constructor
it calls. Then, tweak clang_getCursor() to prefer such a call over a
type reference to the type being called.

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

14 years agoPut class into an anonymous namespace.
Benjamin Kramer [Fri, 5 Nov 2010 19:56:37 +0000 (19:56 +0000)]
Put class into an anonymous namespace.

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

14 years agoProper rewriting of block envokation with
Fariborz Jahanian [Fri, 5 Nov 2010 18:34:46 +0000 (18:34 +0000)]
Proper rewriting of block envokation with
qualified ObjC pointer types in its argument list.
// rdar: //8608902

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

14 years agolibclang: Enable requesting a larger stack for several libclang entry points
Daniel Dunbar [Fri, 5 Nov 2010 17:21:46 +0000 (17:21 +0000)]
libclang: Enable requesting a larger stack for several libclang entry points
using "safety" threads.

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

14 years agoExpressions of type std::nullptr_t can be used as sentinels.
Anders Carlsson [Fri, 5 Nov 2010 15:21:33 +0000 (15:21 +0000)]
Expressions of type std::nullptr_t can be used as sentinels.

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

14 years agolibclang: Add some support for running certain entry points in a "safety"
Daniel Dunbar [Fri, 5 Nov 2010 07:19:31 +0000 (07:19 +0000)]
libclang: Add some support for running certain entry points in a "safety"
thread, primarily to get a larger stack.
 - Yes, I feel dirty.

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

14 years agoFix 80-col violas.
Daniel Dunbar [Fri, 5 Nov 2010 07:19:21 +0000 (07:19 +0000)]
Fix 80-col violas.

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

14 years agoImplement [over.ics.rank]p4: A conversion that does not convert an std::nullptr_t...
Anders Carlsson [Fri, 5 Nov 2010 00:12:09 +0000 (00:12 +0000)]
Implement [over.ics.rank]p4: A conversion that does not convert an std::nullptr_t to bool is better than one than does.

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

14 years agoAdjust return type of thread_runner.
Benjamin Kramer [Thu, 4 Nov 2010 19:11:31 +0000 (19:11 +0000)]
Adjust return type of thread_runner.

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

14 years agoUse the real keyword location when rebuilding an elaborated type instead of
John McCall [Thu, 4 Nov 2010 19:04:38 +0000 (19:04 +0000)]
Use the real keyword location when rebuilding an elaborated type instead of
making something up.  Fixes PR8129.

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

14 years agoPass a -I flag when compiling nullptr.cpp so the typeinfo header can be found. This...
Anders Carlsson [Thu, 4 Nov 2010 12:18:32 +0000 (12:18 +0000)]
Pass a -I flag when compiling nullptr.cpp so the typeinfo header can be found. This should fix the errors seen on the bot.

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

14 years agoDon't be so eager to replace UsingDecls in a DeclContext's lookup table;
Argyrios Kyrtzidis [Thu, 4 Nov 2010 08:48:52 +0000 (08:48 +0000)]
Don't be so eager to replace UsingDecls in a DeclContext's lookup table;
check that the TargetNestedNameDecl is the same first.

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

14 years agostd::nullptr_t is a fundamental type for RTTI purposes.
Anders Carlsson [Thu, 4 Nov 2010 05:28:09 +0000 (05:28 +0000)]
std::nullptr_t is a fundamental type for RTTI purposes.

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

14 years agoMangle std::nullptr_t as specified by the Itanium C++ ABI.
Anders Carlsson [Thu, 4 Nov 2010 04:31:32 +0000 (04:31 +0000)]
Mangle std::nullptr_t as specified by the Itanium C++ ABI.

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

14 years agoDon't instantiate members not belonging in the semantic context of the template.
Argyrios Kyrtzidis [Thu, 4 Nov 2010 03:18:57 +0000 (03:18 +0000)]
Don't instantiate members not belonging in the semantic context of the template.
e.g. for:

    template <int i> class A {
      class B *g;
    };

'class B' has the template as lexical context but semantically it is
introduced in namespace scope.

Fixes rdar://8611125 & http://llvm.org/PR8505

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

14 years agoIt's OK to use nullptr in relational operators if the other side is a null pointer...
Anders Carlsson [Thu, 4 Nov 2010 03:17:43 +0000 (03:17 +0000)]
It's OK to use nullptr in relational operators if the other side is a null pointer constant.

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

14 years agoc-index-test: Switch to using clang_executeOnThread instead of mucking about
Daniel Dunbar [Thu, 4 Nov 2010 01:26:31 +0000 (01:26 +0000)]
c-index-test: Switch to using clang_executeOnThread instead of mucking about
with system specific stuff.

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

14 years agolibclang: Add clang_executeOnThread, for use in c-index-test (and only there,
Daniel Dunbar [Thu, 4 Nov 2010 01:26:29 +0000 (01:26 +0000)]
libclang: Add clang_executeOnThread, for use in c-index-test (and only there,
preferably). Good thing c-index-test is written in C!!!!

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

14 years agoadd a comment to my last commit
Douglas Gregor [Thu, 4 Nov 2010 00:14:23 +0000 (00:14 +0000)]
add a comment to my last commit

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

14 years agoWhen canonicalizing nested-name-specifiers involving dependent names
Douglas Gregor [Thu, 4 Nov 2010 00:09:33 +0000 (00:09 +0000)]
When canonicalizing nested-name-specifiers involving dependent names
or dependent specializations, rip apart the dependent name/dependent
specialization to recanonicalize its pieces, because
nested-name-specifiers store "dependent-type::identifier" differently
than types do. Fixes PR7419.

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

14 years agoFixes a rewriting bug when type in a block argument type
Fariborz Jahanian [Wed, 3 Nov 2010 23:50:34 +0000 (23:50 +0000)]
Fixes a rewriting bug when type in a  block argument type
is a objc qualified class type. // rdar: //8608902

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

14 years agoPatch to rewrite objc qualified types which occur in
Fariborz Jahanian [Wed, 3 Nov 2010 23:29:24 +0000 (23:29 +0000)]
Patch to rewrite objc qualified types which occur in
block pointer type arguments. Partial fix for
// rdar: //8608902

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

14 years agoImplement -working-directory.
Argyrios Kyrtzidis [Wed, 3 Nov 2010 22:45:23 +0000 (22:45 +0000)]
Implement -working-directory.

When -working-directory is passed in command line, file paths are resolved relative to the specified directory.
This helps both when using libclang (where we can't require the user to actually change the working directory)
and to help reproduce test cases when the reproduction work comes along.

--FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains
 the working directory value if set).
--FileSystemOptions are passed around to various interfaces that perform file operations.
--Opening & reading the content of files should be done only through FileManager. This is useful in general since
 file operations will be abstracted in the future for the reproduction mechanism.

FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same
FileManager but with different FileSystemOptions.

Addresses rdar://8583824.

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

14 years agoFix an assertion.
Argyrios Kyrtzidis [Wed, 3 Nov 2010 22:45:13 +0000 (22:45 +0000)]
Fix an assertion.

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

14 years agoMake this error less specific but also less likely to cause confusion. Fixes
Nick Lewycky [Wed, 3 Nov 2010 17:52:57 +0000 (17:52 +0000)]
Make this error less specific but also less likely to cause confusion. Fixes
PR7702.

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

14 years agoWhen producing overload candidates for binary built-in operators, keep
Douglas Gregor [Wed, 3 Nov 2010 17:00:07 +0000 (17:00 +0000)]
When producing overload candidates for binary built-in operators, keep
the sets of available conversions for the first and second arguments
separate. This is apparently the indent of C++ [over.built], and
reduces the number of overload candidates generated, eliminating some
ambiguities. Fixes PR8477.

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

14 years agoSome fixes for synthesized ivar metadata (GNU runtime).
David Chisnall [Wed, 3 Nov 2010 16:12:44 +0000 (16:12 +0000)]
Some fixes for synthesized ivar metadata (GNU runtime).

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

14 years agoAdded cursor visitor that takes a block as an argument. Tested compiling
David Chisnall [Wed, 3 Nov 2010 14:12:26 +0000 (14:12 +0000)]
Added cursor visitor that takes a block as an argument.  Tested compiling
libclang with both clang -fblocks and gcc (no blocks support).  Only exposed in
the header to compilers that do have blocks support.

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

14 years agofix test case.
Zhongxing Xu [Wed, 3 Nov 2010 11:24:56 +0000 (11:24 +0000)]
fix test case.

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

14 years agoDo not add elidable CXXConstructExpr as block-level expr.
Zhongxing Xu [Wed, 3 Nov 2010 11:14:06 +0000 (11:14 +0000)]
Do not add elidable CXXConstructExpr as block-level expr.

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

14 years agoAdded generating destructors for temporary objects. Two cases I know of, that are...
Marcin Swiderski [Wed, 3 Nov 2010 06:19:35 +0000 (06:19 +0000)]
Added generating destructors for temporary objects. Two cases I know of, that are not handled properly:
1. For statement: const C& c = C(0) ?: C(1) destructors generated for condition will not differ from those generated for case without prolonged lifetime of temporary,
2. There will be no destructor for constant reference member bound to temporary at the exit from constructor.

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

14 years agoRevert while I debug test failures :-(
Rafael Espindola [Wed, 3 Nov 2010 04:43:56 +0000 (04:43 +0000)]
Revert while I debug test failures :-(

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

14 years agoSwitch clang to run ld directly on linux. I tested this on all the linux
Rafael Espindola [Wed, 3 Nov 2010 04:37:51 +0000 (04:37 +0000)]
Switch clang to run ld directly on linux. I tested this on all the linux
distros listed by running

gcc main.o -o main
g++ main.o -o main
gcc main.o -o main -static
g++ main.o -o main -static
gcc f.o -o f.so -shared
g++ f.o -o f.so -shared

and comparing the ld line with the one created by clang. I also added
-m32/m64 in distros that support it.

While I tested many distros, there will always be more. If you are hit by this
it should be somewhat easy to add your distro. If you are in a hurry, do
revert this, but please inform how to detect you distro and the ld command
lines produced by the above gcc invocations. Most distros have some patches
on gcc :-(

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

14 years agoWhen setting a tied check if it's already tied. If it's tied to another constraint...
Anders Carlsson [Wed, 3 Nov 2010 02:54:51 +0000 (02:54 +0000)]
When setting a tied check if it's already tied. If it's tied to another constraint it's invalid. Fixes PR3905.

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

14 years agoA number in an input constraint can't point to a read-write ('+') constraint. Fixes...
Anders Carlsson [Wed, 3 Nov 2010 02:22:29 +0000 (02:22 +0000)]
A number in an input constraint can't point to a read-write ('+') constraint. Fixes PR3904.

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

14 years agoProvide an error when a non-identifier name (such as an operator) is used as a
Sean Hunt [Wed, 3 Nov 2010 01:07:06 +0000 (01:07 +0000)]
Provide an error when a non-identifier name (such as an operator) is used as a
parameter name.

Fixes PR8012.

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

14 years agoImprove source-location information for CXXConstructExpr nodes, by
Douglas Gregor [Wed, 3 Nov 2010 00:35:38 +0000 (00:35 +0000)]
Improve source-location information for CXXConstructExpr nodes, by
ensuring that they cover all of their child nodes. There's still a
clang_getCursor()-related issue with CXXFunctionalCastExprs with
CXXConstructExprs as children (see FIXME in the test case); I'll look
at that separately.

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

14 years agoDon't add Decls with an invalid location to DeclsInContainer.
Ted Kremenek [Tue, 2 Nov 2010 23:17:51 +0000 (23:17 +0000)]
Don't add Decls with an invalid location to DeclsInContainer.

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

14 years agoHack to workaround deficiency in ObjC ASTs. Functions and variables may be declared
Ted Kremenek [Tue, 2 Nov 2010 23:10:24 +0000 (23:10 +0000)]
Hack to workaround deficiency in ObjC ASTs.  Functions and variables may be declared
within an @implementation, but we have no way to record that information in the AST.
This may cause CursorVisitor to miss these Decls when doing a AST walk.

Fixes <rdar://problem/8595462>.

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

14 years agoTests for inline asm constraints, generic and x86.
John Thompson [Tue, 2 Nov 2010 23:03:52 +0000 (23:03 +0000)]
Tests for inline asm constraints, generic and x86.

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

14 years agoAdd link to LLVM releases page.
Daniel Dunbar [Tue, 2 Nov 2010 22:34:04 +0000 (22:34 +0000)]
Add link to LLVM releases page.

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

14 years agoFixes an assertion violation when bind to temporary
Fariborz Jahanian [Tue, 2 Nov 2010 21:05:53 +0000 (21:05 +0000)]
Fixes an assertion violation when bind to temporary
expression is a dependent expression.
// rdar: // 8620524 and PR7851

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

14 years agoEnsure that static local variables in function templates inherit the
John McCall [Tue, 2 Nov 2010 21:04:24 +0000 (21:04 +0000)]
Ensure that static local variables in function templates inherit the
visibility of their function.

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

14 years agoTeach code completion to provide property results when the property
Douglas Gregor [Tue, 2 Nov 2010 20:36:02 +0000 (20:36 +0000)]
Teach code completion to provide property results when the property
can be used to automatically synthesize an ivar.

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

14 years agoDriver: Silently ignore -fasm-blocks for now instead of error'ing, this cause
Daniel Dunbar [Tue, 2 Nov 2010 19:42:04 +0000 (19:42 +0000)]
Driver: Silently ignore -fasm-blocks for now instead of error'ing, this cause
some unexpected fallout.

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

14 years agoAdd support for Fedora 14. Patch by Daniel Kozlowski.
Rafael Espindola [Tue, 2 Nov 2010 18:39:34 +0000 (18:39 +0000)]
Add support for Fedora 14. Patch by Daniel Kozlowski.

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

14 years agoUnbreak private_extern, which apparently we had zero tests for.
John McCall [Tue, 2 Nov 2010 18:38:13 +0000 (18:38 +0000)]
Unbreak private_extern, which apparently we had zero tests for.

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

14 years agoFix a crash mangling decayed val argument-typed function.
Fariborz Jahanian [Tue, 2 Nov 2010 16:54:00 +0000 (16:54 +0000)]
Fix a crash mangling decayed val argument-typed function.
// rdar: //8620510 and PR7666

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

14 years agoProperly handle temporaries that are created in a AsmStmt.
Argyrios Kyrtzidis [Tue, 2 Nov 2010 02:33:08 +0000 (02:33 +0000)]
Properly handle temporaries that are created in a AsmStmt.

Previously the temporaries would get destroyed before the asm call.

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

14 years agoIgnore attributes on classes when calculating visibility for members
John McCall [Tue, 2 Nov 2010 01:45:15 +0000 (01:45 +0000)]
Ignore attributes on classes when calculating visibility for members
with their own explicit visibility attributes.  Basically we only want to
apply a single visibility attribute from any particular ancestry.

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

14 years agoDiagnose a coherant message when @interface
Fariborz Jahanian [Tue, 2 Nov 2010 00:44:43 +0000 (00:44 +0000)]
Diagnose a coherant message when @interface
does not terminate with @end.
// rdar: //7824372

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

14 years agoTeach SourceManager::getPresumedLoc() how to fail gracefully if getLineNumber/getColu...
Douglas Gregor [Tue, 2 Nov 2010 00:39:22 +0000 (00:39 +0000)]
Teach SourceManager::getPresumedLoc() how to fail gracefully if getLineNumber/getColumnNumber fail

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

14 years agoWhen performing template argument deduction against a template-id,
Douglas Gregor [Tue, 2 Nov 2010 00:02:34 +0000 (00:02 +0000)]
When performing template argument deduction against a template-id,
only keep deduction results for successful deductions, so that they
can be compared against each other. Fixes PR8462, from Richard Smith!

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