]> granicus.if.org Git - clang/log
clang
13 years agoEmit in-class member function definitions that are marked
Douglas Gregor [Tue, 15 Feb 2011 18:11:42 +0000 (18:11 +0000)]
Emit in-class member function definitions that are marked
"used". Fixes <rdar://problem/8684363>.

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

13 years agoAllow resolving headers from a PCH even after headers+PCH were moved to another path.
Argyrios Kyrtzidis [Tue, 15 Feb 2011 17:54:22 +0000 (17:54 +0000)]
Allow resolving headers from a PCH even after headers+PCH were moved to another path.

Store in PCH the directory that the PCH was originally created in.
If a header file is not found at the path that we expect it to be and the PCH file
was moved from its original location, try to resolve the file by assuming that
header+PCH were moved together and the header is in the same place relative to the PCH.

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

13 years agoRefactoring of code to issue warning on implemented
Fariborz Jahanian [Tue, 15 Feb 2011 17:49:58 +0000 (17:49 +0000)]
Refactoring of code to issue warning on implemented
deprecated class and methods in objective-c.

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

13 years agoAdd missing CMake dependency
Douglas Gregor [Tue, 15 Feb 2011 17:09:56 +0000 (17:09 +0000)]
Add missing CMake dependency

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

13 years agoFix the clang-wpa example.
Argyrios Kyrtzidis [Tue, 15 Feb 2011 16:54:12 +0000 (16:54 +0000)]
Fix the clang-wpa example.

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

13 years agoInitialize InlineCall in AnalyzerOptions.
Argyrios Kyrtzidis [Tue, 15 Feb 2011 16:54:07 +0000 (16:54 +0000)]
Initialize InlineCall in AnalyzerOptions.

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

13 years agoAssorted cleanup:
John McCall [Tue, 15 Feb 2011 09:22:45 +0000 (09:22 +0000)]
Assorted cleanup:
  - Have CGM precompute a number of commonly-used types
  - Have CGF copy that during initialization instead of recomputing them
  - Use TBAA info when initializing a parameter variable
  - Refactor the scalar ++/-- code

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

13 years agoAdd CMake support to the clang unittests.
Jeffrey Yasskin [Tue, 15 Feb 2011 07:54:28 +0000 (07:54 +0000)]
Add CMake support to the clang unittests.

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

13 years ago[analyzer] Reflect changes for tablegen'ing the checkers.
Argyrios Kyrtzidis [Tue, 15 Feb 2011 07:42:38 +0000 (07:42 +0000)]
[analyzer] Reflect changes for tablegen'ing the checkers.

-Update tablegen files for checkers, use the tablegen class name for the checker class name.
-Update ClangSACheckersProvider to not look into hidden checker packages.

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

13 years ago[analyzer] Use the new registration mechanism on some of the internal checks. These...
Argyrios Kyrtzidis [Tue, 15 Feb 2011 07:42:33 +0000 (07:42 +0000)]
[analyzer] Use the new registration mechanism on some of the internal checks. These are:

StackAddrLeakChecker
ObjCAtSyncChecker
UnixAPIChecker
MacOSXAPIChecker

The rest have/create implicit dependencies between checkers and need to be handled differently.

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

13 years agoReturn a declaration to the parser when creating a field in C++ so that
John McCall [Tue, 15 Feb 2011 07:12:36 +0000 (07:12 +0000)]
Return a declaration to the parser when creating a field in C++ so that
the parser will complete the declarator with a valid decl and thus trigger
delayed diagnostics for it.  It certainly looks like we were intentionally
returning null here, but I couldn't find any good reason for it, and there
wasn't a comment, so farewell to all that.

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

13 years agoPerform zero-initialization of virtual base classes when emitting
John McCall [Tue, 15 Feb 2011 06:40:56 +0000 (06:40 +0000)]
Perform zero-initialization of virtual base classes when emitting
a zero constant for a complete class.  rdar://problem/8424975

To make this happen, track the field indexes for virtual bases
in the complete object.  I'm curious whether we might be better
off making CGRecordLayoutBuilder *much* more reliant on
ASTRecordLayout;  we're currently duplicating an awful lot of the ABI
layout logic.

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

13 years agoFix memory leak in CFGBuilder resulting from tracking scope information using SmallVe...
Ted Kremenek [Tue, 15 Feb 2011 02:47:45 +0000 (02:47 +0000)]
Fix memory leak in CFGBuilder resulting from tracking scope information using SmallVectors.

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

13 years agoConvert RecordLayout::Alignment to CharUnits from bit units. No change in
Ken Dyck [Tue, 15 Feb 2011 02:32:40 +0000 (02:32 +0000)]
Convert RecordLayout::Alignment to CharUnits from bit units. No change in
functionality intended.

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

13 years agoIdempotentOperationChecker: don't repeatedly recompute block reachability.
Ted Kremenek [Tue, 15 Feb 2011 02:20:03 +0000 (02:20 +0000)]
IdempotentOperationChecker: don't repeatedly recompute block reachability.

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

13 years agoWarn if method for a deprecated method is implemented.
Fariborz Jahanian [Tue, 15 Feb 2011 00:59:30 +0000 (00:59 +0000)]
Warn if method for a deprecated method is implemented.
Warn if class for a deprecated class is implemented.
Warn if category for a deprecated class is implemented.
All under control of -Wdeprecated-implementations.
// rdar://8973810.

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

13 years agoupdate for ConstantVector API change.
Chris Lattner [Tue, 15 Feb 2011 00:14:06 +0000 (00:14 +0000)]
update for ConstantVector API change.

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

13 years agoPut "incomplete implementation" warning under a flag.
Ted Kremenek [Mon, 14 Feb 2011 23:59:16 +0000 (23:59 +0000)]
Put "incomplete implementation" warning under a flag.

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

13 years agoDon't crash on hierarchy static_casts which appear in variable initializers.
John McCall [Mon, 14 Feb 2011 23:21:33 +0000 (23:21 +0000)]
Don't crash on hierarchy static_casts which appear in variable initializers.
PR9221.

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

13 years agoChange the context correctly when instantiating a static data member definition.
John McCall [Mon, 14 Feb 2011 20:37:25 +0000 (20:37 +0000)]
Change the context correctly when instantiating a static data member definition.

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

13 years agoAdd current binary and source directories to the header search list
Oscar Fuentes [Mon, 14 Feb 2011 20:14:11 +0000 (20:14 +0000)]
Add current binary and source directories to the header search list
for all compiler invocations.

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

13 years agoAnger the CMake gods by updating 'clang.xcodeproj'.
Argyrios Kyrtzidis [Mon, 14 Feb 2011 20:09:57 +0000 (20:09 +0000)]
Anger the CMake gods by updating 'clang.xcodeproj'.

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

13 years agoRemove left-over #include.
Argyrios Kyrtzidis [Mon, 14 Feb 2011 19:02:35 +0000 (19:02 +0000)]
Remove left-over #include.

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

13 years agoProvide overload diagnostics when explicit casts involving class types fail.
John McCall [Mon, 14 Feb 2011 18:34:10 +0000 (18:34 +0000)]
Provide overload diagnostics when explicit casts involving class types fail.
PR8626.

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

13 years agorevert my ConstantVector patch, it seems to have made the llvm-gcc
Chris Lattner [Mon, 14 Feb 2011 18:16:09 +0000 (18:16 +0000)]
revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy.

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

13 years ago[analyzer] Overhauling of the checker registration mechanism.
Argyrios Kyrtzidis [Mon, 14 Feb 2011 18:13:31 +0000 (18:13 +0000)]
[analyzer] Overhauling of the checker registration mechanism.

-Checkers will be defined in the tablegen file 'Checkers.td'.
-Apart from checkers, we can define checker "packages" that will contain a collection of checkers.
-Checkers can be enabled with -analyzer-checker=<name> and disabled with -analyzer-disable-checker=<name> e.g:
Enable checkers from 'cocoa' and 'corefoundation' packages except the self-initialization checker:
-analyzer-checker=cocoa -analyzer-checker=corefoundation -analyzer-disable-checker=cocoa.SelfInit
-Introduces CheckerManager and CheckerProvider. CheckerProviders get the set of checker names to enable/disable and
 register them with the CheckerManager which will be the entry point for all checker-related functionality.

Currently only the self-initialization checker takes advantage of the new mechanism.

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

13 years ago[analyzer] Remove ManagerRegistry which is not used. In the future we may load analyz...
Argyrios Kyrtzidis [Mon, 14 Feb 2011 18:13:17 +0000 (18:13 +0000)]
[analyzer] Remove ManagerRegistry which is not used. In the future we may load analyzer plugins dynamically but
registration through static constructors should be avoided.

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

13 years ago[analyzer] Move include/clang/StaticAnalyzer/AnalysisConsumer.h -> lib/StaticAnalyzer...
Argyrios Kyrtzidis [Mon, 14 Feb 2011 18:13:11 +0000 (18:13 +0000)]
[analyzer] Move include/clang/StaticAnalyzer/AnalysisConsumer.h -> lib/StaticAnalyzer/Frontend/AnalysisConsumer.h since
FrontendActions.cpp is the only user.

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

13 years ago[analyzer] Move Checkers/FrontendActions.cpp -> Frontend/FrontendActions.cpp
Argyrios Kyrtzidis [Mon, 14 Feb 2011 18:13:06 +0000 (18:13 +0000)]
[analyzer] Move Checkers/FrontendActions.cpp -> Frontend/FrontendActions.cpp

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

13 years ago[analyzer] Introduce libclangStaticAnalyzerFrontend and move Checkers/AnalysisConsume...
Argyrios Kyrtzidis [Mon, 14 Feb 2011 18:13:01 +0000 (18:13 +0000)]
[analyzer] Introduce libclangStaticAnalyzerFrontend and move Checkers/AnalysisConsumer.cpp into Frontend lib.

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

13 years agoRemove dead code in IdempotentOperationChecker.
Ted Kremenek [Mon, 14 Feb 2011 18:05:07 +0000 (18:05 +0000)]
Remove dead code in IdempotentOperationChecker.

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

13 years agoFix edge case where we don't cull warnings in IdempotentOperationsChecker due to...
Ted Kremenek [Mon, 14 Feb 2011 17:59:23 +0000 (17:59 +0000)]
Fix edge case where we don't cull warnings in IdempotentOperationsChecker due to incomplete analysis of loops.

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

13 years agoUse 'BitVector' instead of SmallPtrSet<CFGBlock*> in IdempotentOperationsChecker...
Ted Kremenek [Mon, 14 Feb 2011 17:59:20 +0000 (17:59 +0000)]
Use 'BitVector' instead of SmallPtrSet<CFGBlock*> in IdempotentOperationsChecker.  No real functionality change.

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

13 years agoAdd support for the builtins used in gcc 4.4's <cmath> and <complex>
Jeffrey Yasskin [Mon, 14 Feb 2011 17:02:48 +0000 (17:02 +0000)]
Add support for the builtins used in gcc 4.4's <cmath> and <complex>
headers in C++0x mode.  Fixes PR9138.

Patch by John Bytheway!

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

13 years agoHandle 'UsingDirective' in CFGRecStmtDeclVisitor.
Ted Kremenek [Mon, 14 Feb 2011 17:00:16 +0000 (17:00 +0000)]
Handle 'UsingDirective' in CFGRecStmtDeclVisitor.

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

13 years agoupdate for ConstantVector::get API change.
Chris Lattner [Mon, 14 Feb 2011 07:55:40 +0000 (07:55 +0000)]
update for ConstantVector::get API change.

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

13 years agoWhen parsing an out-of-line member function declaration, we must delay
John McCall [Mon, 14 Feb 2011 07:13:47 +0000 (07:13 +0000)]
When parsing an out-of-line member function declaration, we must delay
access-control diagnostics which arise from the portion of the declarator
following the scope specifier, just in case access is granted by
friending the individual method.  This can also happen with in-line
member function declarations of class templates due to templated-scope
friend declarations.

We were really playing fast-and-loose before with this sort of thing,
and it turned out to work because *most* friend functions are in file
scope.  Making us delay regardless of context exposed several bugs with
how we were manipulating delay.  I ended up needing a concept of a
context that's independent of the declarations in which it appears,
and then I actually had to make some things save contexts correctly,
but delay should be much cleaner now.

I also encapsulated all the delayed-diagnostics machinery in a single
subobject of Sema;  this is a pattern we might want to consider rolling
out to other components of Sema.

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

13 years agofix two broken links and some out of date writing, PR9174
Chris Lattner [Mon, 14 Feb 2011 06:42:50 +0000 (06:42 +0000)]
fix two broken links and some out of date writing, PR9174

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

13 years agoAdd missing file
Peter Collingbourne [Mon, 14 Feb 2011 02:14:26 +0000 (02:14 +0000)]
Add missing file

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

13 years agoOpenCL: add support for __kernel, kernel keywords and EXTENSION,
Peter Collingbourne [Mon, 14 Feb 2011 01:42:53 +0000 (01:42 +0000)]
OpenCL: add support for __kernel, kernel keywords and EXTENSION,
FP_CONTRACT pragmas.  Patch originally by ARM.

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

13 years agoMove support for "#pragma STDC FP_CONTRACT" to Parser; add Sema actions
Peter Collingbourne [Mon, 14 Feb 2011 01:42:35 +0000 (01:42 +0000)]
Move support for "#pragma STDC FP_CONTRACT" to Parser; add Sema actions

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

13 years agoMake LexOnOffSwitch a Preprocessor member function
Peter Collingbourne [Mon, 14 Feb 2011 01:42:24 +0000 (01:42 +0000)]
Make LexOnOffSwitch a Preprocessor member function

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

13 years agoUse hasSameType in one more, hopefully, last place.
Fariborz Jahanian [Sun, 13 Feb 2011 20:11:42 +0000 (20:11 +0000)]
Use hasSameType in one more, hopefully, last place.

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

13 years agoSome refactoring and using more modern APIs for
Fariborz Jahanian [Sun, 13 Feb 2011 20:01:48 +0000 (20:01 +0000)]
Some refactoring and using more modern APIs for
implementation of co/contra-variance objc++
block pointers. // rdar://8979379.

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

13 years agoGive some convenient idiomatic accessors to Stmt::child_range and
John McCall [Sun, 13 Feb 2011 04:07:26 +0000 (04:07 +0000)]
Give some convenient idiomatic accessors to Stmt::child_range and
Stmt::const_child_range, then make a bunch of places use them instead
of the individual iterator accessors.

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

13 years agoLook through array types when deciding whether a field requires non-trivial
John McCall [Sun, 13 Feb 2011 00:46:43 +0000 (00:46 +0000)]
Look through array types when deciding whether a field requires non-trivial
destruction in the destructor-aliases logic.  Fixes PR 9197.

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

13 years agoImplement objective-c++'s block pointer type matching involving
Fariborz Jahanian [Sat, 12 Feb 2011 19:07:46 +0000 (19:07 +0000)]
Implement objective-c++'s block pointer type matching involving
types which are contravariance in argument types and covariance
in return types. // rdar://8979379.

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

13 years agoTeach the IdempotentOperations checker to ignore property setters.
Ted Kremenek [Sat, 12 Feb 2011 18:50:03 +0000 (18:50 +0000)]
Teach the IdempotentOperations checker to ignore property setters.

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

13 years agoWhen reading the AST, delay loading of the redeclaration chain to avoid deeply nested...
Argyrios Kyrtzidis [Sat, 12 Feb 2011 07:50:47 +0000 (07:50 +0000)]
When reading the AST, delay loading of the redeclaration chain to avoid deeply nested calls.
Temporarily set the first (canonical) declaration as the previous one, which is the one that
matters, and mark the real previous DeclID to be loaded & attached later on.

Fixes rdar://8956193.

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

13 years agoUpdate static analyzer build to checker-255.
Ted Kremenek [Sat, 12 Feb 2011 03:20:34 +0000 (03:20 +0000)]
Update static analyzer build to checker-255.

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

13 years agoWeaken the ObjCSelfInitChecker to only warn when one calls an 'init' method within...
Ted Kremenek [Sat, 12 Feb 2011 03:03:54 +0000 (03:03 +0000)]
Weaken the ObjCSelfInitChecker to only warn when one calls an 'init' method within an 'init' method.  This is a temporary stop gap to avoid false positives while we investigate how to make it smarter.

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

13 years agoAdd test case for <rdar://problem/6888289>.
Ted Kremenek [Sat, 12 Feb 2011 01:25:04 +0000 (01:25 +0000)]
Add test case for <rdar://problem/6888289>.

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

13 years agostatic analyzer: Also invalidate instance variables of a receiver in a message expres...
Ted Kremenek [Sat, 12 Feb 2011 01:01:31 +0000 (01:01 +0000)]
static analyzer: Also invalidate instance variables of a receiver in a message expression, just as we do with parameters.

Fixes <rdar://problem/8725041>.

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

13 years agoDon't emit a dead store for '++' operations unless it occurs with a return statement...
Ted Kremenek [Sat, 12 Feb 2011 00:17:19 +0000 (00:17 +0000)]
Don't emit a dead store for '++' operations unless it occurs with a return statement.  We've never seen any other cases that were real bugs.

Fixes <rdar://problem/6962292>.

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

13 years agoAdd CMake dependencies so that LLVM_USED_LIBS order doesn't matter.
Jeffrey Yasskin [Fri, 11 Feb 2011 23:46:38 +0000 (23:46 +0000)]
Add CMake dependencies so that LLVM_USED_LIBS order doesn't matter.

I also sorted the tools/driver dependencies since their order no
longer matters.

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

13 years agoDon't report dead stores on unreachable code paths. Fixes <rdar://problem/8405222>.
Ted Kremenek [Fri, 11 Feb 2011 23:24:26 +0000 (23:24 +0000)]
Don't report dead stores on unreachable code paths.  Fixes <rdar://problem/8405222>.

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

13 years agoUses llvm::sys::path instead of hand-rolled algorithm in FileManager.
Zhanyong Wan [Fri, 11 Feb 2011 21:25:35 +0000 (21:25 +0000)]
Uses llvm::sys::path instead of hand-rolled algorithm in FileManager.
Reviewed by dgregor.

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

13 years agoAdd test case for PR 8646.
Ted Kremenek [Fri, 11 Feb 2011 20:13:27 +0000 (20:13 +0000)]
Add test case for PR 8646.

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

13 years agoReject forbidden storage class specifiers in OpenCL. Patch by George Russell!
Peter Collingbourne [Fri, 11 Feb 2011 19:59:54 +0000 (19:59 +0000)]
Reject forbidden storage class specifiers in OpenCL. Patch by George Russell!

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

13 years agoRemove RegionStoreManager::evalBinOp(), which is now handled by the SValBuilder.
Ted Kremenek [Fri, 11 Feb 2011 19:48:19 +0000 (19:48 +0000)]
Remove RegionStoreManager::evalBinOp(), which is now handled by the SValBuilder.

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

13 years agoRename 'InvalidateRegions()' to 'invalidateRegions()'.
Ted Kremenek [Fri, 11 Feb 2011 19:48:15 +0000 (19:48 +0000)]
Rename 'InvalidateRegions()' to 'invalidateRegions()'.

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

13 years agoRename the operation that loads a preprocessed entity from a given offset to indicate...
Douglas Gregor [Fri, 11 Feb 2011 19:46:30 +0000 (19:46 +0000)]
Rename the operation that loads a preprocessed entity from a given offset to indicate that we're loading from an offset, not an index, lest one be confused. No functionality change.

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

13 years agoFix a block sema bug where result type of initializer
Fariborz Jahanian [Fri, 11 Feb 2011 18:46:17 +0000 (18:46 +0000)]
Fix a block sema bug where result type of initializer
is unqualified but its initialized is qualified.
This is for c only and fixes the imm. problem.
c++ is more involved and is wip.
// rdar://8979379

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

13 years agoImproves Clang's virtual file handling.
Zhanyong Wan [Fri, 11 Feb 2011 18:44:49 +0000 (18:44 +0000)]
Improves Clang's virtual file handling.

This patch contains:

- making some of the existing comments more accurate in the presence
of virtual files/directories.

- renaming some private data members of FileManager to match their roles better.

- creating 'DirectorEntry's for the parent directories of virtual
files, such that we can tell whether two virtual files are from the
same directory.  This is useful for injecting virtual files whose
directories don't exist in the real file system.

- minor clean-ups and adding comments for class
FileManager::UniqueDirContainer and FileManager::UniqueFileContainer.

- adding statistics on virtual files to FileManager::PrintStats().

- adding unit tests to verify the existing and new behavior of FileManager.

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

13 years agoDon't compare llvm::Optional<> objects directly; compare their
Douglas Gregor [Fri, 11 Feb 2011 18:08:15 +0000 (18:08 +0000)]
Don't compare llvm::Optional<> objects directly; compare their
contents when it's safe. I just *love* C++ some days.

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

13 years agoInitHeaderSearch.cpp: [PR8298] Don't touch drive G: on Windows hosts!
NAKAMURA Takumi [Fri, 11 Feb 2011 05:25:56 +0000 (05:25 +0000)]
InitHeaderSearch.cpp: [PR8298] Don't touch drive G: on Windows hosts!

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

13 years agoAllow the 'Eng' entry in GRStateManager to be a (possibly null) pointer instead of...
Ted Kremenek [Fri, 11 Feb 2011 04:20:16 +0000 (04:20 +0000)]
Allow the 'Eng' entry in GRStateManager to be a (possibly null) pointer instead of a reference.

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

13 years agoFor consistency, use llvm::raw_ostream in the rest of the mangle api.
Rafael Espindola [Fri, 11 Feb 2011 02:52:17 +0000 (02:52 +0000)]
For consistency, use llvm::raw_ostream in the rest of the mangle api.

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

13 years agoConvert RecordLayout::DataSize to CharUnits from bits, eliminating two
Ken Dyck [Fri, 11 Feb 2011 02:20:09 +0000 (02:20 +0000)]
Convert RecordLayout::DataSize to CharUnits from bits, eliminating two
unnecessary calls to RoundUpToAlignment. No changes to functionality
intended.

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

13 years agoAdd a helper function, ASTContext::toBits(), that converts sizes in
Ken Dyck [Fri, 11 Feb 2011 01:54:29 +0000 (01:54 +0000)]
Add a helper function, ASTContext::toBits(), that converts sizes in
CharUnits to sizes in bits, and use it to tidy up the places where the
conversion was done explicitly.

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

13 years agoUse raw_ostream instead of raw_svector_ostream.
Rafael Espindola [Fri, 11 Feb 2011 01:41:00 +0000 (01:41 +0000)]
Use raw_ostream instead of raw_svector_ostream.

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

13 years agobuild/compiler-rt: Fake Clang into using the right assembler to build the ARM
Daniel Dunbar [Fri, 11 Feb 2011 01:29:49 +0000 (01:29 +0000)]
build/compiler-rt: Fake Clang into using the right assembler to build the ARM
bits for the runtime libraries.

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

13 years agoEliminate a major performance problem with chained PCH, where we were
Douglas Gregor [Fri, 11 Feb 2011 00:52:17 +0000 (00:52 +0000)]
Eliminate a major performance problem with chained PCH, where we were
causing the deserialization of a large number of declarations when
writing the visible-updates record for the translation unit in C. This
takes us from:

*** AST File Statistics:
  2 stat cache hits
  6 stat cache misses
  1/64463 source location entries read (0.001551%)
  15606/16956 types read (92.038216%)
  59266/89334 declarations read (66.342041%)
  38952/61393 identifiers read (63.446976%)
  0/7778 selectors read (0.000000%)
  24192/34644 statements read (69.830276%)
  388/8809 macros read (4.404586%)
  2095/5189 lexical declcontexts read (40.373867%)
  0/4587 visible declcontexts read (0.000000%)
  0/7716 method pool entries read (0.000000%)
  0 method pool misses

to

*** AST File Statistics:
  2 stat cache hits
  6 stat cache misses
  1/64463 source location entries read (0.001551%)
  26/16956 types read (0.153338%)
  18/89334 declarations read (0.020149%)
  145/61393 identifiers read (0.236183%)
  0/7778 selectors read (0.000000%)
  21/34644 statements read (0.060617%)
  0/8809 macros read (0.000000%)
  0/5189 lexical declcontexts read (0.000000%)
  0/4587 visible declcontexts read (0.000000%)
  0/7716 method pool entries read (0.000000%)
  0 method pool misses

when generating a chained PCH for a header that #includes Cocoa.h
(from a PCH file) and adds one simple function declaration. The
generated PCH file is now only 9580 bytes (down from > 2MB).

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

13 years agoImplement AST/PCH chaining support for macro definitions. Previously,
Douglas Gregor [Fri, 11 Feb 2011 00:26:14 +0000 (00:26 +0000)]
Implement AST/PCH chaining support for macro definitions. Previously,
we would deserialize all of the macro definitions we knew about while
serializing the macro definitions at the end of the AST/PCH file. Even
though we skipped most of them (since they were unchanged), it's still
a performance problem.

Now, we do the standard AST/PCH chaining trick: watch what identifiers
are deserialized as macro names, and consider only those identifiers
(along with macro definitions that have been deserialized/written in
the source) when serializing the preprocessor state.

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

13 years agoUse raw_svector_ostream in more places in the mangler.
Rafael Espindola [Thu, 10 Feb 2011 23:59:36 +0000 (23:59 +0000)]
Use raw_svector_ostream in more places in the mangler.

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

13 years agoAdd braces to quiet a gcc warning.
Matt Beaumont-Gay [Thu, 10 Feb 2011 20:35:01 +0000 (20:35 +0000)]
Add braces to quiet a gcc warning.

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

13 years agoFix think-o I committed without testing, shameful.
Daniel Dunbar [Thu, 10 Feb 2011 18:29:28 +0000 (18:29 +0000)]
Fix think-o I committed without testing, shameful.

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

13 years agoFix a gcc Wuninitialized false positive.
Daniel Dunbar [Thu, 10 Feb 2011 18:24:25 +0000 (18:24 +0000)]
Fix a gcc Wuninitialized false positive.

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

13 years agoWhen we're writing macro definitions to an AST/PCH File, sort the
Douglas Gregor [Thu, 10 Feb 2011 18:20:09 +0000 (18:20 +0000)]
When we're writing macro definitions to an AST/PCH File, sort the
macro definitions by macro name first. That way, we'll get a stable
ordering in the AST/PCH file.

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

13 years agoFor -Woverloaded-virtual take into account canonical methods. Fixes rdar://8979966...
Argyrios Kyrtzidis [Thu, 10 Feb 2011 18:13:41 +0000 (18:13 +0000)]
For -Woverloaded-virtual take into account canonical methods. Fixes rdar://8979966 & http://llvm.org/PR9182.

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

13 years agoFix family-friendly-o, tsk tsk.
Daniel Dunbar [Thu, 10 Feb 2011 18:10:07 +0000 (18:10 +0000)]
Fix family-friendly-o, tsk tsk.

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

13 years agoIRgen: Fix an immediate-exit-from-fn style nit.
Daniel Dunbar [Thu, 10 Feb 2011 17:32:22 +0000 (17:32 +0000)]
IRgen: Fix an immediate-exit-from-fn style nit.

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

13 years agoImplement two related optimizations that make de-serialization of
Douglas Gregor [Thu, 10 Feb 2011 17:09:37 +0000 (17:09 +0000)]
Implement two related optimizations that make de-serialization of
AST/PCH files more lazy:
  - Don't preload all of the file source-location entries when reading
  the AST file. Instead, load them lazily, when needed.
  - Only look up header-search information (whether a header was already
  #import'd, how many times it's been included, etc.) when it's needed
  by the preprocessor, rather than pre-populating it.

Previously, we would pre-load all of the file source-location entries,
which also populated the header-search information structure. This was
a relatively minor performance issue, since we would end up stat()'ing
all of the headers stored within a AST/PCH file when the AST/PCH file
was loaded. In the normal PCH use case, the stat()s were cached, so
the cost--of preloading ~860 source-location entries in the Cocoa.h
case---was relatively low.

However, the recent optimization that replaced stat+open with
open+fstat turned this into a major problem, since the preloading of
source-location entries would now end up opening those files. Worse,
those files wouldn't be closed until the file manager was destroyed,
so just opening a Cocoa.h PCH file would hold on to ~860 file
descriptors, and it was easy to blow through the process's limit on
the number of open file descriptors.

By eliminating the preloading of these files, we neither open nor stat
the headers stored in the PCH/AST file until they're actually needed
for something. Concretely, we went from

*** HeaderSearch Stats:
835 files tracked.
  364 #import/#pragma once files.
  823 included exactly once.
  6 max times a file is included.
  3 #include/#include_next/#import.
    0 #includes skipped due to the multi-include optimization.
1 framework lookups.
0 subframework lookups.

*** Source Manager Stats:
835 files mapped, 3 mem buffers mapped.
37460 SLocEntry's allocated, 11215575B of Sloc address space used.
62 bytes of files mapped, 0 files with line #'s computed.

with a trivial program that uses a chained PCH including a Cocoa PCH
to

*** HeaderSearch Stats:
4 files tracked.
  1 #import/#pragma once files.
  3 included exactly once.
  2 max times a file is included.
  3 #include/#include_next/#import.
    0 #includes skipped due to the multi-include optimization.
1 framework lookups.
0 subframework lookups.

*** Source Manager Stats:
3 files mapped, 3 mem buffers mapped.
37460 SLocEntry's allocated, 11215575B of Sloc address space used.
62 bytes of files mapped, 0 files with line #'s computed.

for the same program.

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

13 years agoAdjust the object files to be linked in when mcount profiling
Roman Divacky [Thu, 10 Feb 2011 16:59:40 +0000 (16:59 +0000)]
Adjust the object files to be linked in when mcount profiling
is specified in the FreeBSD linker driver.

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

13 years agoAdd a testcase for the mcount profiling.
Roman Divacky [Thu, 10 Feb 2011 16:52:35 +0000 (16:52 +0000)]
Add a testcase for the mcount profiling.

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

13 years agoImplement mcount profiling, enabled via -pg.
Roman Divacky [Thu, 10 Feb 2011 16:52:03 +0000 (16:52 +0000)]
Implement mcount profiling, enabled via -pg.

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

13 years agoDrop the 'InBits' part from the name of RecordSizeInBits as the value is in
Ken Dyck [Thu, 10 Feb 2011 12:36:29 +0000 (12:36 +0000)]
Drop the 'InBits' part from the name of RecordSizeInBits as the value is in
character units.

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

13 years agoEliminate some signed-to-unsigned comparision warnings introduced in
Ken Dyck [Thu, 10 Feb 2011 12:20:05 +0000 (12:20 +0000)]
Eliminate some signed-to-unsigned comparision warnings introduced in
r125156.

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

13 years agoCMake: LLVM_NO_RTTI must be obsolete now!
NAKAMURA Takumi [Thu, 10 Feb 2011 09:15:32 +0000 (09:15 +0000)]
CMake: LLVM_NO_RTTI must be obsolete now!

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

13 years agoMove the check that gives functions with unique-external types unique-external
John McCall [Thu, 10 Feb 2011 06:50:24 +0000 (06:50 +0000)]
Move the check that gives functions with unique-external types unique-external
linkage into Decl.cpp.  Disable this logic for extern "C" functions, because
the operative rule there is weaker.  Fixes rdar://problem/8898466

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

13 years agoRun ~GRState() when reclaiming GRStates.
Ted Kremenek [Thu, 10 Feb 2011 03:07:40 +0000 (03:07 +0000)]
Run ~GRState() when reclaiming GRStates.

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

13 years agostatic analyzer: Make GRStates reference counted, with reference counts managed by...
Ted Kremenek [Thu, 10 Feb 2011 02:21:52 +0000 (02:21 +0000)]
static analyzer: Make GRStates reference counted, with reference counts managed by ExplodedNodes.

This reduces memory usage of the analyzer on sqlite by another 5%.

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

13 years agoAdd hack to CMakeLists.txt so that StaticAnalyzer libraries find their corresponding...
Ted Kremenek [Thu, 10 Feb 2011 01:03:09 +0000 (01:03 +0000)]
Add hack to CMakeLists.txt so that StaticAnalyzer libraries find their corresponding headers.

This is a hack because we really should only search in the 'include/clang/StaticAnalyzer' directory
if we are in 'lib/StaticAnalyzer'.  My CMake knowledge is limited, so I appeal to anyone with
more expertise.

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

13 years agoSplit 'include/clang/StaticAnalyzer' into 'include/clang/StaticAnalyzer/Core' and...
Ted Kremenek [Thu, 10 Feb 2011 01:03:03 +0000 (01:03 +0000)]
Split 'include/clang/StaticAnalyzer' into 'include/clang/StaticAnalyzer/Core' and 'include/clang/StaticAnalyzer/Checkers'.

This layout matches lib/StaticAnalyzer, which corresponds to two StaticAnalyzer libraries.

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

13 years agoIf an aggregate is returned as 'sret' argument then let debugger know about this.
Devang Patel [Thu, 10 Feb 2011 00:40:52 +0000 (00:40 +0000)]
If an aggregate is returned as 'sret' argument then let debugger know about this.

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

13 years agoUpdate clang-wpa to pass extra argument to AnalysisManager constructor.
Ted Kremenek [Wed, 9 Feb 2011 22:59:20 +0000 (22:59 +0000)]
Update clang-wpa to pass extra argument to AnalysisManager constructor.

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

13 years agoAdd target triple.
Devang Patel [Wed, 9 Feb 2011 22:29:15 +0000 (22:29 +0000)]
Add target triple.

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

13 years agoFix scoping of method declarations and issue
Fariborz Jahanian [Wed, 9 Feb 2011 22:20:01 +0000 (22:20 +0000)]
Fix scoping of method declarations and issue
warning when same parameter name used multiple times.
// rdar://8877730

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

13 years agoParse: add support for parsing CUDA kernel calls
Peter Collingbourne [Wed, 9 Feb 2011 21:12:02 +0000 (21:12 +0000)]
Parse: add support for parsing CUDA kernel calls

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

13 years agoLexer: add CUDA kernel call tokens
Peter Collingbourne [Wed, 9 Feb 2011 21:08:21 +0000 (21:08 +0000)]
Lexer: add CUDA kernel call tokens

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