]> granicus.if.org Git - clang/log
clang
14 years agoModify CursorVisitor to also walks CXXOperatorCallExprs using data-recursion. Fixes...
Ted Kremenek [Thu, 11 Nov 2010 23:11:43 +0000 (23:11 +0000)]
Modify CursorVisitor to also walks CXXOperatorCallExprs using data-recursion.  Fixes <rdar://problem/8659019>.

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

14 years agoRegionStore/BasicStore: do not return UndefinedVal for accesses to concrete addresses...
Ted Kremenek [Thu, 11 Nov 2010 23:10:10 +0000 (23:10 +0000)]
RegionStore/BasicStore: do not return UndefinedVal for accesses to concrete addresses; instead return UnknownVal.  This
leads it up to checkers (e.g., DereferenceChecker) to guard against illegal accesses (e.g., null dereferences).

Fixes PR 5272 and <rdar://problem/6839683>.

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

14 years agoTeach debug-info generation that SourceManager::getPresumedLoc() can
Douglas Gregor [Thu, 11 Nov 2010 20:45:16 +0000 (20:45 +0000)]
Teach debug-info generation that SourceManager::getPresumedLoc() can
produce an invalid location even when given a valid location, if the
file system has changed underneath us. Recovery more gracefully.

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

14 years agoAdd support for -s, -pthread and -pthreads. Thanks to Hans Wennborg and
Rafael Espindola [Thu, 11 Nov 2010 19:34:42 +0000 (19:34 +0000)]
Add support for -s, -pthread and -pthreads. Thanks to Hans Wennborg and
Cosmin Truta for reporting it.

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

14 years agoDriver: Allow build system override of default non-fragile ABI version.
Daniel Dunbar [Thu, 11 Nov 2010 16:08:59 +0000 (16:08 +0000)]
Driver: Allow build system override of default non-fragile ABI version.

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

14 years agoTemporarily remove this test. It is causing an assertion failure in the builtbot.
Ted Kremenek [Thu, 11 Nov 2010 08:17:57 +0000 (08:17 +0000)]
Temporarily remove this test.  It is causing an assertion failure in the builtbot.

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

14 years agoAnnotate tokens in a separate thread to avoid blowing out stack space. While the...
Ted Kremenek [Thu, 11 Nov 2010 08:05:23 +0000 (08:05 +0000)]
Annotate tokens in a separate thread to avoid blowing out stack space.  While the CursorVisitor
is gradually becoming more data recursive, AnnotateTokensVisitor does its own recursive call
within the visitor that can still blow out the stack.  This can potentially be reworked to avoid this,
but for now just do token annotation on a separate thread.

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

14 years agoGeneralize data-recursive visitation in CursorVisitor to also handle MemberExprs
Ted Kremenek [Thu, 11 Nov 2010 08:05:18 +0000 (08:05 +0000)]
Generalize data-recursive visitation in CursorVisitor to also handle MemberExprs
and CXXCallMemberExprs.  This scheme is hopefully general enough to extend to the
rest of the visitor if necessary.

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

14 years agoUndo a refactor-o and base the bitfield-truncation warning on the
John McCall [Thu, 11 Nov 2010 05:33:51 +0000 (05:33 +0000)]
Undo a refactor-o and base the bitfield-truncation warning on the
uncoerced value.  Also, whitelist bool bitfields, which aren't
really a truncation.

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

14 years agotest/CMakeLists.txt: Use ${LLVM_LIT_ARGS} and remove redundant arguments "-sv" and...
NAKAMURA Takumi [Thu, 11 Nov 2010 04:09:51 +0000 (04:09 +0000)]
test/CMakeLists.txt: Use ${LLVM_LIT_ARGS} and remove redundant arguments "-sv" and "--no-progress-bar".

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

14 years agoRemove some unnecessary reinterpret_cast.
Francois Pichet [Thu, 11 Nov 2010 03:49:37 +0000 (03:49 +0000)]
Remove some unnecessary reinterpret_cast.

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

14 years agoExtend the bitfield-truncation warning to initializations.
John McCall [Thu, 11 Nov 2010 03:21:53 +0000 (03:21 +0000)]
Extend the bitfield-truncation warning to initializations.
rdar://problem/8652606

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

14 years agoAdd -rdynamic to freebsd and openbsd. Patch by Ruben.
Rafael Espindola [Thu, 11 Nov 2010 02:17:51 +0000 (02:17 +0000)]
Add -rdynamic to freebsd and openbsd. Patch by Ruben.

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

14 years agoAdd support for Exherbo. Patch by Elias Pipping.
Rafael Espindola [Thu, 11 Nov 2010 02:07:13 +0000 (02:07 +0000)]
Add support for Exherbo. Patch by Elias Pipping.

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

14 years agoUnnest; no functionality change.
John McCall [Thu, 11 Nov 2010 00:46:36 +0000 (00:46 +0000)]
Unnest;  no functionality change.

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

14 years agoImprove ASTUnit's capture of diagnostics so that the
Douglas Gregor [Thu, 11 Nov 2010 00:39:14 +0000 (00:39 +0000)]
Improve ASTUnit's capture of diagnostics so that the
diagnostic-capturing client lives as long as the ASTUnit itself
does. Otherwise, we can end up with crashes when we get a diagnostic
outside of parsing/code completion. The circumstances under which this
happen are really hard to reproduce, because a file needs to change
from under us.

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

14 years agoAdding couple of Block API, a bug fix and
Fariborz Jahanian [Thu, 11 Nov 2010 00:11:38 +0000 (00:11 +0000)]
Adding couple of Block API, a bug fix and
a test change, all for blocks. wip.

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

14 years agoadd a note about inline asm compatibility.
Chris Lattner [Wed, 10 Nov 2010 23:51:50 +0000 (23:51 +0000)]
add a note about inline asm compatibility.

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

14 years agoWhen -Wconversion computes the range of a type, it uses the (bit-)range
John McCall [Wed, 10 Nov 2010 23:38:19 +0000 (23:38 +0000)]
When -Wconversion computes the range of a type, it uses the (bit-)range
of the enumerators rather than the actual expressible range.  This is
great when dealing with opaque *values* of that type, but when computing
the range of the type for purposes of converting *into* it, it produces
warnings in cases we don't care about (e.g. enum_t x = 500;).  Divide
the logic into these two cases and use the more conservative range for
targets.

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

14 years agotest case for r118726.
Devang Patel [Wed, 10 Nov 2010 22:19:57 +0000 (22:19 +0000)]
test case for r118726.

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

14 years agoAdd a variant of GCC-style vector types for ARM NEON.
Bob Wilson [Wed, 10 Nov 2010 21:56:12 +0000 (21:56 +0000)]
Add a variant of GCC-style vector types for ARM NEON.
NEON vector types need to be mangled in a special way to comply with ARM's ABI,
similar to some of the AltiVec-specific vector types.  This patch is mostly
just renaming a bunch of "AltiVecSpecific" things, since they will no longer
be specific to AltiVec.  Besides that, it just adds the new "NeonVector" enum.

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

14 years agoDocument a language-compatibility issue with function parameter names in function...
Douglas Gregor [Wed, 10 Nov 2010 20:24:21 +0000 (20:24 +0000)]
Document a language-compatibility issue with function parameter names in function prototypes in C++

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

14 years agoInstantiate class member template partial specialization declarations
Douglas Gregor [Wed, 10 Nov 2010 19:44:59 +0000 (19:44 +0000)]
Instantiate class member template partial specialization declarations
in the order they occur within the class template, delaying
out-of-line member template partial specializations until after the
class has been fully instantiated. This fixes a regression introduced
by r118454 (itself a fix for PR8001).

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

14 years agoCheck for duplicate declaration of a property in current and
Fariborz Jahanian [Wed, 10 Nov 2010 18:01:36 +0000 (18:01 +0000)]
Check for duplicate declaration of a property in current and
other class extensions. // rdar://7629420

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

14 years agoPropagate the deprecated and unavailable attributes from a
John McCall [Wed, 10 Nov 2010 07:01:40 +0000 (07:01 +0000)]
Propagate the deprecated and unavailable attributes from a
@property declaration to the autogenerated methods.  I'm uncertain
whether this should apply to attributes in general, but these are
a reasonable core.

Implements rdar://problem/8617301

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

14 years agoRegion-allocate all AttributeList objects from a factory object instead of manually...
Ted Kremenek [Wed, 10 Nov 2010 05:59:39 +0000 (05:59 +0000)]
Region-allocate all AttributeList objects from a factory object instead of manually managing them
using new/delete and OwningPtrs.  After memory profiling Clang, I witnessed periodic leaks of these
objects; digging deeper into the code, it was clear that our management of these objects was a mess.  The ownership rules were murky at best, and not always followed.  Worse, there are plenty of error paths where we could screw up.

This patch introduces AttributeList::Factory, which is a factory class that creates AttributeList
objects and then blows them away all at once.  While conceptually simple, most of the changes in
this patch just have to do with migrating over to the new interface.  Most of the changes have resulted in some nice simplifications.

This new strategy currently holds on to all AttributeList objects during the lifetime of the Parser
object.  This is easily tunable.  If we desire to have more bound the lifetime of AttributeList
objects more precisely, we can have the AttributeList::Factory object (in Parser) push/pop its
underlying allocator as we enter/leave key methods in the Parser.  This means that we get
simple memory management while still having the ability to finely control memory use if necessary.

Note that because AttributeList objects are now BumpPtrAllocated, we may reduce malloc() traffic
in many large files with attributes.

This fixes the leak reported in: <rdar://problem/8650003>

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

14 years agoReplace UsingDecl's SmallPtrSet of UsingShadowDecls with a linked list to avoid leaki...
Argyrios Kyrtzidis [Wed, 10 Nov 2010 05:40:41 +0000 (05:40 +0000)]
Replace UsingDecl's SmallPtrSet of UsingShadowDecls with a linked list to avoid leaking memory.
Fixes rdar://8649963.

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

14 years agoAdd support for Ubuntu Jaunty.
Rafael Espindola [Wed, 10 Nov 2010 05:00:22 +0000 (05:00 +0000)]
Add support for Ubuntu Jaunty.

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

14 years agoFriend function declarations can overload with tag declarations.
John McCall [Wed, 10 Nov 2010 03:01:53 +0000 (03:01 +0000)]
Friend function declarations can overload with tag declarations.
Fixes PR7915.

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

14 years agoDiagnose attempst to template using declarations and using directives.
John McCall [Wed, 10 Nov 2010 02:40:36 +0000 (02:40 +0000)]
Diagnose attempst to template using declarations and using directives.
Recover from the latter and fail early for the former.  Fixes PR8022.

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

14 years agomake sure #pragma clang is treated the same way as #pragma gcc in -E mode,
Chris Lattner [Wed, 10 Nov 2010 01:00:49 +0000 (01:00 +0000)]
make sure #pragma clang is treated the same way as #pragma gcc in -E mode,
unknown pragmas should just be passed through to the .i file.

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

14 years agoTweak to bitfield-overflow warning: don't warn about storing
John McCall [Wed, 10 Nov 2010 00:26:50 +0000 (00:26 +0000)]
Tweak to bitfield-overflow warning:  don't warn about storing
a positive value into a signed bitfield of the exact width of
the value.

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

14 years agoTypo.
John McCall [Tue, 9 Nov 2010 23:36:43 +0000 (23:36 +0000)]
Typo.

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

14 years agoAdd a warning for implicit truncation of constant values due to
John McCall [Tue, 9 Nov 2010 23:24:47 +0000 (23:24 +0000)]
Add a warning for implicit truncation of constant values due to
bitfield assignment.

Implements rdar://problem/7809123

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

14 years agoAdd a compat note about how Clang doesn't zero-initialize __block local variables.
Daniel Dunbar [Tue, 9 Nov 2010 22:45:16 +0000 (22:45 +0000)]
Add a compat note about how Clang doesn't zero-initialize __block local variables.

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

14 years agoSplit out -Wconversion warnings about constant precision into their
John McCall [Tue, 9 Nov 2010 22:22:12 +0000 (22:22 +0000)]
Split out -Wconversion warnings about constant precision into their
own subcategory, -Wconstant-conversion, which is on by default.

Tweak the constant folder to give better results in the invalid
case of a negative shift amount.

Implements rdar://problem/6792488

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

14 years agoTest moved to its correct place.
Fariborz Jahanian [Tue, 9 Nov 2010 21:40:30 +0000 (21:40 +0000)]
Test moved to its correct place.

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

14 years agoRestore patch reversed in r118475. Fixes
Fariborz Jahanian [Tue, 9 Nov 2010 21:38:20 +0000 (21:38 +0000)]
Restore patch reversed in r118475. Fixes
// rdar://8632525

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

14 years agoAttempt to resolve overloaded functions in comma expressions and
Douglas Gregor [Tue, 9 Nov 2010 21:07:58 +0000 (21:07 +0000)]
Attempt to resolve overloaded functions in comma expressions and
conditional operators. Fixes PR7863.

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

14 years agoIssues good diagnostic when @end is missing.
Fariborz Jahanian [Tue, 9 Nov 2010 20:38:00 +0000 (20:38 +0000)]
Issues good diagnostic when @end is missing.
// rdar://8283484

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

14 years agotidy up
Chris Lattner [Tue, 9 Nov 2010 20:15:55 +0000 (20:15 +0000)]
tidy up

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

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