Граф коммитов

13325 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 741dd9a7e1 Add the location of the tag keyword into TagDecl. From Enea
Zaffanella, with tweaks from Abramo Bagnara.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 14:46:17 +00:00
Duncan Sands 98f2cca4b2 Disambiguate an if statement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 07:56:29 +00:00
Argyrios Kyrtzidis 4c7c5a1d01 Remove the ASTContext parameter from Entity::getPrintableName().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 07:52:21 +00:00
Argyrios Kyrtzidis 2bcb3439b5 Add an assert for safety check.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 06:48:06 +00:00
Argyrios Kyrtzidis f37006bc8a Fix a crash that occurs in this C++ case:
struct foo {
  static bool value;
};
bool (foo::value); // crash because of parens

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 06:43:26 +00:00
Owen Anderson f48880ad89 Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76534 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 02:57:15 +00:00
Argyrios Kyrtzidis 1f717270d0 Keep only canonical Decls in Entities.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 02:10:32 +00:00
Mike Stump 22cd658118 Wire up CFG improvements for __builtin_choose_expr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76531 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 01:46:17 +00:00
Mike Stump 8f9893a2be Wire up CFG improvements for do { } while () when the condition is known.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 01:27:50 +00:00
Mike Stump fefb9f7009 Wire up for statement CFG improvements for conditionals that are known.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 01:12:51 +00:00
Mike Stump 5f20363dc8 Wire up CFG improvements for while when the condition is known.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 00:38:52 +00:00
Argyrios Kyrtzidis 6133c12166 Remove a file from the test directory that was added by mistake.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76518 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 00:17:57 +00:00
Ted Kremenek 9031dd7a98 RegionStore:
-refactor logic for retrieving bindings from VarDecls into
 RegionStoreManager::RetrieveVar()
- improve RegionStoreManager::CastRetrievedVal() and SimpleSValuate::EvalCastNL
  to better handle casts of values of the same canonical type as well as
  casts of LocAsInteger values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 00:12:07 +00:00
Argyrios Kyrtzidis f7cf15ca3c Change the semantics for Entity.
Entity can now refer to declarations that are not visible outside the translation unit.
It is a wrapper of a pointer union, it's either a Decl* for declarations that don't
"cross" translation units, or an EntityImpl* which is associated with the specific "visible" Decl.

Included is a test case for handling fields across translation units.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76515 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 00:07:06 +00:00
Ryan Flynn 07ef804f91 define __STDC_VERSION__ processor token for c94
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76514 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 00:07:02 +00:00
Argyrios Kyrtzidis 3e8efd9801 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
2009-07-21 00:06:46 +00:00
Argyrios Kyrtzidis 57ea6bee79 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
2009-07-21 00:06:36 +00:00
Argyrios Kyrtzidis 22cbd2b794 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
2009-07-21 00:06:27 +00:00
Argyrios Kyrtzidis 1cb35dd484 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
2009-07-21 00:06:20 +00:00
Argyrios Kyrtzidis 87018775ed 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
2009-07-21 00:06:04 +00:00
Argyrios Kyrtzidis 8a1d722f13 - 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
2009-07-21 00:05:53 +00:00
Argyrios Kyrtzidis 80ede1d714 Handle references from ObjCIvarRefExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76507 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 00:05:38 +00:00
Argyrios Kyrtzidis ec930d3d81 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
2009-07-21 00:05:10 +00:00
Mike Stump e5af3ce53e 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
2009-07-20 23:24:15 +00:00
Fariborz Jahanian e7d346b6d5 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
2009-07-20 23:18:55 +00:00
Ted Kremenek 25c545788d 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
2009-07-20 22:58:02 +00:00
Fariborz Jahanian 76ed9cb1d7 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
2009-07-20 22:41:12 +00:00
Fariborz Jahanian ab3c0a2c87 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
2009-07-20 22:35:22 +00:00
Douglas Gregor 75f1af0209 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
2009-07-20 22:03:28 +00:00
Ted Kremenek ba02486ef0 This test now passes with RegionStore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 21:44:10 +00:00
Ted Kremenek bc59aa57c5 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
2009-07-20 21:43:20 +00:00
Ted Kremenek dd6611426b 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
2009-07-20 21:39:27 +00:00
Mike Stump 02f43e7112 Remove an apparently unused forward class decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76476 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 21:23:55 +00:00
Mike Stump 5ac2323dec Remove an apparently unused header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 21:17:53 +00:00
Ted Kremenek 293769a1f2 Add XFAILED test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 21:00:55 +00:00
Ted Kremenek 1ff8339966 Add FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 20:38:59 +00:00
Douglas Gregor ec820c6bc4 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
2009-07-20 18:55:14 +00:00
Ted Kremenek 0b5a07d3a0 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
2009-07-20 18:52:34 +00:00
Douglas Gregor ec8b59ffc3 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
2009-07-20 18:46:59 +00:00
Ted Kremenek 520035439d 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
2009-07-20 18:44:36 +00:00
Steve Naroff 67ef8eaea8 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
2009-07-20 17:56:53 +00:00
Fariborz Jahanian d33c868d38 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
2009-07-20 17:43:15 +00:00
Zhongxing Xu 89021b0c71 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
2009-07-20 08:28:49 +00:00
Ted Kremenek b27ed3d731 Implement FIXME in pretty-printing for StringRegions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76381 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-19 20:38:24 +00:00
Ted Kremenek bcfe03a0be Improve debug pretty-printing for ObjCIVarRegions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76380 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-19 20:36:24 +00:00
Chris Lattner be6d259a37 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
2009-07-19 20:17:11 +00:00
Daniel Dunbar 96e18b05ea 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
2009-07-19 08:24:34 +00:00
Daniel Dunbar cd5e60e1d4 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
2009-07-19 08:23:12 +00:00
Daniel Dunbar 25b6ebf0f8 Fix thinko.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-19 07:03:11 +00:00
Daniel Dunbar d286f05f12 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
2009-07-19 06:58:07 +00:00