]> granicus.if.org Git - clang/log
clang
14 years agofix PR8380, a crash on invalid due to an illogical DeclSpec SourceRange being constru...
Chris Lattner [Tue, 9 Nov 2010 20:14:26 +0000 (20:14 +0000)]
fix PR8380, a crash on invalid due to an illogical DeclSpec SourceRange being constructed.

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

14 years agoRevert the fix for PR8013.
Douglas Gregor [Tue, 9 Nov 2010 20:03:54 +0000 (20:03 +0000)]
Revert the fix for PR8013.

That bug concerned the well-formedness of code such as (&ovl)(a, b,
c). GCC rejects the code, while EDG accepts it. On further study of the
standard, I see no support for EDG's position: in particular, C++
[over.over] does not list this as a context where we can take the
address of an overloaded function, C++ [over.call.func] does not
reference the address-of operator at any point, and C++ [expr.call]
claims that the function argument in a call is either a function
lvalue or a pointer-to-function; (&ovl) is neither.

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

14 years agoSimplify code.
Benjamin Kramer [Tue, 9 Nov 2010 20:00:56 +0000 (20:00 +0000)]
Simplify code.

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

14 years agomake the example a bit better, encouraging people to use "suggestions of what to...
Chris Lattner [Tue, 9 Nov 2010 19:43:35 +0000 (19:43 +0000)]
make the example a bit better, encouraging people to use "suggestions of what to use" in the message :)

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

14 years agoReplace "#if __clang__" by "#if __has_feature(attribute_analyzer_noreturn)" to be...
Ted Kremenek [Tue, 9 Nov 2010 18:54:17 +0000 (18:54 +0000)]
Replace "#if __clang__" by "#if __has_feature(attribute_analyzer_noreturn)" to be consistent with all other snippets on this page.

Patch by Jean-Daniel Dupas!

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

14 years agoUse the right calling convention when mangling names in the Microsoft C++
Charles Davis [Tue, 9 Nov 2010 18:04:24 +0000 (18:04 +0000)]
Use the right calling convention when mangling names in the Microsoft C++
mangler. Now member functions and pointers thereof have their calling
convention mangled as __thiscall if they have the default CC (even though,
they technically still have the __cdecl CC).

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

14 years agoAdd support for soft/hard float options to the Sparc target
Bruno Cardoso Lopes [Tue, 9 Nov 2010 17:21:19 +0000 (17:21 +0000)]
Add support for soft/hard float options to the Sparc target

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

14 years agoInclude System/DataTypes.h in Diagnostic.h to get intptr_t.
Rafael Espindola [Tue, 9 Nov 2010 16:41:02 +0000 (16:41 +0000)]
Include System/DataTypes.h in Diagnostic.h to get intptr_t.
Set Haiku's UserLabelPrefix to "".
Patch by Paul Davey.

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

14 years agoHandle overload resolution when calling an overloaded function set
Douglas Gregor [Tue, 9 Nov 2010 16:13:15 +0000 (16:13 +0000)]
Handle overload resolution when calling an overloaded function set
with, e.g., (&f)(a, b, c). Fixes PR8013.

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

14 years agoMake #pragma unused work for static local variables.
Douglas Gregor [Tue, 9 Nov 2010 14:57:47 +0000 (14:57 +0000)]
Make #pragma unused work for static local variables.

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

14 years agoRemove the use of aliases in outputted code from ObjC (GNU runtime).
David Chisnall [Tue, 9 Nov 2010 11:21:43 +0000 (11:21 +0000)]
Remove the use of aliases in outputted code from ObjC (GNU runtime).

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

14 years agoRemove debugging printf.
Nick Lewycky [Tue, 9 Nov 2010 09:53:02 +0000 (09:53 +0000)]
Remove debugging printf.
Fix linux build.

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

14 years agolib/Lex/PPMacroExpansion.cpp: Fixup to appease MSVC.
NAKAMURA Takumi [Tue, 9 Nov 2010 06:27:32 +0000 (06:27 +0000)]
lib/Lex/PPMacroExpansion.cpp: Fixup to appease MSVC.

Confirmed on MSVS10.

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

14 years agontroduce clang_getSpellingLocation() into libclang, to provide the
Douglas Gregor [Tue, 9 Nov 2010 06:24:54 +0000 (06:24 +0000)]
ntroduce clang_getSpellingLocation() into libclang, to provide the
location where we're spelling a token even within a
macro. clang_getInstantiationLocation() tells where we instantiated
the macro.

I'm still not thrilled with the CXSourceLocation/CXSourceRange APIs,
since they gloss over macro-instantiation information.

Take 2: this time, adjusted tests appropriately and used a "simple"
approach to the spelling location.

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

14 years agoRevert r118492, which didn't update all of its tests accordingly
Douglas Gregor [Tue, 9 Nov 2010 05:52:02 +0000 (05:52 +0000)]
Revert r118492, which didn't update all of its tests accordingly

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

14 years agoAppeasing MSVC, take 3
Douglas Gregor [Tue, 9 Nov 2010 05:43:53 +0000 (05:43 +0000)]
Appeasing MSVC, take 3

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

14 years agoIntroduce clang_getSpellingLocation() into libclang, to provide the
Douglas Gregor [Tue, 9 Nov 2010 05:28:47 +0000 (05:28 +0000)]
Introduce clang_getSpellingLocation() into libclang, to provide the
location where we're spelling a token even within a
macro. clang_getInstantiationLocation() tells where we instantiated
the macro.

I'm still not thrilled with the CXSourceLocation/CXSourceRange APIs,
since they gloss over macro-instantiation information.

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

14 years agoIntroduce the concept of a non-virtual base type to CGRecordLayoutBuilder as a first...
Anders Carlsson [Tue, 9 Nov 2010 05:25:47 +0000 (05:25 +0000)]
Introduce the concept of a non-virtual base type to CGRecordLayoutBuilder as a first step towards fixing PR6995.

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

14 years agoTry to appease MSVC
Douglas Gregor [Tue, 9 Nov 2010 04:38:09 +0000 (04:38 +0000)]
Try to appease MSVC

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

14 years agoAdd missing include
Douglas Gregor [Tue, 9 Nov 2010 04:06:42 +0000 (04:06 +0000)]
Add missing include

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

14 years agoTeach code completion not to include out-of-line declarations and
Douglas Gregor [Tue, 9 Nov 2010 03:59:40 +0000 (03:59 +0000)]
Teach code completion not to include out-of-line declarations and
definitions in its results. The original declarations will be visible
wherever they are declared.

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

14 years agoFix the test for Release.
Argyrios Kyrtzidis [Tue, 9 Nov 2010 03:43:49 +0000 (03:43 +0000)]
Fix the test for Release.

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

14 years agoAdd __nullptr as a C++0x nullptr literal, available in C++98
Douglas Gregor [Tue, 9 Nov 2010 03:43:04 +0000 (03:43 +0000)]
Add __nullptr as a C++0x nullptr literal, available in C++98

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

14 years agoFix source locations in unnamed bitfield diagnostic, from Jakub
Douglas Gregor [Tue, 9 Nov 2010 03:31:16 +0000 (03:31 +0000)]
Fix source locations in unnamed bitfield diagnostic, from Jakub
Wieczorek! Fixes PR8025.

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

14 years agolibclang and c-index-test can be built on Cygming.
NAKAMURA Takumi [Tue, 9 Nov 2010 03:25:21 +0000 (03:25 +0000)]
libclang and c-index-test can be built on Cygming.

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

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