]> granicus.if.org Git - clang/log
clang
13 years agoDefine the _MIPS_SIM builtin macro on MIPS platforms. Patch by Robert Millan!
Bruno Cardoso Lopes [Thu, 21 Jul 2011 15:10:57 +0000 (15:10 +0000)]
Define the _MIPS_SIM builtin macro on MIPS platforms. Patch by Robert Millan!

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

13 years agoConvert ConstantExpr::getGetElementPtr and
Jay Foad [Thu, 21 Jul 2011 14:31:17 +0000 (14:31 +0000)]
Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.

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

13 years agoFor some reason I don't fully comprehend, the MSVC debug build will fail with a huge...
Francois Pichet [Thu, 21 Jul 2011 06:26:00 +0000 (06:26 +0000)]
For some reason I don't fully comprehend, the MSVC debug build will fail with a huge 50+ lines template error message if PreprocessingRecord::iterator has no operator<()

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

13 years agoSpeculatively revert 135649 to bring back the g++ testing bots.
Eric Christopher [Thu, 21 Jul 2011 05:34:24 +0000 (05:34 +0000)]
Speculatively revert 135649 to bring back the g++ testing bots.

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

13 years agoMove AnalysisManager constructor out of line. No functionality change (yet).
Ted Kremenek [Thu, 21 Jul 2011 05:22:52 +0000 (05:22 +0000)]
Move AnalysisManager constructor out of line.  No functionality change (yet).

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

13 years agoSimplify passing of CFGBuildOptions around for AnalysisContext. No functionality...
Ted Kremenek [Thu, 21 Jul 2011 05:22:47 +0000 (05:22 +0000)]
Simplify passing of CFGBuildOptions around for AnalysisContext.  No functionality change.

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

13 years agoFix a test in warn-sign-conversion.cpp. Removed a part of a directory path so that...
Richard Trieu [Thu, 21 Jul 2011 03:20:52 +0000 (03:20 +0000)]
Fix a test in warn-sign-conversion.cpp.  Removed a part of a directory path so that the directory seperator, which may change on different platforms, is no longer part of the string checked for.

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

13 years agoRemove warning for conditional operands of differend signedness from -Wsign-compare...
Richard Trieu [Thu, 21 Jul 2011 02:46:28 +0000 (02:46 +0000)]
Remove warning for conditional operands of differend signedness from -Wsign-compare.  Cases that previously warn on this will have a different warning emitted from -Wsign-conversion.

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

13 years agoNew libclang API to expose container type for code completion, from
Douglas Gregor [Thu, 21 Jul 2011 01:05:26 +0000 (01:05 +0000)]
New libclang API to expose container type for code completion, from
Connor Wakamo!

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

13 years agoWhen copping out on a friend template declaration, be sure to mark its
Sean Hunt [Thu, 21 Jul 2011 00:59:23 +0000 (00:59 +0000)]
When copping out on a friend template declaration, be sure to mark its
access specifier as public.

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

13 years agoRework the detailed preprocessing record to separate preprocessing
Douglas Gregor [Thu, 21 Jul 2011 00:47:40 +0000 (00:47 +0000)]
Rework the detailed preprocessing record to separate preprocessing
entities generated directly by the preprocessor from those loaded from
the external source (e.g., the ASTReader). By separating these two
sets of entities into different vectors, we allow both to grow
independently, and eliminate the need for preallocating all of the
loaded preprocessing entities. This is similar to the way the recent
SourceManager refactoring treats FileIDs and the source location
address space.

As part of this, switch over to building a continuous range map to
track preprocessing entities.

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

13 years agoAddressing code review comments for commit 135509 - Add FixItHints in case a C++...
Anna Zaks [Thu, 21 Jul 2011 00:34:39 +0000 (00:34 +0000)]
Addressing code review comments for commit 135509 - Add FixItHints in case a C++ function call is missing * or & operators on

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

13 years agoRemoves a comment.
Fariborz Jahanian [Wed, 20 Jul 2011 23:53:57 +0000 (23:53 +0000)]
Removes a comment.

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

13 years agoobjc-arc: Fixes a crash @throw'ing an objc message.
Fariborz Jahanian [Wed, 20 Jul 2011 23:39:56 +0000 (23:39 +0000)]
objc-arc: Fixes a crash @throw'ing an objc message.
// pr10411

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

13 years agoContinuing to improve and generalize how IDs are handled in ASTReader. This patch...
Jonathan D. Turner [Wed, 20 Jul 2011 21:31:32 +0000 (21:31 +0000)]
Continuing to improve and generalize how IDs are handled in ASTReader.  This patch cleans up and generalizes TypeID loading and uses a similar table-lookup to Doug's previous Decl patch.

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

13 years agoTemporarily revert r135614 while I fix the cmake build.
Chad Rosier [Wed, 20 Jul 2011 21:16:17 +0000 (21:16 +0000)]
Temporarily revert r135614 while I fix the cmake build.

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

13 years agoRemove extraneous period.
Bill Wendling [Wed, 20 Jul 2011 21:02:28 +0000 (21:02 +0000)]
Remove extraneous period.

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

13 years agoWhen the compiler crashes, the compiler driver now produces diagnostic information
Chad Rosier [Wed, 20 Jul 2011 20:26:32 +0000 (20:26 +0000)]
When the compiler crashes, the compiler driver now produces diagnostic information
including the fully preprocessed source file(s) and command line arguments.  The
developer is asked to attach this diagnostic information to a bug report.

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

13 years agoMatch MCContext change.
Evan Cheng [Wed, 20 Jul 2011 19:53:19 +0000 (19:53 +0000)]
Match MCContext change.

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

13 years agoFix -Wuninitialized regression involving functions invalidating parameters passed...
Ted Kremenek [Wed, 20 Jul 2011 19:49:47 +0000 (19:49 +0000)]
Fix -Wuninitialized regression involving functions invalidating parameters passed by reference.

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

13 years agoWhitespace.
Chad Rosier [Wed, 20 Jul 2011 19:27:01 +0000 (19:27 +0000)]
Whitespace.

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

13 years agoIf -ccc-host-triple i386-pc-win32-macho or -ccc-host-triple
Chad Rosier [Wed, 20 Jul 2011 19:14:30 +0000 (19:14 +0000)]
If -ccc-host-triple i386-pc-win32-macho or -ccc-host-triple
x86_64-pc-win32-macho is used in conjunction with -no-integrated-as go ahead and
use the Darwin system assembler.
rdar://9785470

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

13 years agoarc-objc++: Issue an arc specific diagnostic when overload resolution
Fariborz Jahanian [Wed, 20 Jul 2011 17:14:09 +0000 (17:14 +0000)]
arc-objc++: Issue an arc specific diagnostic when overload resolution
fails because of lifetime differences of parameter and argument type.
// rdar://9790531

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

13 years agotest/CMakeLists.txt: Re-indent.
NAKAMURA Takumi [Wed, 20 Jul 2011 16:35:49 +0000 (16:35 +0000)]
test/CMakeLists.txt: Re-indent.

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

13 years agoUnbreak build after API change.
Benjamin Kramer [Wed, 20 Jul 2011 14:43:06 +0000 (14:43 +0000)]
Unbreak build after API change.

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

13 years agoarrayref should now move in here, and redundant #includes of <cassert> can go
Chris Lattner [Wed, 20 Jul 2011 07:13:40 +0000 (07:13 +0000)]
arrayref should now move in here, and redundant #includes of <cassert> can go
away (since it comes in through Casting.h).  This will have to wait for another
day when I'm unmotivated though, or someone else to pick it up :)

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

13 years agoremove some now-redundant forward declarations.
Chris Lattner [Wed, 20 Jul 2011 07:12:43 +0000 (07:12 +0000)]
remove some now-redundant forward declarations.

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

13 years agoadd raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.
Chris Lattner [Wed, 20 Jul 2011 07:06:53 +0000 (07:06 +0000)]
add raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.

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

13 years agonow that we have a centralized place to do so, add some using declarations for
Chris Lattner [Wed, 20 Jul 2011 06:58:45 +0000 (06:58 +0000)]
now that we have a centralized place to do so, add some using declarations for
some common llvm types: stringref and smallvector.  This cleans up the codebase
quite a bit.

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

13 years agointroduce a centralized place to introduce and inject llvm types into the
Chris Lattner [Wed, 20 Jul 2011 06:37:11 +0000 (06:37 +0000)]
introduce a centralized place to introduce and inject llvm types into the
clang namespace.  There are a number of LLVM types that are used pervasively
and it doesn't make sense to keep qualifying them.  Start with casting
operators.

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

13 years agofix rdar://9780211 - Clang crashes with an assertion failure building WKView.mm from...
Chris Lattner [Wed, 20 Jul 2011 06:29:00 +0000 (06:29 +0000)]
fix rdar://9780211 - Clang crashes with an assertion failure building WKView.mm from WebKit

This is something of a hack, the problem is as follows:

1. we instantiate both copied of RetainPtr with the two different argument types
   (an id and protocol-qualified id).
2. We refer to the ctor of one of the instantiations when introducing global "x",
   this causes us to emit an llvm::Function for a prototype whose "this" has type
   "RetainPtr<id<bork> >*".
3. We refer to the ctor of the other instantiation when introducing global "y",
   however, because it *mangles to the same name as the other ctor* we just use
   a bitcasted version of the llvm::Function we previously emitted.
4. We emit deferred declarations, causing us to emit the body of the ctor, however
   the body we emit is for RetainPtr<id>, which expects its 'this' to have an IR
   type of "RetainPtr<id>*".

Because of the mangling collision, we don't have this case, and explode.

This is really some sort of weird AST invariant violation or something, but hey
a bitcast makes the pain go away.

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

13 years agofix a case where we're using ConvertType for a memory object.
Chris Lattner [Wed, 20 Jul 2011 06:23:59 +0000 (06:23 +0000)]
fix a case where we're using ConvertType for a memory object.
It doesn't matter in practice, but it is good to be tidy.

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

13 years agoMatch LLVM API change.
Evan Cheng [Wed, 20 Jul 2011 06:22:27 +0000 (06:22 +0000)]
Match LLVM API change.

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

13 years agoas eli points out, we're not doing memory stuff here. While ConvertType
Chris Lattner [Wed, 20 Jul 2011 04:59:57 +0000 (04:59 +0000)]
as eli points out, we're not doing memory stuff here.  While ConvertType
and ConvertTypeForMem are the same for pointers, it is best to just
use ConvertType.  Thanks Eli!

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

13 years agofix PR10395 - array decay can produce an interesting type when
Chris Lattner [Wed, 20 Jul 2011 04:31:01 +0000 (04:31 +0000)]
fix PR10395 - array decay can produce an interesting type when
decaying an array of incomplete type (which has type [0 x i8]*) to a
normal pointer (which has incompletetype*).

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

13 years agoUse a ContinuousRangeMap to map from the global macro definition ID in
Douglas Gregor [Wed, 20 Jul 2011 01:29:15 +0000 (01:29 +0000)]
Use a ContinuousRangeMap to map from the global macro definition ID in
the AST reader down to the AST file + local ID, rather than walking
the PCH chain. More cleanup/generalization, although there is more
work to do for preprocessed entities. In particular, the
"preallocation" scheme for preprocessed entities is not going to work
well with late loading of PCH files, and it's likely we'll have to do
something akin to the SourceManager's negative/positive loading.

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

13 years agoUse a ContinuousRangeMap to map from the global selector ID in the AST
Douglas Gregor [Wed, 20 Jul 2011 01:10:58 +0000 (01:10 +0000)]
Use a ContinuousRangeMap to map from the global selector ID in the AST
reader down to the AST file + local ID, rather than walking the PCH
chain. No functionality change; this is generalization and cleanup.

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

13 years agoPR10392: "#pragma GCC visibility" must not expand macros in its
Joerg Sonnenberger [Wed, 20 Jul 2011 01:03:50 +0000 (01:03 +0000)]
PR10392: "#pragma GCC visibility" must not expand macros in its
arguments.

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

13 years agoUse a ContinuousRangeMap to map from the global identifier ID in the
Douglas Gregor [Wed, 20 Jul 2011 00:59:32 +0000 (00:59 +0000)]
Use a ContinuousRangeMap to map from the global identifier ID in the
AST reader down to the AST file + local ID, rather than walking the
PCH chain. No functionality change; this is generalization and cleanup.

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

13 years agoTry to appease MSVC's standard library.
Douglas Gregor [Wed, 20 Jul 2011 00:31:58 +0000 (00:31 +0000)]
Try to appease MSVC's standard library.

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

13 years agoUse a ContinuousRangeMap to map from the global declaration ID in the
Douglas Gregor [Wed, 20 Jul 2011 00:27:43 +0000 (00:27 +0000)]
Use a ContinuousRangeMap to map from the global declaration ID in the
AST reader down to the AST file + local ID within that file, rather
than lamely walking the PCH chain. There's no actual functionality
change now, but this is cleaner and more general.

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

13 years agoSpelling
Joerg Sonnenberger [Wed, 20 Jul 2011 00:14:37 +0000 (00:14 +0000)]
Spelling

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

13 years agoReplace r134583's fix for PR10290 with one which also works for non-value-dependent...
Richard Smith [Wed, 20 Jul 2011 00:12:52 +0000 (00:12 +0000)]
Replace r134583's fix for PR10290 with one which also works for non-value-dependent cases.

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

13 years agoUse the zero from the correct enumeration when initializing this variable.
Richard Smith [Wed, 20 Jul 2011 00:10:13 +0000 (00:10 +0000)]
Use the zero from the correct enumeration when initializing this variable.

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

13 years agoThis fix (thanks to Doug Gregor) corrects a bug
Sean Callanan [Tue, 19 Jul 2011 22:38:25 +0000 (22:38 +0000)]
This fix (thanks to Doug Gregor) corrects a bug
in ImportDefinition when replacing a previously
forward-declared CXXRecordDecl with its full
definition.  The forward-declared type's
DefinitionData had not been intialized for the
forward-declared type, so adding fields to the
Decl caused CXXRecordDecl::addedMember() to
crash when accessing the DefinitionData.

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

13 years agoFix false negative in -Wuninitialized involving a () wrapping an lvalue-to-rvalue...
Ted Kremenek [Tue, 19 Jul 2011 21:41:51 +0000 (21:41 +0000)]
Fix false negative in -Wuninitialized involving a () wrapping an lvalue-to-rvalue conversion in a DeclStmt.

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

13 years agoFix assertion failure in UninitializedValues.cpp where an lvalue to rvalue conversion...
Ted Kremenek [Tue, 19 Jul 2011 20:33:49 +0000 (20:33 +0000)]
Fix assertion failure in UninitializedValues.cpp where an lvalue to rvalue conversion is wrapped in a parenthesis.

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

13 years ago[analyzer] Very minor cleanup in PthreadLockChecker. No functionality change.
Jordy Rose [Tue, 19 Jul 2011 20:31:42 +0000 (20:31 +0000)]
[analyzer] Very minor cleanup in PthreadLockChecker. No functionality change.

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

13 years ago[analysis] Add checks for double-locking and lock order reversal bugs for
Jordy Rose [Tue, 19 Jul 2011 20:21:41 +0000 (20:21 +0000)]
[analysis] Add checks for double-locking and lock order reversal bugs for
pthread and XNU locks. Patch by Rui Paulo!

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

13 years agoRefactor r135502 to avoid an empty if else condition, per Eric's suggestion (good...
Chad Rosier [Tue, 19 Jul 2011 20:00:06 +0000 (20:00 +0000)]
Refactor r135502 to avoid an empty if else condition, per Eric's suggestion (good call!).

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

13 years agoAdd FixItHints in case a C++ function call is missing * or & operators on one/several...
Anna Zaks [Tue, 19 Jul 2011 19:49:12 +0000 (19:49 +0000)]
Add FixItHints in case a C++ function call is missing * or & operators on one/several of it's parameters (addresses http://llvm.org/PR5941).

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

13 years agoClang asserts "Invalid environment!" when using -ccc-host-triple
Chad Rosier [Tue, 19 Jul 2011 19:36:03 +0000 (19:36 +0000)]
Clang asserts "Invalid environment!" when using -ccc-host-triple
arch-pc-win32-macho (e.g., x86_64-pc-win32-macho), which appears to be a false
positive.
rdar://9786307

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

13 years agoUpdate CMake build.
Benjamin Kramer [Tue, 19 Jul 2011 17:26:28 +0000 (17:26 +0000)]
Update CMake build.

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

13 years ago[arcmt] Add some additional driver flags to optionally emit or save the pre-migration...
Argyrios Kyrtzidis [Tue, 19 Jul 2011 17:20:03 +0000 (17:20 +0000)]
[arcmt] Add some additional driver flags to optionally emit or save the pre-migration ARC errors.

-arcmt-migrate-emit-errors : Emits the pre-migration ARC errors but it doesn't affect anything else
-arcmt-migrate-report-output : Writes out the pre-migration ARC errors to the provided plist file

rdar://9791454

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

13 years agoName the "c++0x-compat" warning group, and fix the names of two
Jeffrey Yasskin [Tue, 19 Jul 2011 16:38:48 +0000 (16:38 +0000)]
Name the "c++0x-compat" warning group, and fix the names of two
warnings that were intended to be inside it.

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

13 years agoRevamp the SourceManager to separate the representation of parsed
Douglas Gregor [Tue, 19 Jul 2011 16:10:42 +0000 (16:10 +0000)]
Revamp the SourceManager to separate the representation of parsed
source locations from source locations loaded from an AST/PCH file.

Previously, loading an AST/PCH file involved carefully pre-allocating
space at the beginning of the source manager for the source locations
and FileIDs that correspond to the prefix, and then appending the
source locations/FileIDs used for parsing the remaining translation
unit. This design forced us into loading PCH files early, as a prefix,
whic has become a rather significant limitation.

This patch splits the SourceManager space into two parts: for source
location "addresses", the lower values (growing upward) are used to
describe parsed code, while upper values (growing downward) are used
for source locations loaded from AST/PCH files. Similarly, positive
FileIDs are used to describe parsed code while negative FileIDs are
used to file/macro locations loaded from AST/PCH files. As a result,
we can load PCH/AST files even during parsing, making various
improvemnts in the future possible, e.g., teaching #include <foo.h> to
look for and load <foo.h.gch> if it happens to be already available.

This patch was originally written by Sebastian Redl, then brought
forward to the modern age by Jonathan Turner, and finally
polished/finished by me to be committed.

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

13 years agoReduce -Wuninitialized time by 22% (on sqlite) by removing the recursive AST crawl.
Ted Kremenek [Tue, 19 Jul 2011 14:18:48 +0000 (14:18 +0000)]
Reduce -Wuninitialized time by 22% (on sqlite) by removing the recursive AST crawl.

This is accomplished by forcing the needed expressions for -Wuninitialized to always be CFGElements in the CFG.
This allows us to remove a fair amount of the code for -Wuninitialized.

Some fallout:
- AnalysisBasedWarnings.cpp now specifically toggles the CFGBuilder to create a CFG that is suitable for -Wuninitialized.  This
is a layering violation, since the logic for -Wuninitialized is in libAnalysis.  This can be fixed with the proper refactoring.
- Some of the source locations for -Wunreachable-code warnings have shifted.  While not ideal, this is okay because that analysis
already needs some serious reworking.

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

13 years agoAdd hooks into the CFG builder to force that specific expressions are always CFGElements.
Ted Kremenek [Tue, 19 Jul 2011 14:18:43 +0000 (14:18 +0000)]
Add hooks into the CFG builder to force that specific expressions are always CFGElements.

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

13 years agoFix typo.
Nick Lewycky [Tue, 19 Jul 2011 08:48:08 +0000 (08:48 +0000)]
Fix typo.

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

13 years agoMatch createTargetMachine API change.
Evan Cheng [Tue, 19 Jul 2011 06:37:41 +0000 (06:37 +0000)]
Match createTargetMachine API change.

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

13 years agoSimplify.
Devang Patel [Tue, 19 Jul 2011 00:52:18 +0000 (00:52 +0000)]
Simplify.

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

13 years agoImplement a __WCHAR_UNSIGNED__ macro and use it to include WCHAR_MIN and
Sean Hunt [Tue, 19 Jul 2011 00:50:57 +0000 (00:50 +0000)]
Implement a __WCHAR_UNSIGNED__ macro and use it to include WCHAR_MIN and
WCHAR_MAX in limits.h, thus solving the problem where the system header
thinks it knows better.

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

13 years agoAdd .gitignore file.
Eric Christopher [Mon, 18 Jul 2011 23:05:36 +0000 (23:05 +0000)]
Add .gitignore file.

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

13 years agoCheck column number also.
Devang Patel [Mon, 18 Jul 2011 22:18:04 +0000 (22:18 +0000)]
Check column number also.

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

13 years agoMCContext now takes MCRegisterInfo.
Evan Cheng [Mon, 18 Jul 2011 20:57:51 +0000 (20:57 +0000)]
MCContext now takes MCRegisterInfo.

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

13 years agoThanks to Chandler for reminding me to update the documentation for the
Sean Hunt [Mon, 18 Jul 2011 17:22:33 +0000 (17:22 +0000)]
Thanks to Chandler for reminding me to update the documentation for the
__underlying_type feature.

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

13 years agoRemember to add a has_feature macro for __underlying_type now that it is
Sean Hunt [Mon, 18 Jul 2011 17:08:00 +0000 (17:08 +0000)]
Remember to add a has_feature macro for __underlying_type now that it is
correctly impelmented

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

13 years agoDefine DiagnosticBuilder<<APValue so it's easy to include APValues in
Jeffrey Yasskin [Mon, 18 Jul 2011 16:43:53 +0000 (16:43 +0000)]
Define DiagnosticBuilder<<APValue so it's easy to include APValues in
diagnostics.

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

13 years agoMigrate LLVM and Clang to use the new makeArrayRef(...) functions where previously...
Frits van Bommel [Mon, 18 Jul 2011 12:00:32 +0000 (12:00 +0000)]
Migrate LLVM and Clang to use the new makeArrayRef(...) functions where previously explicit non-default constructors were used.
Mostly mechanical with some manual reformatting.

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

13 years agolib/Headers/mm_malloc.h: Use __mingw_aligned_malloc() in _mm_malloc() on mingw.
NAKAMURA Takumi [Mon, 18 Jul 2011 11:13:50 +0000 (11:13 +0000)]
lib/Headers/mm_malloc.h: Use __mingw_aligned_malloc() in _mm_malloc() on mingw.

By default, mingw does not have _mm_alloc() nor _aligned_malloc().

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

13 years ago[arcmt] When a NSData's 'bytes' family of methods are used on a local var,
Argyrios Kyrtzidis [Mon, 18 Jul 2011 07:44:50 +0000 (07:44 +0000)]
[arcmt] When a NSData's 'bytes' family of methods are used on a local var,
add __attribute__((objc_precise_lifetime)) to make sure that the object
(and its data) will not get released before the var goes out-of-scope.

rdar://9206226

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

13 years ago[arcmt] NSInvocation's [get/set]ReturnValue and [get/set]Argument are only safe
Argyrios Kyrtzidis [Mon, 18 Jul 2011 07:44:45 +0000 (07:44 +0000)]
[arcmt] NSInvocation's [get/set]ReturnValue and [get/set]Argument are only safe
with __unsafe_unretained parameters. Emit error for strong/weak ones. rdar://9206226

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

13 years agoDon't crash when codegen'ing an empty redecl of a function in C99 mode, when
Nick Lewycky [Mon, 18 Jul 2011 07:11:55 +0000 (07:11 +0000)]
Don't crash when codegen'ing an empty redecl of a function in C99 mode, when
neither was inline. Fixes bug introduced in r135377.

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

13 years agoIn C99, emit an inline function when encountering an extern redeclaration.
Nick Lewycky [Mon, 18 Jul 2011 05:26:13 +0000 (05:26 +0000)]
In C99, emit an inline function when encountering an extern redeclaration.
Fixes PR10233!

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

13 years agode-constify llvm::Type, patch by David Blaikie!
Chris Lattner [Mon, 18 Jul 2011 04:24:23 +0000 (04:24 +0000)]
de-constify llvm::Type, patch by David Blaikie!

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

13 years agoUse the new llvm::TinyPtrVector class, which implements exactly what
Chris Lattner [Mon, 18 Jul 2011 01:54:02 +0000 (01:54 +0000)]
Use the new llvm::TinyPtrVector class, which implements exactly what
ShadowMapEntry was.

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

13 years agoRevert r135217, which wasn't the correct fix for PR10358. With this
Chandler Carruth [Sat, 16 Jul 2011 22:27:02 +0000 (22:27 +0000)]
Revert r135217, which wasn't the correct fix for PR10358. With this
patch, we actually move the state-machine for the value set backwards
one step. This can pretty easily lead to infinite loops where we
continually try to propagate a bit, succeed for one iteration, but then
back up because we find an uninitialized use.

A reduced test case from PR10379 is included.

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

13 years agoDo not modify string returned by getenv on Windows.
Francois Pichet [Sat, 16 Jul 2011 21:17:14 +0000 (21:17 +0000)]
Do not modify string returned by getenv on Windows.
Fixes PR9875, patch by Nikola Smiljanic!

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

13 years agoZero this struct in a way that neither depends on the size of the struct nor triggers...
Benjamin Kramer [Sat, 16 Jul 2011 20:13:06 +0000 (20:13 +0000)]
Zero this struct in a way that neither depends on the size of the struct nor triggers warnings from GCC.

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

13 years ago[analyzer] Per discussions with the Cocoa team, extend CF naming conventions to exten...
Ted Kremenek [Sat, 16 Jul 2011 19:50:36 +0000 (19:50 +0000)]
[analyzer] Per discussions with the Cocoa team, extend CF naming conventions to extend to camel case functions instead of just title case functions.  Fixes <rdar://problem/9732321>.

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

13 years ago[analyzer] Place checking for Core Foundation "Create" rule into a proper API. No...
Ted Kremenek [Sat, 16 Jul 2011 19:50:32 +0000 (19:50 +0000)]
[analyzer] Place checking for Core Foundation "Create" rule into a proper API.  No functionality change.

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

13 years agoRemove a gcc warning.
Fariborz Jahanian [Sat, 16 Jul 2011 18:31:33 +0000 (18:31 +0000)]
Remove a gcc warning.

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

13 years agoCorrectly handle sysroot prefix in -print-search-dirs. Makes libtool
Joerg Sonnenberger [Sat, 16 Jul 2011 10:50:05 +0000 (10:50 +0000)]
Correctly handle sysroot prefix in -print-search-dirs. Makes libtool
more happy on NetBSD.

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

13 years agoFix a typo.
Fariborz Jahanian [Sat, 16 Jul 2011 00:08:33 +0000 (00:08 +0000)]
Fix a typo.

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

13 years ago[arcmt] It's not safe to remove the -release on "[[someivar delegate] release];"...
Argyrios Kyrtzidis [Fri, 15 Jul 2011 23:48:56 +0000 (23:48 +0000)]
[arcmt] It's not safe to remove the -release on "[[someivar delegate] release];" since it's very likely
that, after migration, the object that was passed to 'setDelegate:' will not be properly retained, e.g:

-whatever {
  id x = [[MyDoHicky alloc] init];
  [someivar setDelegate: x]; // x won't get retained in ARC.
}
-dealloc {
  [[someivar delegate] release]; // give migration error here.
}

rdar://8858009

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

13 years agoThis handles the missing cases of opencl vector literals.
Tanya Lattner [Fri, 15 Jul 2011 23:07:01 +0000 (23:07 +0000)]
This handles the missing cases of opencl vector literals.
Test cases provided by Anton Lokhmot.

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

13 years agoUpdate retain-release.m to match updated warnings from r135310
Jordy Rose [Fri, 15 Jul 2011 22:38:26 +0000 (22:38 +0000)]
Update retain-release.m to match updated warnings from r135310

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

13 years ago[libclang] Map canonical decl of a category implementation to the category decl.
Argyrios Kyrtzidis [Fri, 15 Jul 2011 22:37:58 +0000 (22:37 +0000)]
[libclang] Map canonical decl of a category implementation to the category decl.

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

13 years agoRevert r135304 and apply fix in clang_getCanonicalCursor per Doug's, Fariborz's comments.
Argyrios Kyrtzidis [Fri, 15 Jul 2011 22:27:18 +0000 (22:27 +0000)]
Revert r135304 and apply fix in clang_getCanonicalCursor per Doug's, Fariborz's comments.

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

13 years agoAdd tests for CFRefReport's path notes, and fix a few typos and non-standard terminol...
Jordy Rose [Fri, 15 Jul 2011 22:17:54 +0000 (22:17 +0000)]
Add tests for CFRefReport's path notes, and fix a few typos and non-standard terminology ('+0 retain counts') caught by the tests.

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

13 years ago[arcmt] Rewrite to "foo = nil;" not "foo = 0;", as suggested by Jordy.
Argyrios Kyrtzidis [Fri, 15 Jul 2011 22:04:00 +0000 (22:04 +0000)]
[arcmt] Rewrite to "foo = nil;" not "foo = 0;", as suggested by Jordy.

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

13 years agoPrevent the -save-temps flag from modifying the input file if the input filename
Chad Rosier [Fri, 15 Jul 2011 21:54:29 +0000 (21:54 +0000)]
Prevent the -save-temps flag from modifying the input file if the input filename
conflicts with a to be produced temp filename.
rdar://9724657

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

13 years agoAugment the interface of ExternalASTSource::FindExternalLexicalDecls()
Douglas Gregor [Fri, 15 Jul 2011 21:46:17 +0000 (21:46 +0000)]
Augment the interface of ExternalASTSource::FindExternalLexicalDecls()
to allow clients to specify that they've already (correctly) loaded
declarations, and that no further action is needed.

Also, make sure that we clear the "has external lexical declarations"
bit before calling FindExternalLexicalDecls(), to avoid infinite
recursion.

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

13 years agoThe canonical decl for an ObjCImplDecl is it's interface class. Fixes rdar://8728637.
Argyrios Kyrtzidis [Fri, 15 Jul 2011 21:39:32 +0000 (21:39 +0000)]
The canonical decl for an ObjCImplDecl is it's interface class. Fixes rdar://8728637.

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

13 years ago[arcmt] For:
Argyrios Kyrtzidis [Fri, 15 Jul 2011 21:11:23 +0000 (21:11 +0000)]
[arcmt] For:

id x = ...
@try {
 ...
} @finally {
 [x release];
}

Migrator will drop the release. It's better to change it to "x = 0" in a @finally to avoid leak when exception is thrown.

rdar://9398256

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

13 years agoDon't refer to check.deps unless LLVM_INCLUDE_TESTS is enabled
Douglas Gregor [Fri, 15 Jul 2011 21:03:20 +0000 (21:03 +0000)]
Don't refer to check.deps unless LLVM_INCLUDE_TESTS is enabled

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

13 years ago[analyzer] GNU __null is a pointer-sized integer, not a pointer. Fixes PR10372.
Jordy Rose [Fri, 15 Jul 2011 20:29:02 +0000 (20:29 +0000)]
[analyzer] GNU __null is a pointer-sized integer, not a pointer. Fixes PR10372.

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

13 years agoFix typo
Joerg Sonnenberger [Fri, 15 Jul 2011 18:23:44 +0000 (18:23 +0000)]
Fix typo

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

13 years agoUse the new APFloat::convertToInt(APSInt) function to simplify uses of
Jeffrey Yasskin [Fri, 15 Jul 2011 17:03:07 +0000 (17:03 +0000)]
Use the new APFloat::convertToInt(APSInt) function to simplify uses of
convertToInt(integerParts*) and make them more reliable.

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

13 years agoStore bracket locations for array subscript expressions, from Erik Verbruggen!
Douglas Gregor [Fri, 15 Jul 2011 16:25:15 +0000 (16:25 +0000)]
Store bracket locations for array subscript expressions, from Erik Verbruggen!

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