summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Audit __private_extern__ handling.Daniel Dunbar2009-04-141-8/+3
| | | | | | | | | | | | | | - Exposed quite a few Sema issues and a CodeGen crash. - See FIXMEs in test case, and in SemaDecl.cpp (PR3983). I'm skeptical that __private_extern__ should actually be a storage class value. I think that __private_extern__ basically amounts to extern A __attribute__((visibility("hidden"))) and would be better off handled (a) as that, or (b) with an extra bit in the VarDecl. llvm-svn: 69020
* simplifyChris Lattner2009-03-291-1/+1
| | | | llvm-svn: 68000
* Change compound assignment operators to keep track of both the promoted Eli Friedman2009-03-281-2/+4
| | | | | | | | | | | | | | | | | LHS type and the computation result type; this encodes information into the AST which is otherwise non-obvious. Fix Sema to always come up with the right answer for both of these types. Fix IRGen and the analyzer to account for these changes. This fixes PR2601. The approach is inspired by PR2601 comment 2. Note that this changes real *= complex in CodeGen from a silent miscompilation to an explicit error. I'm not really sure that the analyzer changes are correct, or how to test them... someone more familiar with the analyzer should check those changes. llvm-svn: 67889
* Semantic analysis, ASTs, and unqualified name lookup support for C++Douglas Gregor2009-02-031-0/+9
| | | | | | using directives, from Piotr Rak! llvm-svn: 63646
* Introduce a new PresumedLoc class to represent the concept of a locationChris Lattner2009-01-271-11/+16
| | | | | | | | | | | | | | | | | | | as reported to the user and as manipulated by #line. This is what __FILE__, __INCLUDE_LEVEL__, diagnostics and other things should follow (but not dependency generation!). This patch also includes several cleanups along the way: - SourceLocation now has a dump method, and several other places that did similar things now use it. - I cleaned up some code in AnalysisConsumer, but it should probably be simplified further now that NamedDecl is better. - TextDiagnosticPrinter is now simplified and cleaned up a bit. This patch is a prerequisite for #line, but does not actually provide any #line functionality. llvm-svn: 63098
* Remove ScopedDecl, collapsing all of its functionality into Decl, soDouglas Gregor2009-01-201-1/+1
| | | | | | | | | | | | | | | | that every declaration lives inside a DeclContext. Moved several things that don't have names but were ScopedDecls (and, therefore, NamedDecls) to inherit from Decl rather than NamedDecl, including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't store empty DeclarationNames for these things, nor do we try to insert them into DeclContext's lookup structure. The serialization tests are temporarily disabled. We'll re-enable them once we've sorted out the remaining ownership/serialiazation issues between DeclContexts and TranslationUnion, DeclGroups, etc. llvm-svn: 62562
* Change some terminology in SourceLocation: instead of referring to Chris Lattner2009-01-161-6/+7
| | | | | | | the "physical" location of tokens, refer to the "spelling" location. This is more concrete and useful, tokens aren't really physical objects! llvm-svn: 62309
* Correct the order in which we cope with end-of-class-definitionDouglas Gregor2008-12-241-6/+8
| | | | | | | | | | | | | | | | | | | | | | semantics and improve our handling of default arguments. Specifically, we follow this order: - As soon as the see the '}' in the class definition, the class is complete and we add any implicit declarations (default constructor, copy constructor, etc.) to the class. - If there are any default function arguments, parse them - If there were any inline member function definitions, parse them As part of this change, we now keep track of the the fact that we've seen unparsed default function arguments within the AST. See the new ParmVarDecl::hasUnparsedDefaultArg member. This allows us to properly cope with calls inside default function arguments to other functions where we're making use of the default arguments. Made some C++ error messages regarding failed initializations more specific. llvm-svn: 61406
* Migrate some stuff from NamedDecl::getName() to Chris Lattner2008-11-241-2/+2
| | | | | | NamedDecl::getNameAsString() to make it more explicit. llvm-svn: 59937
* Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make itChris Lattner2008-11-241-5/+4
| | | | | | | | | assert if the name is not an identifier. Update callers to do the right thing and avoid this method in unsafe cases. This also fixes an objc warning that was missing a space, and migrates a couple more to taking IdentifierInfo and QualTypes instead of std::strings. llvm-svn: 59936
* Rename Selector::getName() to Selector::getAsString(), and addChris Lattner2008-11-241-6/+5
| | | | | | | | | | | | | a new NamedDecl::getAsString() method. Change uses of Selector::getName() to just pass in a Selector where possible (e.g. to diagnostics) instead of going through an std::string. This also adds new formatters for objcinstance and objcclass as described in the dox. llvm-svn: 59933
* New AST node to access "implicit" setter/getter using property dor syntax.Fariborz Jahanian2008-11-221-10/+13
| | | | | | | Issuing diagnostics when assigning to read-only properties. This is work in progress. llvm-svn: 59874
* Introduction the DeclarationName class, as a single, general method ofDouglas Gregor2008-11-171-6/+10
| | | | | | | | representing the names of declarations in the C family of languages. DeclarationName is used in NamedDecl to store the name of the declaration (naturally), and ObjCMethodDecl is now a NamedDecl. llvm-svn: 59441
* Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof ↵Sebastian Redl2008-11-111-3/+4
| | | | | | expressions, both of values and types. llvm-svn: 59057
* Add a new expression class, ObjCSuperExpr, to handle the Objective-C ↵Douglas Gregor2008-11-041-2/+13
| | | | | | 'super'. Remove ObjCThis from PredefinedExpr llvm-svn: 58698
* Refactor the expression class hierarchy for casts. Most importantly:Douglas Gregor2008-10-271-3/+11
| | | | | | | | | | | | | | | | | | | | | | - CastExpr is the root of all casts - ImplicitCastExpr is (still) used for all explicit casts - ExplicitCastExpr is now the root of all *explicit* casts - ExplicitCCastExpr (new name needed!?) is a C-style cast in C or C++ - CXXFunctionalCastExpr inherits from ExplicitCastExpr - CXXNamedCastExpr inherits from ExplicitCastExpr and is the root of all of the C++ named cast expression types (static_cast, dynamic_cast, etc.) - Added classes CXXStaticCastExpr, CXXDynamicCastExpr, CXXReinterpretCastExpr, and CXXConstCastExpr to Also, fixed returned-stack-addr.cpp, which broke once when we fixed reinterpret_cast to diagnose double->int* conversions and again when we eliminated implicit conversions to reference types. The fix is in both testcase and SemaChecking.cpp. Most of this patch is simply support for the renaming. There's very little actual change in semantics. llvm-svn: 58264
* Simplify handling of struct/union/class tags.Argyrios Kyrtzidis2008-10-151-6/+2
| | | | | | | Instead of using two sets of Decl kinds (Struct/Union/Class and CXXStruct/CXXUnion/CXXClass), use one 'Record' and one 'CXXRecord' Decl kind and make tag kind a property of TagDecl. Cleans up the code a bit and better reflects that Decl class structure. llvm-svn: 57541
* Use Decl::decl_iterator instead of walking the ScopedDecl chain (which will ↵Ted Kremenek2008-10-061-1/+3
| | | | | | soon be removed). llvm-svn: 57190
* Fix ObjCPropertRefExpr to be able to encode all the information forDaniel Dunbar2008-09-031-5/+8
| | | | | | | uses which refer to methods not properties. - Not yet wired in Sema. llvm-svn: 55681
* Add Objective-C property setter support.Daniel Dunbar2008-08-301-0/+13
| | | | | | | | | | | | | | | | | | | | | | - Change Obj-C runtime message API, drop the ObjCMessageExpr arg in favor of just result type and selector. Necessary so it can be reused in situations where we don't want to cons up an ObjCMessageExpr. - Update aggregate binary assignment to know about special property ref lvalues. - Add CodeGenFunction::EmitCallArg overload which takes an already emitted rvalue. Add CodeGenFunction::StoreComplexIntoAddr. Disabled logic in Sema for parsing Objective-C dot-syntax that accesses methods. This code does not search in the correct order and the AST node has no way of properly representing its results. Updated StmtDumper to print a bit more information about ObjCPropertyRefExprs. llvm-svn: 55561
* More #include cleaningDaniel Dunbar2008-08-111-3/+0
| | | | | | | | | | | - Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried to get rid of the obvious examples and this was the easiest way to trim the #includes in one fell swoop. - We now return to regularly scheduled development. llvm-svn: 54632
* rename PreDefinedExpr -> PredefinedExprChris Lattner2008-08-101-6/+6
| | | | llvm-svn: 54605
* fix an extraneous blank line in -ast-dump output.Chris Lattner2008-07-261-1/+1
| | | | llvm-svn: 54097
* remove dead enums.Chris Lattner2008-06-211-2/+0
| | | | llvm-svn: 52581
* Switch 'super' from being a weird cast thing to being a predefined expr node.Chris Lattner2008-06-211-11/+7
| | | | | | Patch by David Chisnall with objc rewriter and stmtdumper updates from me. llvm-svn: 52580
* Dump the name of CXXStruct/CXXUnion/CXXClass Decl subclasses.Argyrios Kyrtzidis2008-06-091-0/+3
| | | | llvm-svn: 52161
* Fix ast dumping to work with long double literals, e.g. we dump:Chris Lattner2008-06-071-1/+1
| | | | | | | | | | | | | long double X() { return 1.0L; } as: long double X() (CompoundStmt 0xb06a00 <t.c:2:17, col:32> (ReturnStmt 0xb068d0 <col:19, col:26> (FloatingLiteral 0xb02cf0 <col:26> 'long double' 1.000000))) llvm-svn: 52080
* Minor tweak to -ast-dump for ivars.Steve Naroff2008-05-231-0/+2
| | | | llvm-svn: 51508
* Tweak AST dumper for ObjC ivars.Steve Naroff2008-05-231-3/+3
| | | | llvm-svn: 51463
* Use pointer swizziling to unify in ObjCMessageExpr the receiver and ↵Ted Kremenek2008-05-011-0/+2
| | | | | | | | classname "fields". This saves us a pointer. Implemented serialization for ObjCMessageExpr. llvm-svn: 50528
* OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.Nate Begeman2008-04-181-2/+2
| | | | llvm-svn: 49942
* Remove uses of "Selector&" and "const Selector&", since Selector is just anTed Kremenek2008-04-161-1/+1
| | | | | | immutable smart pointer (we don't need to pass references, just pass Selector). llvm-svn: 49773
* Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff2008-04-151-2/+1
| | | | | | | | VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl(). This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it). llvm-svn: 49748
* print cvr qualifiers on simplified typedefsChris Lattner2008-04-021-2/+5
| | | | llvm-svn: 49074
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+486
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud