Commit Graph

7240 Commits

Author SHA1 Message Date
Dan Gohman 74e3eb49ea Update for raw_fd_ostream API changes. raw_fd_ostream now has a
Force flag to control whether the case of opening an existing
file is considered an error.

llvm-svn: 75802
2009-07-15 17:32:18 +00:00
Daniel Dunbar 3d038dd33d [llvm up] Switch to using the new TargetRegistry.
llvm-svn: 75764
2009-07-15 09:43:46 +00:00
Zhongxing Xu 69cc15e97f Delete extra whitespaces.
llvm-svn: 75761
2009-07-15 09:04:01 +00:00
Zhongxing Xu a5da8d25b7 rewrite the logic to make it follow the comments more closely.
llvm-svn: 75750
2009-07-15 06:21:18 +00:00
Ted Kremenek 4802955b84 Enhance RegionStore's reasoning about Objective-C ivars. More testing to follow.
llvm-svn: 75748
2009-07-15 06:09:28 +00:00
Zhongxing Xu b5bf7ee393 Use utility method.
llvm-svn: 75745
2009-07-15 05:09:24 +00:00
Zhongxing Xu 12b1d137c2 Add getName() method to Entity.
llvm-svn: 75740
2009-07-15 04:39:21 +00:00
Ted Kremenek 57fa7e3cc8 Relax assertion.
llvm-svn: 75738
2009-07-15 04:23:32 +00:00
Ted Kremenek e6fea68c46 More test cases revealed that the logic in StoreManager::InvalidateRegion() needs more finesse when handling the invalidation of pointers. Pointers that were invalidated as integers could later cause problems for clients using them as pointers. It is easier for us to model a symbolic value as a pointer rather than modeling a non-symbolic value as a pointer.
This patch causes:
- StoreManager::InvalidateRegion() to not used the casted type of a region if
  it would cause a pointer type to be invalidated as a non-pointer type.
- Pushes RegionStore::RetrieveElement() further by handling retrievals from
  symbolic arrays that have been invalidated.  This uses the new SymbolDerived
  construct that was recently introduced.
  
The result is that the failing test in misc-ps-region-store-x86_64.m now passes.
Both misc-ps-region-store-x86_64.m and misc-ps-region-store-i386.m contain a
test case that motivated this change.

llvm-svn: 75730
2009-07-15 02:31:43 +00:00
Ted Kremenek c6c2157836 Introduced the notion of a "derived symbol" using the class SymbolDerived.
SymbolDerived allows us to model symbolic values that are related to other
symbols via a region hierarchy. For example, SymbolDerived can be used to model
individual values of a symbolic array.

llvm-svn: 75728
2009-07-15 02:27:32 +00:00
Ted Kremenek e5d2f79876 Handle cast of 'ObjCObjectRegion' in StoreManager::InvalidateRegion.
llvm-svn: 75713
2009-07-14 23:52:07 +00:00
Fariborz Jahanian dfbd05d8aa Added a FIXME and prevent crash when listing
a dependent type in the ctor initializer-list.

llvm-svn: 75712
2009-07-14 23:41:35 +00:00
Owen Anderson 170229f68d Update for LLVM API change, and contextify a bunch of related stuff.
llvm-svn: 75705
2009-07-14 23:10:40 +00:00
Fariborz Jahanian 5da7ecb245 Fixed a bug in building ctor-initializer AST.
llvm-svn: 75692
2009-07-14 22:40:50 +00:00
Eli Friedman bb0d9a5129 Remove -ftraditional option, which gcc doesn't actually support. Make
using -traditional and -traditional-cpp with clang an error because 
it's unsupported in clang and causes a significant change in the 
semantics of the language.

llvm-svn: 75690
2009-07-14 21:58:17 +00:00
Devang Patel 9be7b20401 Revert 75648 for now. It is causing test failures.
llvm-svn: 75684
2009-07-14 21:31:22 +00:00
Ted Kremenek 0c37d19fea Enhance RegionStoreManager to handle 'Retrieve's from SymbolicRegions. We do this by silently wrapping the region with an ElementRegion. This fixes the failures in misc-ps-region-store.m.
llvm-svn: 75679
2009-07-14 20:48:22 +00:00
Chris Lattner 156817705e fix fallout of the LLVM codegen switching to formatted_raw_ostream.
llvm-svn: 75675
2009-07-14 20:39:15 +00:00
Ted Kremenek e2fb3ce385 Tweak pretty-printing of CompoundVal to make it more useful for debugging.
llvm-svn: 75672
2009-07-14 20:21:36 +00:00
Fariborz Jahanian 06b2374504 Build AST for default ctor-initializer when constructor has
out of line definition.

llvm-svn: 75668
2009-07-14 20:06:22 +00:00
Fariborz Jahanian c75e143709 Support data members of array type in default
ctor-initializer AST build.

llvm-svn: 75662
2009-07-14 18:56:31 +00:00
Fariborz Jahanian 6dc0284cff Moved a FIXME to where it was meant to be.
llvm-svn: 75651
2009-07-14 18:29:14 +00:00
Steve Naroff 6b712a7ba1 Introduce Type::isAnyPointerType() and convert all clients (suggested by Chris).
I don't love the name, however it simplifies the code and is a worthwhile change. If/when we come up with a better name, we can do a search/replace.

llvm-svn: 75650
2009-07-14 18:25:06 +00:00
Fariborz Jahanian 49c81799b0 Patch to build AST for ctor's initializer list according to
semantics of order of construction [class.init].

llvm-svn: 75649
2009-07-14 18:24:21 +00:00
Chris Lattner ff1ee0d7c9 [llvm up] adjust to match mainline.
llvm-svn: 75647
2009-07-14 18:18:16 +00:00
Anders Carlsson 466fd0a16d Rename RecordLayout.h to ASTRecordLayout.h
llvm-svn: 75641
2009-07-14 17:29:11 +00:00
Daniel Dunbar 88719a1dd6 Revert r75614 which depend on r75610 (for LLVM), which was reverted.
--- Reverse-merging r75614 into '.':
U    lib/CodeGen/CGDebugInfo.cpp

llvm-svn: 75639
2009-07-14 16:40:28 +00:00
Steve Naroff 5ec6ff7678 Add a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella.
Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary).
llvm-svn: 75635
2009-07-14 14:58:18 +00:00
Alisdair Meredith ed28f6e433 Fix the build
llvm-svn: 75627
2009-07-14 08:10:06 +00:00
Alisdair Meredith a9ad47d94c Basic support for C++0x unicode types. Support for literals will follow in an incremental patch
llvm-svn: 75622
2009-07-14 06:30:34 +00:00
Chris Lattner 74d3c61532 use new name for method.
llvm-svn: 75614
2009-07-14 06:16:43 +00:00
Argyrios Kyrtzidis b0c86d4fe8 In Stmt::printPretty(), pass the SourceManager to dump().
llvm-svn: 75606
2009-07-14 03:20:38 +00:00
Argyrios Kyrtzidis 1506d9bc25 Introduce redecl_iterator, used for iterating over the redeclarations of a FunctionDecl or VarDecl.
It iterates over all the redeclarations, regardless of the starting point. For example:

1) int f();
2) int f();
3) int f();

if you have the (2) FunctionDecl and call redecls_begin/redecls_end to iterate, you'll get this sequence:
(2)
(1)
(3)

The motivation to introduce this was that, previously, if (3) was a function definition,
and you called getBody() at (2), it would not return it, since getBody() iterated over the previous declarations only,
so it would only check (2) and (1).

llvm-svn: 75604
2009-07-14 03:20:21 +00:00
Argyrios Kyrtzidis 0736c5ca3b Introduce FunctionDecl::getLatestDeclaration() and VarDecl::getLatestDeclaration().
For multiple redeclarations they return the last one.

Also, add some non const versions of methods.

llvm-svn: 75603
2009-07-14 03:20:08 +00:00
Argyrios Kyrtzidis ef17c07bf6 Introduce FunctionDecl::getFirstDeclaration() and VarDecl::getFirstDeclaration().
For multiple redeclarations they return the first one.

llvm-svn: 75602
2009-07-14 03:19:57 +00:00
Argyrios Kyrtzidis ef1c1e572c For C++ overloaded operator calls, set the source location of the DeclRefExpr to the location of the operator.
llvm-svn: 75600
2009-07-14 03:19:38 +00:00
Argyrios Kyrtzidis eeaaead736 Read/write a CXXOperatorCallExpr from/to PCH files.
llvm-svn: 75598
2009-07-14 03:19:21 +00:00
Argyrios Kyrtzidis 11a846ab53 Fixes for a couple of things:
- Declaration context of ParmVarDecls (that we got from the Declarator) was not their containing function.
- C++ out-of-line method definitions didn't get an access specifier.

Both were exposed by a crash when emitting a C++ method to a PCH file (assert at Decl::CheckAccessDeclContext()).

llvm-svn: 75597
2009-07-14 03:18:53 +00:00
Argyrios Kyrtzidis 307b0717f7 In ResolveLocationInAST, handle locations that are inside TagDecl definitions.
llvm-svn: 75594
2009-07-14 03:18:17 +00:00
Argyrios Kyrtzidis a28d145cbb In DeclReferenceMap, map FieldDecls to the MemberExprs that reference them.
llvm-svn: 75593
2009-07-14 03:18:09 +00:00
Argyrios Kyrtzidis 664b690107 Read/write TagDecl's RBraceLoc from/to PCH files.
llvm-svn: 75592
2009-07-14 03:18:02 +00:00
Argyrios Kyrtzidis 23e1f1d6be Pass the right brace SourceLocation from the Parser to the TagDecls.
llvm-svn: 75591
2009-07-14 03:17:52 +00:00
Argyrios Kyrtzidis 575fa05991 Add the SourceLocation for the right brace in TagDecl.
llvm-svn: 75590
2009-07-14 03:17:17 +00:00
Devang Patel d6c256696b Use LLVM mangler to get mangled name for debug info entry.
llvm-svn: 75589
2009-07-14 02:47:58 +00:00
Daniel Dunbar f5c79709bc Update debug info generation for ObjCObjectPointer changes.
- Previously this would crash on recursive types, and it was also incorrectly
   stripping off a level of indirection.
 - I'm not 100% convinced this is all correct, but it should be a monotonic
   improvment.

llvm-svn: 75582
2009-07-14 01:20:56 +00:00
Zhongxing Xu 170e816eff Instead of recovering from a wrong invalidation, this patch aims to
invalidate the region correctly. It uses the cast-to type to invalidate 
the region when available. To avoid invalid cast-to type like 'void*' or 'id',
region store now only records non-generic casts of regions.

llvm-svn: 75580
2009-07-14 01:12:46 +00:00
Ted Kremenek c057f417d8 Add basic checking for passing NULL to CFRetain/CFRelease, since those functions
are not explicitly marked as not accepting NULL pointers. This check illustrates
how we need more refactoring in the custom-check logic.

llvm-svn: 75570
2009-07-14 00:43:42 +00:00
Owen Anderson 2571eb6453 Update for API change.
llvm-svn: 75569
2009-07-14 00:38:16 +00:00
Ted Kremenek a6904ff7f9 Tidy pretty-printing for SVals, using 'dump()' instead of 'printStdErr()', and implementing operator<< support for llvm::raw_ostream.
llvm-svn: 75560
2009-07-13 23:53:06 +00:00
Ted Kremenek c8d6746c39 When pretty-printing symbolic regions, use '{' ... '}' to indicate the symbol used for the region (makes it easier to read for nested regions).
llvm-svn: 75550
2009-07-13 23:38:57 +00:00