aboutsummaryrefslogtreecommitdiff
path: root/AST
AgeCommit message (Collapse)Author
2007-12-17Removed CFG.cpp's dependence on #including iostream.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45116 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17Fixed another case where sizeof() returns the size in bytes, not bits.Ted Kremenek
This parallels a previous patch (duplicate logic caused the bug to appear in multiple locations): r44316 (http://llvm.org/viewvc/llvm-project?rev=44316&view=rev). Patch provided by Nuno Lopes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45098 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-15Removed "isSizeOfExpr" mode from StmtIterator. It turned out not to beTed Kremenek
so useful and introduced a few bugs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45051 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14Added "mode" to StmtIterator to record if the expression being iteratedTed Kremenek
over is the subexpression of a sizeof(expression). Different clients will wish to handle iteration over such subexpressions differently, and can now easily query if they are iterating over such statements using the StmtIterator's inSizeOfExpr(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45047 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14- Remove getInstanceMethods/getClassMethods API on ObjcInterfaceDecl, ↵Steve Naroff
ObjcProtocolDecl, and ObjcCategoryDecl. These methods are replaced by the respective iterators on each class. - Add getInstanceMethodForSelector to ObjcInterfaceDecl, ObjcProtocolDecl, and ObjcCatgoryDecl. This hook will do a "shallow" lookup. This is a convenience method that reducing some of the iterator usage. - Various changes to convert all clients to the above API's... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45046 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14Added support to StmtIterator to traverse the size expression of a VLA typeTed Kremenek
declared in a sizeof. For example: sizeof(int[foo()]); the expression "foo()" is an expression that is executed during the evaluation of sizeof. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45043 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13CFG bug fix: for sizeof(expressions), don't expand the control-flowTed Kremenek
of "expressions", since they are not really evaluated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45015 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13Patch to make ObjcQualifiedInterfaceType inherit ObjcInterfaceTypeFariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45014 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13Updated serialization of ParmVarDecl to serialize out objcDeclQualifier.Ted Kremenek
Previously this field was serialized out in VarDecl (a parent class), but now the field belongs to ParmVarDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44989 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13Moved ObjcDeclQualifier to ParmVarDecl from VarDecl.Fariborz Jahanian
Ted, this change necessitates (de)/serialization of ParmVarDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44972 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12TargetInfo no longer includes a reference to SourceManager.Ted Kremenek
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation. Added many utility methods to FullSourceLoc to provide shorthand for: FullLoc.getManager().someMethod(FullLoc.getLocation()); instead we have: FullLoc.someMethod(); Modified TextDiagnostics (and related classes) to use this short-hand. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44957 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12Encode enumeral types.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44956 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12fix typoChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44932 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12more cleanups changing things like getInstanceVariables to iterators.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44930 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12resolve some fixmes and clean up some code by eliminating the get*Vars apis ↵Chris Lattner
to some classes and use iterators instead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44927 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12start cleaning up interfaces for objc bits and pieces by switching to anChris Lattner
iterator interface. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44926 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12Added back VisitDeclStmt() to the StmtDumper, essentially reverting r44920:Ted Kremenek
http://llvm.org/viewvc/llvm-project?rev=44920&view=rev Putting VisitDeclStmt() was motivated because it called DumpDeclarator(), which printed out a little bit more information than just using the child_iterator interface to visit the subexpressions of DeclStmt. To avoid printing the initializers twice, DumpSubTree() now specially checks for DeclStmts; in such cases it calls VisitDeclStmt() without using the child_iterators to visit the subexpressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44924 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12Removed VisitDeclStmt(). The initializers of a DeclStmt are now automaticallyTed Kremenek
printed out by DumpSubTree() via the child_iterator interface. This fixes a bug where the initializers were being dumped twice. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44920 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12Unbreak -stats on cocoa.hChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44919 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12Implemented type checking for pointer of objects of protocol-qualified types.Fariborz Jahanian
Note that incompatible-protocol-qualified-types.m is currently failing. This is unrelated to this patch and Steve is looking at the general problem of not reporting incompitible pointer types in return stetement.. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44897 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11Fix a case where we'd return "is not a constant expr" withoutChris Lattner
return a location. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44889 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10Fixed bug in CFG::PopulateBlkExprMap where the orderingTed Kremenek
between fetching the size of the expression map (for use as the next integer id for an Expr*) and the creation of the entry in the map could be non-deterministic. This could cause the size of the map to be incremented prior to the index being determine. On Linux the map entry would be created first, causing the map to the "size" to be incremented prior to it being queried. On Mac OS X we had the reverse behavior. Now the size is always queried prior to the new id being inserted into the map. This was the real cause of the bit-overrun triggered in PR 1847: http://llvm.org/bugs/show_bug.cgi?id=1847 Also reverted the change in patch 44813, which was a bogus fix to this problem: http://llvm.org/viewvc/llvm-project?rev=44813&view=rev git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44822 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-07Implemented when static typing is combined with protocols and use as receiverFariborz Jahanian
type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44685 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-07Patch to implement "Protocol" as a built-in type declared asFariborz Jahanian
"@class Protocol;" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44670 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-06Fix a bug handling typedefs of functions, patch by Nuno Lopes!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44661 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-06make it more clear what 'foo' isChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44653 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Recognize CompoundLiteralExpr's as valid lvalue's.Steve Naroff
Also updated a FIXME in Sema::CheckInitializer()... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44602 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Implemented serialization of: ObjCEncodeExpr, ObjCSelectorExpr.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44593 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-04Implemented serialization of ObjCStringLiteral.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44568 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-04Implemented serialization for ObjcAtThrowStmt.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44567 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-04Implemented serialization of ObjcAtTryStmt.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44566 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-04Implemented serialization for ObjcAtFinallyStmt.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44564 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-04Implemented serialization for ObjcAtCatchStmt.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44563 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03Fix for testcase that assigns a dereferenced reference to a pointer. TheBill Wendling
standard says that we should adjust the "reference to T" type to "T" before analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44530 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02Fix isStructureType and isUnionType to ignore typedefs, as statedSeo Sanghyeon
in the header. Patch by Cédric Venet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44519 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-01Compute side-effect for conditional expression.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44492 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-01make the unused expression warning less noisy by not warning about comma ↵Chris Lattner
exprs whose LHS and RHS both have side effects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44486 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-01simplify some code, add support for functions without a protoChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44485 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30String literals are always valid LValues.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44472 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30GCC has an extension where the left hand side of the ? : operator can be ↵Anders Carlsson
omitted. Handle this in a few more places. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44462 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29Added method "HandleTopLevelDeclaration" to ASTConsumer. This will eventuallyTed Kremenek
be the new hook that ASTStreamer calls to feed top-level Decls to ASTConsumers. The difference between "HandleTopLevelDeclaration" and "HandleTopLevelDecl" is that "HandleTopLevelDecl" is currently called by ASTStreamer for every top-level declaration, including those that appear within a Decl chain. Using the new interface, ASTStreamer would only call HandleTopLevelDeclaration for Decls that appear that the beginning of a Decl chain (i.e., a group of related decls). To preserve the behavior that all subclasses of ASTConsumer currently expect, the default implementation of HandleTopLevelDeclaration simply calls HandleTopLevelDecl, and for decl chains it calls HandleTopLevelDecl for each Decl* in a chain of Decls. The advantage of this interface is that some subclasses of ASTConsumer only really want the Decl chain, and not each individual Decl passed to them. This extra level of indirection allows subclasses to override the default behavior if they so desire. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44444 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29Added "isExact" field to FloatingLiteral. This flag indicates whether or notTed Kremenek
the APFloat representing the parsed literal can represent the literal value exactly. This is useful when performing various semantic checks on the code, and issuing appropriate warnings to users. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44423 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28Add more intrinsics. We can now correctly parse both Carbon.h and Cocoa.h ↵Anders Carlsson
without having to do -arch ppc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44392 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28fix compilation error noticed by Nuno LopesChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44388 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27add several cases that Expr::hasStaticStorage missed, pointed out by Oliver HuntChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44376 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27sizeof is defined by bitsin(char) not by units of 8 bits.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44369 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27handle __vector_size__ like vector_sizeChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44358 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27Add builtin type signature support for vector types. Add correct type ↵Anders Carlsson
signatures for a bunch of MMX builtins. We now parse all the intrinsics in mmintrin.h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44357 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26Removed dependence on #including iostream.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44338 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26Reverted changed to getTagDeclType() introduced in patch 44089:Ted Kremenek
http://llvm.org/viewvc/llvm-project?view=rev&revision=44089 "Decl" once again can no longer be NULL, so the NULL checks are not needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44336 91177308-0d34-0410-b5e6-96231b3b80d8