summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Appease versions of GCC which don't correctly support injected classJohn McCall2010-11-241-2/+2
| | | | | | names. llvm-svn: 120091
* This is probably an important file.John McCall2010-11-241-0/+861
| | | | llvm-svn: 120089
* Add -cc1 -ast-dump-xml, an excessively detailed XML dump of the internalsJohn McCall2010-11-241-0/+1
| | | | | | | | | | | | | of the ASTs. Only available in assertions builds. No stability guarantee. This is intended solely as a debugging tool. I'm not sure if the goals are sufficiently aligned with the XML printer to allow a common implementation. Currently just falls back on the StmtDumper to display statements, which means it doesn't produce valid XML in those cases. llvm-svn: 120088
* Switch a lot of call-sites over to using the new value-kind calculations.John McCall2010-11-243-3/+3
| | | | llvm-svn: 120084
* A few tweaks to the value-kind computation:John McCall2010-11-231-2/+0
| | | | | | | | | | | | | - Default argument expressions pick up the value kind of the incoming expression, not the value kind of the parameter it initializes. - When building a template argument for substitution, A::x is an rvalue if x is an instance method. - Anonymous struct/union paths pick up value kind the same way that normal member accesses do; extract out a common code path for this. Enable the value-kind assertion, now that it passes self-host. llvm-svn: 120055
* now the FileManager has a FileSystemOpts ivar, stop threadingChris Lattner2010-11-231-7/+3
| | | | | | | | | FileSystemOpts through a ton of apis, simplifying a lot of code. This also fixes a latent bug in ASTUnit where it would invoke methods on FileManager without creating one in some code paths in cindextext. llvm-svn: 120010
* Fix a bunch of IndirectFieldDecl-related warnings.Benjamin Kramer2010-11-211-3/+4
| | | | | | - Negative ChainingSize doesn't make sense, make it unsigned. llvm-svn: 119943
* Major anonymous union/struct redesign.Francois Pichet2010-11-214-3/+48
| | | | | | | | | | | A new AST node is introduced: def IndirectField : DDecl<Value>; IndirectFields are injected into the anonymous's parent scope and chain back to the original field. Name lookup for anonymous entities now result in an IndirectFieldDecl instead of a FieldDecl. There is no functionality change, the code generated should be the same. llvm-svn: 119919
* Revert r119838 "Don't warn for empty 'if' body if there is a macro that ↵Argyrios Kyrtzidis2010-11-201-4/+2
| | | | | | | | | | expands to nothing" and use a better and more general approach, where NullStmt has a flag to indicate whether it was preceded by an empty macro. Thanks to Abramo Bagnara for the hint! llvm-svn: 119887
* Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:Argyrios Kyrtzidis2010-11-191-2/+4
| | | | | | | | | if (condition) CALL(0); // empty macro but don't warn for empty body. Fixes rdar://8436021. llvm-svn: 119838
* Make sure to print cvr-qualifiers on function declarationsDouglas Gregor2010-11-191-0/+10
| | | | llvm-svn: 119817
* Refactoring of Diagnostic class.Argyrios Kyrtzidis2010-11-182-22/+11
| | | | | | | | | | | -Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces. llvm-svn: 119730
* Add an assertion, fix a whole bunch of bugs, comment the assertionJohn McCall2010-11-182-1/+20
| | | | | | out because there are still bugs left. llvm-svn: 119722
* In some situations, TemplateArgumentLoc wasn't setting TypeSourceLoc (seeCraig Silverstein2010-11-181-0/+7
| | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=8558). This patch fixes it. Thanks to rjmccall for all the coaching! Approved by rjmccall llvm-svn: 119697
* Calculate the value kind of an expression when it's created andJohn McCall2010-11-186-60/+88
| | | | | | | | | | | | | store it on the expression node. Also store an "object kind", which distinguishes ordinary "addressed" l-values (like variable references and pointer dereferences) and bitfield, @property, and vector-component l-values. Currently we're not using these for much, but I aim to switch pretty much everything calculating l-valueness over to them. For now they shouldn't necessarily be trusted. llvm-svn: 119685
* a metric ton of refactoring later, Sema::getLocationOfStringLiteralByte Chris Lattner2010-11-171-0/+69
| | | | | | | | no longer depends on Preprocessor, so we can move it out of Sema into a nice new StringLiteral::getLocationOfByte method that can be used by any AST client. llvm-svn: 119481
* For an Objective-C @synthesize statement, e.g.,Douglas Gregor2010-11-171-3/+10
| | | | | | | | | @synthesize foo = _foo; keep track of the location of the ivar ("_foo"). Teach libclang to visit the ivar as a member reference. llvm-svn: 119447
* Fixes synthesis of type for the object which holds info.Fariborz Jahanian2010-11-171-0/+7
| | | | | | about a __block cxx object. llvm-svn: 119411
* Simplify some complex emission and implement correct semantics forJohn McCall2010-11-161-3/+15
| | | | | | | | | assignment to volatiles in C. This in effect reverts some of mjs's work in and around r72572. Basically, the C++ standard is quite clear, except that it lies about volatile behavior approximating C's, whereas the C standard is almost actively misleading. llvm-svn: 119344
* Have CXXDeleteExpr::getDestroyedType return the actual destroyed typeCraig Silverstein2010-11-161-2/+3
| | | | | | | | | | | | | | | | | | | in more situations. In particular, for code like template<class T> void Fn() { T* x; delete x; } getDestroyedType() will now return T rather than T*, as it would before this change. On the other hand, for code like this: template<class T> void Fn() { T x; delete x; } getDestroyedType() will return an empty QualType(), since it doesn't know what the actual destroyed type would be. Previously, it would return T. OKed by rjmccall llvm-svn: 119334
* Kill CK_Unknown and flesh out the documentation for the existing CastKinds.John McCall2010-11-162-31/+0
| | | | llvm-svn: 119331
* Update TypePrinter::PrintVector to handle new Neon vector types.Bob Wilson2010-11-161-9/+25
| | | | llvm-svn: 119302
* ASTContext::getVectorType should preserve the vector kind for canonical types.Bob Wilson2010-11-161-2/+1
| | | | | | | | | | This is needed for Neon types when it is most natural to define them in terms of a typedef. For example, Neon poly8_t is a typedef for "signed char", and we want to define polynomial vectors as vectors of that typedef. Without this change, the result will be a generic GCC-style vector. I think this is safe for other vector types as well, but I would appreciate a review of this. llvm-svn: 119300
* Add a new expression kind, OpaqueValueExpr, which is useful forJohn McCall2010-11-155-10/+36
| | | | | | | certain internal type-checking procedures as well as for representing certain implicitly-generated operations. Uses to follow. llvm-svn: 119289
* Add method ParentMap::addStmt().Ted Kremenek2010-11-151-0/+6
| | | | llvm-svn: 119181
* Assorted work leading towards the elimination of CK_Unknown.John McCall2010-11-152-1/+39
| | | | llvm-svn: 119138
* Add a few more complex-related cast kinds that arise due to arbitraryJohn McCall2010-11-142-3/+20
| | | | | | | | | | implicit conversions; the last batch was specific to promotions. I think this is the full set we need. I do think dividing the cast kinds into floating and integral is probably a good idea. Annotate a *lot* more C casts with useful cast kinds. llvm-svn: 119036
* Introduce five new cast kinds for various conversions into andJohn McCall2010-11-132-3/+15
| | | | | | between complex types. llvm-svn: 118994
* Bring UsualArithmeticConversionsType back into Sema and cast theJohn McCall2010-11-131-140/+0
| | | | | | | operands appropriately. There are a lot of missing complex-related cast kinds. llvm-svn: 118993
* Introduce a null-to-pointer implicit cast kind.John McCall2010-11-132-0/+8
| | | | llvm-svn: 118966
* Generalize ASTContext::areCompatibleVectorTypes to handle new Neon vector types.Bob Wilson2010-11-121-6/+7
| | | | llvm-svn: 118901
* Make sure to always check the result ofDouglas Gregor2010-11-122-7/+7
| | | | | | | SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes. llvm-svn: 118885
* Add a variant of GCC-style vector types for ARM NEON.Bob Wilson2010-11-103-16/+16
| | | | | | | | | NEON vector types need to be mangled in a special way to comply with ARM's ABI, similar to some of the AltiVec-specific vector types. This patch is mostly just renaming a bunch of "AltiVecSpecific" things, since they will no longer be specific to AltiVec. Besides that, it just adds the new "NeonVector" enum. llvm-svn: 118724
* Replace UsingDecl's SmallPtrSet of UsingShadowDecls with a linked list to ↵Argyrios Kyrtzidis2010-11-101-0/+38
| | | | | | | | avoid leaking memory. Fixes rdar://8649963. llvm-svn: 118674
* Split out -Wconversion warnings about constant precision into theirJohn McCall2010-11-091-3/+16
| | | | | | | | | | | own subcategory, -Wconstant-conversion, which is on by default. Tweak the constant folder to give better results in the invalid case of a negative shift amount. Implements rdar://problem/6792488 llvm-svn: 118636
* Restore patch reversed in r118475. FixesFariborz Jahanian2010-11-091-0/+6
| | | | | | // rdar://8632525 llvm-svn: 118634
* Use the right calling convention when mangling names in the Microsoft C++Charles Davis2010-11-091-0/+5
| | | | | | | | mangler. Now member functions and pointers thereof have their calling convention mangled as __thiscall if they have the default CC (even though, they technically still have the __cdecl CC). llvm-svn: 118598
* Reverse patch for // rdar://8632525. It mightFariborz Jahanian2010-11-091-6/+0
| | | | | | has broken a build. llvm-svn: 118475
* Fix InitListExpr::getSourceRange() to work in the case of no locations for ↵Ted Kremenek2010-11-091-0/+29
| | | | | | | | '(' and ')'. This can happen in the case of transparent unions. llvm-svn: 118472
* Provide a precise builtin declaration for objc_msgSendFariborz Jahanian2010-11-081-0/+6
| | | | | | to avoid a bogus warning. Fixes //rdar: //8632525 llvm-svn: 118451
* Improve our handling of C++ [class.copy]p3, which specifies that aDouglas Gregor2010-11-081-7/+1
| | | | | | | | | constructor template will not be used to copy a class object to a value of its own type. We were eliminating all constructor templates whose specializations look like a copy constructor, which eliminated important candidates. Fixes PR8182. llvm-svn: 118418
* Remove broken support for variadic templates, along with the variousDouglas Gregor2010-11-075-156/+38
| | | | | | | | | | | | | abstractions (e.g., TemplateArgumentListBuilder) that were designed to support variadic templates. Only a few remnants of variadic templates remain, in the parser (parsing template type parameter packs), AST (template type parameter pack bits and TemplateArgument::Pack), and Sema; these are expected to be used in a future implementation of variadic templates. But don't get too excited about that happening now. llvm-svn: 118385
* Put class into an anonymous namespace.Benjamin Kramer2010-11-051-0/+2
| | | | llvm-svn: 118293
* Don't be so eager to replace UsingDecls in a DeclContext's lookup table;Argyrios Kyrtzidis2010-11-041-0/+4
| | | | | | check that the TargetNestedNameDecl is the same first. llvm-svn: 118239
* add a comment to my last commitDouglas Gregor2010-11-041-0/+1
| | | | llvm-svn: 118212
* When canonicalizing nested-name-specifiers involving dependent namesDouglas Gregor2010-11-041-3/+27
| | | | | | | | | or dependent specializations, rip apart the dependent name/dependent specialization to recanonicalize its pieces, because nested-name-specifiers store "dependent-type::identifier" differently than types do. Fixes PR7419. llvm-svn: 118211
* Implement -working-directory.Argyrios Kyrtzidis2010-11-031-2/+6
| | | | | | | | | | | | | | | | | | | When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't require the user to actually change the working directory) and to help reproduce test cases when the reproduction work comes along. --FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains the working directory value if set). --FileSystemOptions are passed around to various interfaces that perform file operations. --Opening & reading the content of files should be done only through FileManager. This is useful in general since file operations will be abstracted in the future for the reproduction mechanism. FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same FileManager but with different FileSystemOptions. Addresses rdar://8583824. llvm-svn: 118203
* Improve source-location information for CXXConstructExpr nodes, byDouglas Gregor2010-11-031-3/+16
| | | | | | | | | ensuring that they cover all of their child nodes. There's still a clang_getCursor()-related issue with CXXFunctionalCastExprs with CXXConstructExprs as children (see FIXME in the test case); I'll look at that separately. llvm-svn: 118132
* Fixes an assertion violation when bind to temporaryFariborz Jahanian2010-11-021-1/+3
| | | | | | | expression is a dependent expression. // rdar: // 8620524 and PR7851 llvm-svn: 118066
* Unbreak private_extern, which apparently we had zero tests for.John McCall2010-11-021-2/+6
| | | | llvm-svn: 118034
OpenPOWER on IntegriCloud