summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Finish making AST BumpPtrAllocation runtime configurable (based on ↵Steve Naroff2009-01-275-14/+12
| | | | | | | | | | | -disable-free). snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m 0.179u 0.051s 0:00.23 95.6% 0+0k 0+0io 0pf+0w snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m -disable-free 0.169u 0.052s 0:00.22 95.4% 0+0k 0+0io 0pf+0w llvm-svn: 63153
* Convert types over to placement new() that takes an ASTContext.Steve Naroff2009-01-271-57/+30
| | | | | | Also changed FunctionTypeProto to be allocated with 8-byte alignment (noticed by Doug). I couldn't think of any reason to allocate on 16-byte boundaries. If anyone remembers why we were doing this, let me know! llvm-svn: 63137
* Remove many references to ASTContext::getAllocator(), replacing them with ↵Steve Naroff2009-01-277-112/+61
| | | | | | | | calls to the recently added placement new (which uses ASTContext's allocator for memory). Also added ASTContext::Deallocate(). This will simplify runtime replacement of ASTContext's allocator. Keeping the allocator private (and removing getAllocator() entirely) is also goodness. llvm-svn: 63135
* Fixed a typo in getPreferredTypeAlign method.Fariborz Jahanian2009-01-271-1/+1
| | | | llvm-svn: 63116
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-1/+1
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* add a new "getPreferredTypeAlign" method to return the preferred alignmentChris Lattner2009-01-271-0/+16
| | | | | | | of a type. The implementation is currently something of a hack, but is sufficient for now and allows clients to be built on it. llvm-svn: 63108
* 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
* Fix compile error from r62953.Sebastian Redl2009-01-251-1/+2
| | | | llvm-svn: 62959
* One more case for Expr::isConstantInitializer; I think this covers Eli Friedman2009-01-251-0/+2
| | | | | | everything that we aren't intending to implement in Expr::Evaluate. llvm-svn: 62953
* Enhancements to Expr::isConstantInitializer to deal with a few Eli Friedman2009-01-251-6/+25
| | | | | | cases it couldn't deal with before. llvm-svn: 62952
* Rename Expr::isConstantExpr to Expr::isConstantInitializer; this more Eli Friedman2009-01-251-4/+3
| | | | | | | | accurately states what the function is trying to do and how it is different from Expr::isEvaluatable. Also get rid of a parameter that is both unused and inaccurate. llvm-svn: 62951
* Make the constant folder aware of Eli Friedman2009-01-251-0/+7
| | | | | | | __builtin___CFStringMakeConstantString. (We get into trouble in GenerateStaticBlockVarDecl if the constant folder isn't accurate.) llvm-svn: 62949
* Fix the address of a label to be properly considered and emitted as aEli Friedman2009-01-251-0/+2
| | | | | | constant. llvm-svn: 62948
* Make tentative parsing of pointer-to-member decls work, and fix other stuff ↵Sebastian Redl2009-01-242-2/+5
| | | | | | pointed out by Doug. llvm-svn: 62944
* Refactor sizeof handling to use constant folding logic for constant Eli Friedman2009-01-241-5/+10
| | | | | | sizeof expressions. llvm-svn: 62941
* add initial support for the gcc "alignof(decl) is the alignment of the declChris Lattner2009-01-242-5/+34
| | | | | | | not the type" semantics. This can definitely be improved, but is better than what we had. llvm-svn: 62939
* Add support for declaring pointers to members.Sebastian Redl2009-01-243-12/+132
| | | | | | Add serialization support for ReferenceType. llvm-svn: 62934
* Improve handling of alignof. alignof(VLA) now works properly for example.Chris Lattner2009-01-241-13/+50
| | | | llvm-svn: 62932
* Fix invalid evaluation of _Complex float (real & imaginary parts hadDaniel Dunbar2009-01-241-2/+8
| | | | | | | mismatched semantics). - Enforce this in APValue. llvm-svn: 62924
* Initial implementation of semantic analysis and ASTs for C99Douglas Gregor2009-01-222-0/+115
| | | | | | | | | | | | | | | | | | designated initializers. This implementation should cover all of the constraints in C99 6.7.8, including long, complex designations and computing the size of incomplete array types initialized with a designated initializer. Please see the new test-case and holler if you find cases where this doesn't work. There are still some wrinkles with GNU's anonymous structs and anonymous unions (it isn't clear how these should work; we'll just follow GCC's lead) and with designated initializers for the members of a union. I'll tackle those very soon. CodeGen is still nonexistent, and there's some leftover code in the parser's representation of designators that I'll also need to clean up. llvm-svn: 62737
* Static Analyzer: When generating plists for errors reports, generate one ↵Ted Kremenek2009-01-211-3/+3
| | | | | | plist file per translation unit that contains all of the diagnostics. llvm-svn: 62647
* Use the ASTContext's allocator for FunctionTypeNoProto and TypeOfExprDouglas Gregor2009-01-201-2/+4
| | | | llvm-svn: 62611
* Detailed documentation for encoding of properties and a test Fariborz Jahanian2009-01-201-1/+22
| | | | | | case. llvm-svn: 62607
* Allocate expresssions through ASTContext (still more work to do).Steve Naroff2009-01-201-0/+29
| | | | | | Add debug hook to DeclContext. llvm-svn: 62605
* Improving on encoding of objective-c's property types. More to come.Fariborz Jahanian2009-01-201-10/+36
| | | | llvm-svn: 62601
* Rename DeclContext::insert to DeclContext::makeDeclVisibleInContext and ↵Douglas Gregor2009-01-201-8/+8
| | | | | | document both it and DeclContext::addDecl properly llvm-svn: 62581
* Fix for PR3350: add special-casing for "references" to va_lists in Eli Friedman2009-01-201-0/+17
| | | | | | | | builtins. Also, a minor tweak to va_copy for consistency. llvm-svn: 62574
* Remove the TopLevelDecls from TranslationUnit, since all of those decls are ↵Douglas Gregor2009-01-203-113/+10
| | | | | | owned by the ASTContext's TranslationUnitDecl. There are definitely some leaking Decls now that I'll tackle tomorrow llvm-svn: 62568
* Remove ScopedDecl, collapsing all of its functionality into Decl, soDouglas Gregor2009-01-2011-315/+197
| | | | | | | | | | | | | | | | 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
* Dead stores checker: Fix <rdar://problem/6506065> by being more selective ↵Ted Kremenek2009-01-201-8/+0
| | | | | | when say that a store is dead even though the computed value is used in the enclosing expression. llvm-svn: 62552
* Make sure all types are allocated with 8-byte alignment.Steve Naroff2009-01-191-21/+21
| | | | | | The QualType smart pointer assumes we have 3 flag bits available. llvm-svn: 62540
* Allocate Types using ASTContext's 'Allocator' object.Ted Kremenek2009-01-192-42/+75
| | | | llvm-svn: 62530
* Patch to allow @dynamic synthesis of property in a category,Fariborz Jahanian2009-01-191-2/+11
| | | | | | with @synthesize being illegal. llvm-svn: 62515
* fix deallocation of FunctionDecl::ParamInfoNuno Lopes2009-01-181-5/+3
| | | | llvm-svn: 62469
* Vector codegen improvementsNate Begeman2009-01-181-1/+5
| | | | llvm-svn: 62458
* Support evaluation of vector constant expressions, and codegen of same.Nate Begeman2009-01-183-2/+85
| | | | llvm-svn: 62455
* A couple more vector component access fixes.Nate Begeman2009-01-181-0/+11
| | | | llvm-svn: 62443
* Update support for vector component access on ExtVectors.Nate Begeman2009-01-181-5/+8
| | | | llvm-svn: 62440
* Add support for vectors to APValue. Vector constant evaluator and tests coming.Nate Begeman2009-01-181-0/+10
| | | | llvm-svn: 62438
* Teach DeclContext how to find the primary declaration for any TagDeclDouglas Gregor2009-01-174-47/+25
| | | | | | | | | | | | | even when we are still defining the TagDecl. This is required so that qualified name lookup of a class name within its definition works (see the new bits in test/SemaCXX/qualified-id-lookup.cpp). As part of this, move the nested redefinition checking code into ActOnTag. This gives us diagnostics earlier (when we try to perform the nested redefinition, rather than when we try to complete the 2nd definition) and removes some code duplication. llvm-svn: 62386
* Don't ICE on user redeclaration of objc's built-in types.Fariborz Jahanian2009-01-161-4/+10
| | | | | | Issue diagnostics instead if types do not match. llvm-svn: 62349
* make ast-print handle random non-printable characters correctly with octal ↵Chris Lattner2009-01-161-3/+13
| | | | | | escapes. llvm-svn: 62337
* Part one of handling C++ functional casts. This handles semanticDouglas Gregor2009-01-163-0/+79
| | | | | | | | analysis and AST-building for the cases where we have N != 1 arguments. For N == 1 arguments, we need to finish the C++ implementation of explicit type casts (C++ [expr.cast]). llvm-svn: 62329
* rename "virtual location" of a macro to "instantiation location".Chris Lattner2009-01-161-0/+1
| | | | llvm-svn: 62315
* 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
* Don't advance the statement iterator after we've deallocated the statementDouglas Gregor2009-01-161-2/+3
| | | | llvm-svn: 62306
* postpone sizeof objc-class computatin to the clients.Fariborz Jahanian2009-01-161-0/+4
| | | | llvm-svn: 62292
* Fix some unused variable, control reaches end of non-void function,Daniel Dunbar2009-01-151-0/+1
| | | | | | and uninitialized use options. llvm-svn: 62270
* Fix a subtle bug in DeclContext::DestroyDecls().Steve Naroff2009-01-141-4/+8
| | | | llvm-svn: 62205
* FunctionDecl::setParams() now uses the allocator associated with ASTContext ↵Ted Kremenek2009-01-141-2/+4
| | | | | | to allocate the array of ParmVarDecl*'s. llvm-svn: 62203
OpenPOWER on IntegriCloud