]> granicus.if.org Git - clang/log
clang
15 years agodefine __STDC_VERSION__ processor token for c94
Ryan Flynn [Tue, 21 Jul 2009 00:07:02 +0000 (00:07 +0000)]
define __STDC_VERSION__ processor token for c94

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

15 years agoUse temporary output to avoid running index-test with the same commands multiple...
Argyrios Kyrtzidis [Tue, 21 Jul 2009 00:06:46 +0000 (00:06 +0000)]
Use temporary output to avoid running index-test with the same commands multiple times.

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

15 years agoImplement the virtual getNextRedeclaration() for ObjCMethodDecl.
Argyrios Kyrtzidis [Tue, 21 Jul 2009 00:06:36 +0000 (00:06 +0000)]
Implement the virtual getNextRedeclaration() for ObjCMethodDecl.

If it's in an ObjCContainerDecl, its "redeclaration" is the method definition in the corresponding ObjCImplDecl.
If it's in an ObjCImplDecl, its "redeclaration" is the method in the interface.

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

15 years agoAdd an assertion for the return value of Decl::getNextRedeclaration().
Argyrios Kyrtzidis [Tue, 21 Jul 2009 00:06:27 +0000 (00:06 +0000)]
Add an assertion for the return value of Decl::getNextRedeclaration().

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

15 years agoRemove the ObjCCategoryImpls vector from Sema class.
Argyrios Kyrtzidis [Tue, 21 Jul 2009 00:06:20 +0000 (00:06 +0000)]
Remove the ObjCCategoryImpls vector from Sema class.
Use ObjCInterfaceDecl::getCategoryClassMethod() and ObjCInterfaceDecl::getCategoryInstanceMethod() for the same functionality.

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

15 years agoRemove Sema::LookupObjCImplementation and replace it with just calling ObjCInterfaceD...
Argyrios Kyrtzidis [Tue, 21 Jul 2009 00:06:04 +0000 (00:06 +0000)]
Remove Sema::LookupObjCImplementation and replace it with just calling ObjCInterfaceDecl::getImplementation().

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

15 years ago- Introduce ASTContext::getObjCImplementation() and ASTContext::setObjCImplementation...
Argyrios Kyrtzidis [Tue, 21 Jul 2009 00:05:53 +0000 (00:05 +0000)]
- Introduce ASTContext::getObjCImplementation() and ASTContext::setObjCImplementation() which use a DenseMap to associate
  an interface/category with its implementation (if one exists).

- Introduce ObjCInterfaceDecl::get/setImplementation() and ObjCCategoryDecl::get/setImplementation() that use the above methods.

- Add a compiler error for when a category is reimplemented.

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

15 years agoHandle references from ObjCIvarRefExprs.
Argyrios Kyrtzidis [Tue, 21 Jul 2009 00:05:38 +0000 (00:05 +0000)]
Handle references from ObjCIvarRefExprs.

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

15 years agoAdd '\n' to the end of error message.
Argyrios Kyrtzidis [Tue, 21 Jul 2009 00:05:10 +0000 (00:05 +0000)]
Add '\n' to the end of error message.

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

15 years agoAdd yet more analysis for CFGs involving conditionals that are actually constant.
Mike Stump [Mon, 20 Jul 2009 23:24:15 +0000 (23:24 +0000)]
Add yet more analysis for CFGs involving conditionals that are actually constant.

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

15 years agoMove EmitCtorPrologue to CGCXX. Add an assert and FIXMEs.
Fariborz Jahanian [Mon, 20 Jul 2009 23:18:55 +0000 (23:18 +0000)]
Move EmitCtorPrologue to CGCXX. Add an assert and FIXMEs.

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

15 years agoEnhanced IsReinterpreted() (RegionStore.cpp) to reason about higher-order
Ted Kremenek [Mon, 20 Jul 2009 22:58:02 +0000 (22:58 +0000)]
Enhanced IsReinterpreted() (RegionStore.cpp) to reason about higher-order
pointers.

Enhanced RegionStoreManager::Retrieve() to handle automatic casts when the
loaded value is different from the requested value. This should be refined over
time, but essentially we should always symbolicate locations as locations, and
convert them to non-locations on demand.

These changes now cause 'misc-ps.m' to pass again.

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

15 years agoImprove message for bad destructor decl. Per Doug's comment.
Fariborz Jahanian [Mon, 20 Jul 2009 22:41:12 +0000 (22:41 +0000)]
Improve message for bad destructor decl. Per Doug's comment.

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

15 years agoEarly ir-gen for constructor prologue. This is on going.
Fariborz Jahanian [Mon, 20 Jul 2009 22:35:22 +0000 (22:35 +0000)]
Early ir-gen for constructor prologue. This is on going.

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

15 years agoReuse VarDecl::Init to store the default argument of a ParmVarDecl,
Douglas Gregor [Mon, 20 Jul 2009 22:03:28 +0000 (22:03 +0000)]
Reuse VarDecl::Init to store the default argument of a ParmVarDecl,
reducing the size of ParmVarDecl by one pointer. Also means that we'll
properly (de-)serialize default arguments in C++ PCH files.

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

15 years agoThis test now passes with RegionStore.
Ted Kremenek [Mon, 20 Jul 2009 21:44:10 +0000 (21:44 +0000)]
This test now passes with RegionStore.

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

15 years agoEnhance GRExprEngine::EvalBind to handle some implicit casts from nonlocs to
Ted Kremenek [Mon, 20 Jul 2009 21:43:20 +0000 (21:43 +0000)]
Enhance GRExprEngine::EvalBind to handle some implicit casts from nonlocs to
locs and vis versa.

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

15 years agoEnhance SimpleSValuator to handle nonloc::LocAsInteger -> location casts.
Ted Kremenek [Mon, 20 Jul 2009 21:39:27 +0000 (21:39 +0000)]
Enhance SimpleSValuator to handle nonloc::LocAsInteger -> location casts.

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

15 years agoRemove an apparently unused forward class decl.
Mike Stump [Mon, 20 Jul 2009 21:23:55 +0000 (21:23 +0000)]
Remove an apparently unused forward class decl.

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

15 years agoRemove an apparently unused header.
Mike Stump [Mon, 20 Jul 2009 21:17:53 +0000 (21:17 +0000)]
Remove an apparently unused header.

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

15 years agoAdd XFAILED test.
Ted Kremenek [Mon, 20 Jul 2009 21:00:55 +0000 (21:00 +0000)]
Add XFAILED test.

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

15 years agoAdd FIXME.
Ted Kremenek [Mon, 20 Jul 2009 20:38:59 +0000 (20:38 +0000)]
Add FIXME.

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

15 years agoWhen a field is variable-sized or is an array with a negative size,
Douglas Gregor [Mon, 20 Jul 2009 18:55:14 +0000 (18:55 +0000)]
When a field is variable-sized or is an array with a negative size,
don't replace the type of the field with 'int', from Enea Zaffanella!

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

15 years agoUpdate DataflowSolver to handle the case where a successor/predecessor block
Ted Kremenek [Mon, 20 Jul 2009 18:52:34 +0000 (18:52 +0000)]
Update DataflowSolver to handle the case where a successor/predecessor block
could be NULL. This allows the solver to handle optimized CFGs where branches
can be determined during CFG-construction to be infeasible.

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

15 years agoImprove GCC compatibility by allowing static tentative definitions of
Douglas Gregor [Mon, 20 Jul 2009 18:46:59 +0000 (18:46 +0000)]
Improve GCC compatibility by allowing static tentative definitions of
incomplete type (with a warning), from Enea Zaffanella!

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

15 years agoEnhance GRBranchNodeBuilderImpl (part of GRCoreEngine) to understand the case
Ted Kremenek [Mon, 20 Jul 2009 18:44:36 +0000 (18:44 +0000)]
Enhance GRBranchNodeBuilderImpl (part of GRCoreEngine) to understand the case
where the true or false CFGBlock* for a branch could be NULL. This will handle
the case where we can determine during CFG construction that a branch is
infeasible.

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

15 years ago5 cleanups to ObjCObjectPointerType work:
Steve Naroff [Mon, 20 Jul 2009 17:56:53 +0000 (17:56 +0000)]
5 cleanups to ObjCObjectPointerType work:

- Remove Sema::CheckPointeeTypesForAssignment(), a temporary API I added to ease migration to ObjCObjectPointerType. Convert Sema::CheckAssignmentConstraints() to no longer depend on the temporary API.
- Sema::ConvertDeclSpecToType(): Replace a couple FIXME's with an important comment/example.
- Sema::GetTypeForDeclarator(): Get the protocol's from the interface, NOT the declspec (to support the following C typedef idiom: "typedef C<P> T; T *obj").
- Sema::ObjCQualifiedIdTypesAreCompatible(): Removed some dead code.
- ASTContext::getObjCEncodingForTypeImpl(): Some minor cleanups.

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

15 years agoIssue a more descriptive diagnostics when mis-declaring
Fariborz Jahanian [Mon, 20 Jul 2009 17:43:15 +0000 (17:43 +0000)]
Issue a more descriptive diagnostics when mis-declaring
a destructor.

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

15 years agoThe children statements might be NULL. Check for this case in
Zhongxing Xu [Mon, 20 Jul 2009 08:28:49 +0000 (08:28 +0000)]
The children statements might be NULL. Check for this case in
isContainedInStatement().

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

15 years agoImplement FIXME in pretty-printing for StringRegions.
Ted Kremenek [Sun, 19 Jul 2009 20:38:24 +0000 (20:38 +0000)]
Implement FIXME in pretty-printing for StringRegions.

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

15 years agoImprove debug pretty-printing for ObjCIVarRegions.
Ted Kremenek [Sun, 19 Jul 2009 20:36:24 +0000 (20:36 +0000)]
Improve debug pretty-printing for ObjCIVarRegions.

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

15 years agoenhance the goto checker to reject jumps across __block variable definitions.
Chris Lattner [Sun, 19 Jul 2009 20:17:11 +0000 (20:17 +0000)]
enhance the goto checker to reject jumps across __block variable definitions.

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

15 years agoCatch another trivial case where we can avoid emitting a separate return blcok.
Daniel Dunbar [Sun, 19 Jul 2009 08:24:34 +0000 (08:24 +0000)]
Catch another trivial case where we can avoid emitting a separate return blcok.

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

15 years agoDetect when the current generation point is unreachable after emitting
Daniel Dunbar [Sun, 19 Jul 2009 08:23:12 +0000 (08:23 +0000)]
Detect when the current generation point is unreachable after emitting
expressions.
 - This generally catches the important case of noreturn functions.

 - With the last two changes, we are down to 152 unreachable blocks emitted on
   403.gcc, vs the 1805 we started with.

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

15 years agoFix thinko.
Daniel Dunbar [Sun, 19 Jul 2009 07:03:11 +0000 (07:03 +0000)]
Fix thinko.

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

15 years agoAvoid generation of dead code in a few more situations.
Daniel Dunbar [Sun, 19 Jul 2009 06:58:07 +0000 (06:58 +0000)]
Avoid generation of dead code in a few more situations.
 - Emit variable declarations as "simple", we want to avoid forcing the creation
   of a dummy basic block, but still need to make the variable available for
   later use.

 - With that, we can now skip IRgen for other unreachable statements (which
   don't define a label).

 - Anders, I added two fixmes on calls to EmitVLASize, can you check them?

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

15 years agoAdd include needed for MSVC.
Daniel Dunbar [Sun, 19 Jul 2009 02:17:34 +0000 (02:17 +0000)]
Add include needed for MSVC.

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

15 years agoUpdate CMake
Daniel Dunbar [Sun, 19 Jul 2009 00:40:45 +0000 (00:40 +0000)]
Update CMake

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

15 years agoHandle layout of non-virtual base classes.
Anders Carlsson [Sun, 19 Jul 2009 00:18:47 +0000 (00:18 +0000)]
Handle layout of non-virtual base classes.

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

15 years agoRefactor field layout into a separate function.
Anders Carlsson [Sat, 18 Jul 2009 21:48:39 +0000 (21:48 +0000)]
Refactor field layout into a separate function.

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

15 years agoRename NextOffset to DataSize, which better matches the Itanium C++ ABI
Anders Carlsson [Sat, 18 Jul 2009 21:26:44 +0000 (21:26 +0000)]
Rename NextOffset to DataSize, which better matches the Itanium C++ ABI

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

15 years agoMigrate over to the record layout builder.
Anders Carlsson [Sat, 18 Jul 2009 21:19:52 +0000 (21:19 +0000)]
Migrate over to the record layout builder.

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

15 years agoRe-enable 'test/SemaTemplate/temp_class_spec_neg.cpp', after commenting out the cause...
Argyrios Kyrtzidis [Sat, 18 Jul 2009 21:18:10 +0000 (21:18 +0000)]
Re-enable 'test/SemaTemplate/temp_class_spec_neg.cpp', after commenting out the cause of the crash.

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

15 years agoIntroduce ASTLocation::getReferencedDecl(), for getting the declaration that the...
Argyrios Kyrtzidis [Sat, 18 Jul 2009 21:17:58 +0000 (21:17 +0000)]
Introduce ASTLocation::getReferencedDecl(), for getting the declaration that the ASTLocation references.

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

15 years agoHandle invalid ASTLocations instead of asserting.
Argyrios Kyrtzidis [Sat, 18 Jul 2009 21:17:43 +0000 (21:17 +0000)]
Handle invalid ASTLocations instead of asserting.

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

15 years agoMore layout builder work.
Anders Carlsson [Sat, 18 Jul 2009 20:50:59 +0000 (20:50 +0000)]
More layout builder work.

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

15 years agoAdd a new ASTRecordLayoutBuilder class. Not used yet.
Anders Carlsson [Sat, 18 Jul 2009 20:20:21 +0000 (20:20 +0000)]
Add a new ASTRecordLayoutBuilder class. Not used yet.

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

15 years agoDisable this test for now, it has been crashing on linux for weeks.
Daniel Dunbar [Sat, 18 Jul 2009 19:55:20 +0000 (19:55 +0000)]
Disable this test for now, it has been crashing on linux for weeks.

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

15 years agoRevert r75641.
Anders Carlsson [Sat, 18 Jul 2009 19:43:29 +0000 (19:43 +0000)]
Revert r75641.

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

15 years agoFix typo from r76321.
Steve Naroff [Sat, 18 Jul 2009 15:38:31 +0000 (15:38 +0000)]
Fix typo from r76321.

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

15 years agoRemove ObjCQualifiedInterfaceType:-)
Steve Naroff [Sat, 18 Jul 2009 15:33:26 +0000 (15:33 +0000)]
Remove ObjCQualifiedInterfaceType:-)

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

15 years agoFix RUN line to not litter the test directory.
Sebastian Redl [Sat, 18 Jul 2009 15:13:36 +0000 (15:13 +0000)]
Fix RUN line to not litter the test directory.

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

15 years agosvn:ignore the build directories
Sebastian Redl [Sat, 18 Jul 2009 15:09:16 +0000 (15:09 +0000)]
svn:ignore the build directories

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

15 years agoRename file in preparation of properly implementing C-style casts in C++.
Sebastian Redl [Sat, 18 Jul 2009 15:08:18 +0000 (15:08 +0000)]
Rename file in preparation of properly implementing C-style casts in C++.

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

15 years agoEnhance testing of overriding exception specs for inaccessible base exceptions.
Sebastian Redl [Sat, 18 Jul 2009 14:32:15 +0000 (14:32 +0000)]
Enhance testing of overriding exception specs for inaccessible base exceptions.

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

15 years agoFix a comment.
Zhongxing Xu [Sat, 18 Jul 2009 09:26:51 +0000 (09:26 +0000)]
Fix a comment.

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

15 years agoFix a comment.
Argyrios Kyrtzidis [Sat, 18 Jul 2009 08:50:48 +0000 (08:50 +0000)]
Fix a comment.

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

15 years agoIntroduce a redecl_iterator in Decl class, so that we can do a "iterate over all...
Argyrios Kyrtzidis [Sat, 18 Jul 2009 08:50:35 +0000 (08:50 +0000)]
Introduce a redecl_iterator in Decl class, so that we can do a "iterate over all declarations of the same decl" without knowing the exact type.

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

15 years agoIntroduce the Redeclarable template class, which serves as a base type defining the...
Argyrios Kyrtzidis [Sat, 18 Jul 2009 08:50:13 +0000 (08:50 +0000)]
Introduce the Redeclarable template class, which serves as a base type defining the common interface for Decls that can be redeclared.
Make FunctionDecl and VarDecl use it.

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

15 years agoRemove StmtLocResolver::VisitObjCIvarRefExpr, it was only there to avoid returning...
Argyrios Kyrtzidis [Sat, 18 Jul 2009 08:49:56 +0000 (08:49 +0000)]
Remove StmtLocResolver::VisitObjCIvarRefExpr, it was only there to avoid returning an implicit 'self' instead of the ivar.
Since implicit 'self' no longer has a source location, it's not needed. (plus we also want to check for a 'self' that is visible in source code)

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

15 years agoDon't add a SourceLocation for 'self' if it does not actually appears in the source...
Argyrios Kyrtzidis [Sat, 18 Jul 2009 08:49:37 +0000 (08:49 +0000)]
Don't add a SourceLocation for 'self' if it does not actually appears in the source code.

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

15 years agoReplace stmt visitors with the fall back method.
Zhongxing Xu [Sat, 18 Jul 2009 08:49:07 +0000 (08:49 +0000)]
Replace stmt visitors with the fall back method.

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

15 years agoFix crash in StoreManager::NewCastRegion() when handling casts from 'id' (or whatever...
Ted Kremenek [Sat, 18 Jul 2009 06:27:51 +0000 (06:27 +0000)]
Fix crash in StoreManager::NewCastRegion() when handling casts from 'id' (or whatever) to a BlockPointerType.

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

15 years agoReturn CodeTextRegions for BlockPointerTypes in addition to FunctionPointerTypes.
Ted Kremenek [Sat, 18 Jul 2009 06:27:01 +0000 (06:27 +0000)]
Return CodeTextRegions for BlockPointerTypes in addition to FunctionPointerTypes.

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

15 years agoAdd test case for bug fix in r76262.
Ted Kremenek [Sat, 18 Jul 2009 05:02:33 +0000 (05:02 +0000)]
Add test case for bug fix in r76262.

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

15 years agoFix some fallout from CFGBuilder restructuring: all expressions that we explicitly...
Ted Kremenek [Sat, 18 Jul 2009 00:47:21 +0000 (00:47 +0000)]
Fix some fallout from CFGBuilder restructuring: all expressions that we explicitly handle have the possibility to be block-level expressions.

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

15 years agoRemove getFirstDeclaration/getLatestDeclaration from FunctionDecl and VarDecl.
Argyrios Kyrtzidis [Sat, 18 Jul 2009 00:34:35 +0000 (00:34 +0000)]
Remove getFirstDeclaration/getLatestDeclaration from FunctionDecl and VarDecl.

Their usefulness is questionable since redecl_iterator was introduced.

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

15 years agoRemove ASTContext::getCanonicalDecl() and use Decl::getCanonicalDecl in its place.
Argyrios Kyrtzidis [Sat, 18 Jul 2009 00:34:25 +0000 (00:34 +0000)]
Remove ASTContext::getCanonicalDecl() and use Decl::getCanonicalDecl in its place.

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

15 years agoMove the functionality of ASTContext::getCanonicalDecl(), into a virtual method Decl...
Argyrios Kyrtzidis [Sat, 18 Jul 2009 00:34:07 +0000 (00:34 +0000)]
Move the functionality of ASTContext::getCanonicalDecl(), into a virtual method Decl::getCanonicalDecl().

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

15 years agoResolve a location that is inside an ObjCMethodDecl.
Argyrios Kyrtzidis [Sat, 18 Jul 2009 00:33:52 +0000 (00:33 +0000)]
Resolve a location that is inside an ObjCMethodDecl.

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

15 years agoMake ASTLocation accept a Stmt that is inside an ObjCMethodDecl.
Argyrios Kyrtzidis [Sat, 18 Jul 2009 00:33:46 +0000 (00:33 +0000)]
Make ASTLocation accept a Stmt that is inside an ObjCMethodDecl.

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

15 years agoSearch through all Decls that are DeclContexts.
Argyrios Kyrtzidis [Sat, 18 Jul 2009 00:33:40 +0000 (00:33 +0000)]
Search through all Decls that are DeclContexts.

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

15 years agoSet ObjCMethodDecl's EndLoc to the '}' when it's a definition.
Argyrios Kyrtzidis [Sat, 18 Jul 2009 00:33:33 +0000 (00:33 +0000)]
Set ObjCMethodDecl's EndLoc to the '}' when it's a definition.

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

15 years agoLocation should be passed to setLocEnd() not to setAtEndLoc() which belongs to ObjCCo...
Argyrios Kyrtzidis [Sat, 18 Jul 2009 00:33:23 +0000 (00:33 +0000)]
Location should be passed to setLocEnd() not to setAtEndLoc() which belongs to ObjCContainerDecl.

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

15 years agoAdd getSourceRange() methods for ObjC Decls.
Argyrios Kyrtzidis [Sat, 18 Jul 2009 00:33:08 +0000 (00:33 +0000)]
Add getSourceRange() methods for ObjC Decls.

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

15 years agofix objc codegen to not have its own list of things that eventually get into llvm...
Chris Lattner [Fri, 17 Jul 2009 23:57:13 +0000 (23:57 +0000)]
fix objc codegen to not have its own list of things that eventually get into llvm.used, just
populate CGM's list directly.

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

15 years agoThis takes a long time to crash, just disable it for now.
Chris Lattner [Fri, 17 Jul 2009 23:48:38 +0000 (23:48 +0000)]
This takes a long time to crash, just disable it for now.

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

15 years agoFix caching bug revealed by analyzing ClamAV using RegionStore.
Ted Kremenek [Fri, 17 Jul 2009 23:48:26 +0000 (23:48 +0000)]
Fix caching bug revealed by analyzing ClamAV using RegionStore.

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

15 years agoFix possible null dereference in CFG construction.
Ted Kremenek [Fri, 17 Jul 2009 22:57:50 +0000 (22:57 +0000)]
Fix possible null dereference in CFG construction.

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

15 years agoRemove bogus check.
Ted Kremenek [Fri, 17 Jul 2009 22:45:54 +0000 (22:45 +0000)]
Remove bogus check.

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

15 years agoAdd error message when clang-cc cannot be found.
Ted Kremenek [Fri, 17 Jul 2009 22:38:26 +0000 (22:38 +0000)]
Add error message when clang-cc cannot be found.

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

15 years agoRestructure CFG builder to have just one visitor path instead of two. The result
Ted Kremenek [Fri, 17 Jul 2009 22:18:43 +0000 (22:18 +0000)]
Restructure CFG builder to have just one visitor path instead of two. The result
is an algorithm that is much easier to understand and slightly more efficient.
Thanks to Mike Stump for our discussions on the CFGBuilder and his comments that
helped prompt this long needed cleanup.

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

15 years agoMove WalkAST logic for 'ChooseExpr' to 'VisitChooseExpr'.
Ted Kremenek [Fri, 17 Jul 2009 18:20:32 +0000 (18:20 +0000)]
Move WalkAST logic for 'ChooseExpr' to 'VisitChooseExpr'.

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

15 years agoMove WalkAST logic for 'ConditionalOperator' into 'VisitConditionalOperator'.
Ted Kremenek [Fri, 17 Jul 2009 18:15:54 +0000 (18:15 +0000)]
Move WalkAST logic for 'ConditionalOperator' into 'VisitConditionalOperator'.

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

15 years agoFix indentation / trailing white space.
Daniel Dunbar [Fri, 17 Jul 2009 18:10:27 +0000 (18:10 +0000)]
Fix indentation / trailing white space.

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

15 years agoRemove stale comments.
Ted Kremenek [Fri, 17 Jul 2009 18:04:55 +0000 (18:04 +0000)]
Remove stale comments.

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

15 years agoPer offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
Ted Kremenek [Fri, 17 Jul 2009 17:50:17 +0000 (17:50 +0000)]
Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.

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

15 years agoclean up this code, add the fixme back.
Chris Lattner [Fri, 17 Jul 2009 15:50:19 +0000 (15:50 +0000)]
clean up this code, add the fixme back.

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

15 years agoobjc methods can't be an operand to callexpr.
Chris Lattner [Fri, 17 Jul 2009 15:46:27 +0000 (15:46 +0000)]
objc methods can't be an operand to callexpr.

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

15 years agoRename Entity::getName() to Entity::getPrintableName() to make its purpose
Zhongxing Xu [Fri, 17 Jul 2009 07:49:44 +0000 (07:49 +0000)]
Rename Entity::getName() to Entity::getPrintableName() to make its purpose
more obvious.

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

15 years agoAs suggested by Argyrios, revert r76159 and make "FindImmediateParent"
Zhongxing Xu [Fri, 17 Jul 2009 07:36:20 +0000 (07:36 +0000)]
As suggested by Argyrios, revert r76159 and make "FindImmediateParent"
a public static method of ASTLocation.

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

15 years agoRefactor code into a new CallExpr::getDirectCallee() method. Simplify some
Zhongxing Xu [Fri, 17 Jul 2009 07:29:51 +0000 (07:29 +0000)]
Refactor code into a new CallExpr::getDirectCallee() method. Simplify some
code with the new method.

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

15 years agoCallGraph: add a bunch of stmt visitors.
Zhongxing Xu [Fri, 17 Jul 2009 07:05:19 +0000 (07:05 +0000)]
CallGraph: add a bunch of stmt visitors.

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

15 years agoRelax the assertion in ASTLocation's ctor: if the decl is not the immediate
Zhongxing Xu [Fri, 17 Jul 2009 06:58:08 +0000 (06:58 +0000)]
Relax the assertion in ASTLocation's ctor: if the decl is not the immediate
parent of the stmt, find the immediate parent for the stmt.

This is because sometimes we cannot get the immediate decl of the stmt when
creating the ASTLocation. We can only get a parent of the stmt.

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

15 years agoCallGraph:
Zhongxing Xu [Fri, 17 Jul 2009 05:49:16 +0000 (05:49 +0000)]
CallGraph:
 - add IfStmt visitor.
 - print information only when a function has callee. Otherwise its ASTContext
   map is NULL.

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

15 years agoFixup indentation of rest of switch statement to match llvm coding
Mike Stump [Fri, 17 Jul 2009 01:31:16 +0000 (01:31 +0000)]
Fixup indentation of rest of switch statement to match llvm coding
conventions.  Also reflowed comments and removed spaces at end of
lines and fixed up 80 col violations.

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

15 years agoReplaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type...
Ted Kremenek [Fri, 17 Jul 2009 01:20:38 +0000 (01:20 +0000)]
Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.

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

15 years agoIf we are not doing a Debug build, no need for the debugging print methods.
Argyrios Kyrtzidis [Fri, 17 Jul 2009 01:20:03 +0000 (01:20 +0000)]
If we are not doing a Debug build, no need for the debugging print methods.

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

15 years agoObjCCategoryImplDecl and ObjCImplementation do not derive directly from DeclContext...
Argyrios Kyrtzidis [Fri, 17 Jul 2009 01:19:49 +0000 (01:19 +0000)]
ObjCCategoryImplDecl and ObjCImplementation do not derive directly from DeclContext but from a new abstract ObjCImplDecl.
Reflect this change on the "DeclContext hierarchy".

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

15 years agoCheck whether the IdentifierInfo is null, before using it.
Argyrios Kyrtzidis [Fri, 17 Jul 2009 01:19:03 +0000 (01:19 +0000)]
Check whether the IdentifierInfo is null, before using it.

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