aboutsummaryrefslogtreecommitdiff
path: root/AST
AgeCommit message (Collapse)Author
2007-11-26Fixed StmtPrinter to handle GCC extension to the ternary operator "?:" whereTed Kremenek
the LHS subexpression can be NULL. Patch provided by Nuno Lopes! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44328 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26Fixed bug in CFG construction where we did not properly handle the GCCTed Kremenek
extension "?:" for the ternary operator, e.g.: x ?: y; This expression is represented in the clang ASTs as a ConditionalOperator whose LHS expression is NULL. Now we handle this special case, causing the block containing the condition to be a predecessor to the block that "merges" the values of the ternary operator. Thanks to Nuno Lopes for identifying and diagnosing this bug! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44327 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25sizeof() return size in bytes, not bits, patch by Nuno Lopes!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44316 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23Keep track of whether the asm is volatile or not.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44297 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-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-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-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-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-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-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-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-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-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
2007-11-14Implemented serialization of FieldDecls.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44126 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Implemented serialization of RecordDecls. Changed serialization of TagType toTed Kremenek
have an owning pointer to the referred TagDecl. This should hopefully fix a bug where TagDecls (including decls from structs, etc.) were not serialized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44106 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Implemented serialization of FunctionTypeNoProto.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44094 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Implemented serialization of VariableArrayTypes.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44093 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Implemented serialization of TypedefType.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44092 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Implemented serialization of ConstantArrayType.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44091 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Implemented serialization of TagTypes.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44090 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Modified ASTContext::getTagDeclType() to accept a NULL pointer for the passedTed Kremenek
in TagDecl*. This allows the deserializer to use ASTContext to create the TagTypes. Deserialize TagTypes then rely on pointer-backpatching to resolve the decls. This may not be the interface that we want, but as the implementation of TagTypes will potentially change significantly in the future, I'm leaving this for now. An appropriate FIXME is in place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44089 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Type encoding for structs.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44087 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Implemented serialization of AsmStmt (or rather what is currently implementedTed Kremenek
in AsmStmt). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44077 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Fixed bug in FunctionDecl serialization where we crashed when theTed Kremenek
FunctionDecl had decls for its parameters but still had greater than 0 arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Implemented serialization for SizeOfAlignOfTypeExpr.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44075 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Implemented serialization for MemberExpr.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44074 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Rewrote type serialization to used the same methodology as we do for Decls.Ted Kremenek
Removed tons of dead code in ASTContext concerning how types use to be serialized. Removed serialization methods from QualType that are no longer used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44070 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13improve handling of address of global when checking forChris Lattner
constants and initializers. Patch by Sanghyeon Seo, thanks! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44049 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Renamed all serialization "Materialize" methods to "Create" to conform withTed Kremenek
the new serialization API. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44035 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Restructured serialization code for decls to make it cleaner, easier toTed Kremenek
understand, and batched the emission owned subobjects (using BatchEmitOwnedPtr) to get a smaller output bitcode size. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12Patch to do statically typed ivar references.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44028 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12Add category method definitions incrementally, removing a FIXME (like we do ↵Steve Naroff
for class implementations). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44027 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12In Stmt serialization, renamed directEmit to EmitImpl andTed Kremenek
directMaterialize to CreateImpl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44020 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12Now that we can refer to instance variables, make sure they are considered ↵Steve Naroff
lvalues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44017 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12Implement instance variable references.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44016 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12- Minor cleanup to yesterday's changes to Sema::ObjcActOnStartOfMethodDef();Steve Naroff
- Add Sema::CurMethodDecl, in preparation for adding ObjcIvarRefExpr. - Add ObjcInterfaceDecl::lookupInstanceVariable(), in prep for adding ivars. - A couple renames in ObjcInterfaceDecl, while I was in the vicinity:-) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44015 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-11This is the last 5% of the solution to teaching Sema::ActOnInstanceMessage() ↵Steve Naroff
about private methods (r43989). While the diff is large, the idea is very simple. When we parse method definitions (in an @implementation), we need to add them incrementally (rather than wait until the @end). Other details... - Renamed Sema::ActOnAddMethodsToObjcDecl() to Sema::ActOnAtEnd(). The methods are now optional arguments. - Removed Parser::AllImplMethods (a nice cleanup). - Added location info to ObjcImplementationDecl (since we will need it very soon:-) - Modified message.m test to no longer allow the bogus diagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43995 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-11Teach Sema::ActOnInstanceMessage() about private methods. That is, methods ↵Steve Naroff
declared in an implementation (but not listed in the interface). This commit is only 95% of the bug fix. The last piece to this puzzle is to add the method decls to the implementation incrementally (as we encounter them). At the moment, the methods aren't added until we see an @end (which is too late). I will complete this later... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43989 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09Recognize ObjCStringLiteral as a constant expression.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43946 91177308-0d34-0410-b5e6-96231b3b80d8