aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2007-11-23Check asm input and output expressions.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44289 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23Fix PR1820, an incredibly subtle macro expansion bug that Neil discovered.Chris Lattner
Neil, please review this fix. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44285 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-22Store output and input operands as well as clobber information in the ↵Anders Carlsson
AsmStmt. Ted, could you please review the serialization/deserialization code? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44266 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-21GCC fails if there is a trailing colon but no clobbers.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44265 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20Store inline asm code in the AST.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44255 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20Add __builtin_absAnders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44254 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20Improve function decl merging, patch by Oliver Hunt!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44253 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20Added another test case for the Dead Stores checker that tests thatTed Kremenek
block-level expressions are evaluated the same as regular expressions. Test case provided by Nuno Lopes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44247 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20Updated CFGStmtVisitor and CFGRecStmtVisitor to have a notion ofTed Kremenek
"block-expressions" when visiting arbitrary expressions (via calls to "Visit()"). This results in a refactoring where a dataflow analysis no longer needs to always special case when handling block-expressions versus non-block expressions. Updated LiveVariables and UninitializedValues to conform to the slightly altered interface of these visitor classes. Thanks to Nuno Lopes for providing a test case that illustrated some fundamental problems in the current design of the CFGXXXStmtVisitor classes and how they were used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44246 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19Removed PersistentMap. It is now superseded in every way by the ImmutableMapTed Kremenek
and ImmutableSet classes in the main LLVM libraries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44237 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19Added test case for dead stores checker (live variables analysis) that testsTed Kremenek
for correct propagation/update of liveness information within subexpressions of Block-Level expressions. Test case provided by Nuno Lopes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44225 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19Fixed bug where LiveVariables was not properly propagating updates to livenessTed Kremenek
state that occurred in subexpressions of Block-Level expressions. Bug and fix provided by Nuno Lopes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44224 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19Put back the flags field in the constant CF string type.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44222 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-18Added test case for dead-stores checker. Test case provided by Nuno Lopes.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44221 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-18Fixed bug in WalkaST_VisitDeclSubExprs where we failed to properly check ifTed Kremenek
the StmtIterator referring to the initializers of a chain of Decls was equal to the "end" iterator. The particular bug manifested when an iterator was created on a chain of decls with no initializers. Thanks to Nuno Lopes for reporting this bug and providing a patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44220 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17Now that we are passing back "free standing decls", make sure -ast-dump ↵Steve Naroff
works like -ast-print. Also added a cast to be safe... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44209 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17Make sure Sema::ParsedFreeStandingDeclSpec() returns a decl representing the ↵Steve Naroff
type. Adding basic printing to StmtPrinter::PrintRawDecl(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44208 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-16Added assertion in serialization of DeclRefExprs. DeclRefExprs can onlyTed Kremenek
own the decl they reference if it is a FunctionDecl. Note that his ownership property is still considered a hack, and should be fixed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44192 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-16Fixed bug in the serialization of FunctionDecls. We would incorrectlyTed Kremenek
query for the number of parameters for FunctionDecls that had type FunctionTypeNoProto. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44191 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-16Tighten up address-of checking, implementing test/Sema/expr-address-of.c. Chris Lattner
This fixes a bug reported by Seo Sanghyeon. This was meant to be committed yesterday, but the commit failed. doh. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44190 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Fix transient failure on Lex/c90.c due to an uninit variable.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44180 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15add header file I forgot to check inChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44179 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15fix a bug Steve noticed, where a #import of the main file itself would fail.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44178 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Added hack when serializing DeclRefExprs. This should probably be fixed.Ted Kremenek
Some FunctionDecls do not appear at the top-level or are owned by a DeclStmt. In calls to implicitly defined functions, a FunctionDecl is created, but only the DeclRefExprs reference them. Since an implicitly defined function may be called multiple times, there is no clear ownership model for such objects. Temporary solution: when serializing out DeclRefExprs, emit an ownership bit for the Decl. This bit is determined by querying the serializer to see if the Decl has already been serialized. If it hasn't, emit the Decl as an owned pointer. I repeat: this is a hack. This should be fixed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44176 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Started separate section for method definitions for ObjC serialization.Ted Kremenek
Added missing deserialization case in Stmt::Create() switch statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44175 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15No need to forward declare definition of objc_super...Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44173 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Finish up variadic methods/messages.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44172 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Implement support for variadic methods (work in progress).Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44171 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Extend RewriteTest::RewriteObjCIvarRefExpr() to cope with static typing ↵Steve Naroff
(when using -> on a type which corresponds to the implementation type). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44170 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Tweak funky cast to accommodate messaging 'super'. This removes any spurious ↵Steve Naroff
warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44169 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Rewrite for messaging 'super'.Steve Naroff
The code gen. results in some spurious warnings...a cast is forthcoming. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44168 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Break out bool/true/false support into a LangOptionNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44164 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Implement codegen of CXX BoolNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44160 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Handle "bool" in all places that touch _Bool. Chris Lattner
This fixes code like "if((bool)x) {}" for example. Patch by Nate Begeman. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44159 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15- Implement ivar rewrite (patch by Fariborz).Steve Naroff
- RewriteMessageExpr()...make implicit casts explicit with synthesizing call (removing warnings when calling objc_msgSend()). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44156 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Refinement to previous commit. Always cast the first argument to "id"...no ↵Steve Naroff
need to special case self. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44149 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Cast implicit "self" argument to "id". This removes all warnings associated ↵Steve Naroff
with implicit references to self. It doesn't yet deal withexplicit references to self... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44148 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Fixed bug in serialization of EnumConstantDecl where we improperlyTed Kremenek
"default constructed" an APSInt. Fixed another bug in the same method where we did not allow the NextDeclarator to be NULL. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44147 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Fixed bug when serializing QualTypes where we were serializing in theTed Kremenek
qualifiers as part of the pointer address. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44146 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Always generate a typedef for @class. The typedef removal logic that I'm ↵Steve Naroff
removing only made sense when we were operating on preprocess files without typedef guards. Now that we have guards, it is incorrect to ever remove one (since it may increase the likelihood that the rewritten header can't be included stand alone). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44145 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Fix a rewriter bug that steve noticed. Don't skip arbitrary thingsChris Lattner
between an @ and a p, just skip whitespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44144 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Added QualType::ReadBackpatch to allow QualType initialization withTed Kremenek
backpatching. This original was available, but then we removed it. It is back again to help with deserialization of FieldDecls. Because FieldDecls are currently owned by RecordDecls, which are owned by a TagType, the type of the FieldDecl may not be deserialized prior to deserializing the FieldDecl. Thus backpatching solves the problem of constructing a FieldDecl that references a type that has not yet been deserialized. Simplified serialization of TagType to not require passing in the SerializedPtrID. Registration of the materialized type object is done after the CreateImpl method returns (as with other types). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44143 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Patch to comment out use of protocol qualifiers when rewriting ivars.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44142 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Implemented serialization of InitListExpr.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44137 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Implemented serialization of CompoundLiteralExpr.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44134 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Added serialization of Union decls.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44133 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Removed assertion inserted only for temporary debugging.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44131 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Added missing break statement.Ted Kremenek
Reordered serialization methods for FunctionTypeProto and FunctionTypeNoProto to be alphabetical by serialized type name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44130 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Fairly major surgery to RewriteTest::SynthesizeObjcInternalStruct().Steve Naroff
This allows us to handle funky stuff like... #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 @interface NSLayoutManager : NSObject <NSCoding, NSGlyphStorage> { #else /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */ @interface NSLayoutManager : NSObject <NSCoding> { #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */ ...which now rewrites to... #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 #ifndef _REWRITER_typedef_NSLayoutManager #define _REWRITER_typedef_NSLayoutManager typedef struct objc_object NSLayoutManager; #endif struct NSLayoutManager { struct NSObject _NSObject; #else /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */ // @interface NSLayoutManager : NSObject <NSCoding> { #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44129 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Implemented serialization of EnumDecl and EnumConstantDecl.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44127 91177308-0d34-0410-b5e6-96231b3b80d8