summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce ObjCMessageExpr::getReceiverRange() to get the source range of the ↵Argyrios Kyrtzidis2010-12-101-1/+17
| | | | | | receiver. llvm-svn: 121517
* Keep the source location of the selector in ObjCMessageExpr.Argyrios Kyrtzidis2010-12-101-10/+16
| | | | llvm-svn: 121516
* Added ParenType type node.Abramo Bagnara2010-12-105-1/+58
| | | | llvm-svn: 121488
* It's kindof silly that ExtQuals has an ASTContext&, and we can use thatJohn McCall2010-12-105-143/+126
| | | | | | | | | | space better. Remove this reference. To make that work, change some APIs (most importantly, getDesugaredType()) to take an ASTContext& if they need to return a QualType. Simultaneously, diminish the need to return a QualType by introducing some useful APIs on SplitQualType, which is just a std::pair<const Type *, Qualifiers>. llvm-svn: 121478
* Move the "volatile" bit into QualType's "fast" qualifier set,Douglas Gregor2010-12-101-11/+0
| | | | | | | | increasing the required type alignment from 8 to 16. This provides a 2.5% speedup for -fsyntax-only on a token-cached Cocoa.h, while only increasing memory consumption in the ASTContext by 0.8%. llvm-svn: 121474
* Treat visibility on an enclosing namespace as a non-explicit source ofJohn McCall2010-12-101-0/+14
| | | | | | | | | | | visibility. Fixes PR8713. I've disabled a test which was testing that you can #pragma pop visibility to get out of a namespace's visibility attribute. We should probably just diagnose that as an error unless it's instrumental to someone's system headers. llvm-svn: 121459
* When an "inline" declaration was followed by a definition not markedDouglas Gregor2010-12-091-19/+18
| | | | | | | | | | | | | "inline", we weren't giving the definition weak linkage because the "inline" bit wasn't propagated. This was a longstanding FIXME that, somehow, hadn't triggered a bug in the wild. Fix this problem by tracking whether any declaration was marked "inline", and clean up the semantics of GNU's "extern inline" semantics calculation based on this change. Fixes <rdar://problem/8740363>. llvm-svn: 121373
* Fix another unnecessary-struct-padding issue.Argyrios Kyrtzidis2010-12-091-1/+10
| | | | llvm-svn: 121352
* Before determining the effect the alignment of base struct will have in the ↵Argyrios Kyrtzidis2010-12-091-2/+9
| | | | | | | | | | aligment of the sub-struct, take into account if the sub-struct is packed and its maximum field alignment. Fixes rdar://8745206 llvm-svn: 121335
* Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet2010-12-086-42/+2
| | | | | | BinaryTypeTraitExpr. llvm-svn: 121298
* Fix two thinkos and add a test for importing the AST of a categoryDouglas Gregor2010-12-081-2/+3
| | | | | | implementation. llvm-svn: 121263
* Implement AST import for Objective-C property implementationsDouglas Gregor2010-12-071-0/+82
| | | | | | (@synthesize and @dynamic). llvm-svn: 121159
* Cast CachedLinkage to linkage to avoid "comparison between signed and ↵Benjamin Kramer2010-12-071-5/+3
| | | | | | unsigned integer" warnings. llvm-svn: 121143
* Implement ASTImporter support for Objective-C category implementations.Douglas Gregor2010-12-071-0/+36
| | | | llvm-svn: 121139
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-074-10/+11
| | | | | | | | zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. llvm-svn: 121121
* Extern the ASTImporter to import @implementation declarations.Douglas Gregor2010-12-071-2/+76
| | | | llvm-svn: 121097
* Fix enumerator not handled in switch warnings.Francois Pichet2010-12-071-2/+2
| | | | llvm-svn: 121084
* Kill FullExpr, as it was not, in fact, used anywhere in the code base.John McCall2010-12-072-46/+0
| | | | | | | I'm not opposed to the idea in concept, but there's no point in preserving abortive experiments. llvm-svn: 121083
* Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet2010-12-075-1/+37
| | | | | | New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. llvm-svn: 121074
* Use the unused merge() function, fixing an minor, unintended change IDouglas Gregor2010-12-061-9/+5
| | | | | | introduced in r121023. llvm-svn: 121025
* Re-implement caching for the linkage calculation of declarations.Douglas Gregor2010-12-061-31/+83
| | | | | | | | | | | | | | | | | | | | | | My previous attempt at solving the compile-time problem with many redeclarations of the same entity cached both linkage and visibility, while this patch only tackles linkage. There are several reasons for this difference: - Linkage is a language concept, and is evaluated many times during semantic analysis and codegen, while visibility is only a code-generation concept that is evaluated only once per (unique) declaration. Hence, we *must* optimize linkage calculations but don't need to optimize visibility computation. - Once we know the linkage of a declaration, subsequent redeclarations can't change that linkage. Hence, cache invalidation is far simpler than for visibility, where a later redeclaration can completely change the visibility. - We have 3 spare bits in Decl to store the linkage cache, so the cache doesn't increase the size of declarations. With the visibility+linkage cache, NamedDecl got larger. llvm-svn: 121023
* Revert r120808, my previous implementation of caching for the linkageDouglas Gregor2010-12-063-107/+2
| | | | | | | | | and visibility of declarations, because it was extremely messy and it increased the size of NamedDecl. An improved implementation is forthcoming. llvm-svn: 121012
* Add BlocksAttr assert on __block specificFariborz Jahanian2010-12-061-1/+6
| | | | | | routines. llvm-svn: 121007
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-069-34/+29
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* Clarify the logic for when to build an overloaded binop. In particular,John McCall2010-12-061-1/+1
| | | | | | | | | build one when either of the operands calls itself type-dependent; previously we were building when one of the operand types was dependent, which is not always the same thing and which can lead to unfortunate inconsistencies later. Fixes PR8739. llvm-svn: 120990
* More anonymous struct/union redesign. This one deals with anonymous field ↵Francois Pichet2010-12-042-6/+16
| | | | | | | | | | | | | | | | used in a constructor initializer list: struct X { X() : au_i1(123) {} union { int au_i1; float au_f1; }; }; clang will now deal with au_i1 explicitly as an IndirectFieldDecl. llvm-svn: 120900
* Make IgnoreParenLValueCasts skip __extension__ nodes like IgnoreParens().John McCall2010-12-041-3/+11
| | | | | | Abramo noticed this. llvm-svn: 120898
* Silence "comparison between signed and unsigned integer expressions" warnings.Benjamin Kramer2010-12-041-4/+4
| | | | llvm-svn: 120897
* Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall2010-12-042-6/+51
| | | | | | | | | | | | | | | | | | | not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. llvm-svn: 120890
* Diagnose when accessing property in a class method andFariborz Jahanian2010-12-031-4/+6
| | | | | | | no property accessor class method to be found, instead of crashing in IRGen. // rdar://8703553 llvm-svn: 120855
* Added struct/class syntactic info for c++0x scoped enum.Abramo Bagnara2010-12-033-8/+14
| | | | llvm-svn: 120828
* Implement caching for the linkage and visibility calculations ofDouglas Gregor2010-12-033-2/+107
| | | | | | | | | | | | | | | | | | | | | | | | | declarations. The motivation for this patch is that linkage/visibility computations are linear in the number of redeclarations of an entity, and we've run into a case where a single translation unit has > 6500 redeclarations of the same (unused!) external variable. Since each redeclaration involves a linkage check, the resulting quadratic behavior makes Clang slow to a crawl. With this change, a simple test with 512 redeclarations of a variable syntax-checks ~20x faster than before. That said, I hate this change, and will probably end up reverting it in a few hours. Reasons to hate it: - It makes NamedDecl larger, since we don't have enough free bits in Decl to squeeze in the extra information about caching. - There are way too many places where we need to invalidate this cache, because the visibility of a declaration can change due to redeclarations (!). Despite self-hosting and passing the testsuite, I have no confidence that I've found all of places where this cache needs to be invalidated. llvm-svn: 120808
* Merge transparent union types using member's unqualified typePeter Collingbourne2010-12-021-1/+1
| | | | llvm-svn: 120736
* Merge transparent union types using member's canonical param typePeter Collingbourne2010-12-021-1/+1
| | | | llvm-svn: 120729
* Fix inverted return value in the ASTImporter. No matter how much LLVMDouglas Gregor2010-12-021-2/+2
| | | | | | code I wrote, returning "true" on error is still unnatural. llvm-svn: 120727
* IR Gen. part of API support for __block cxxFariborz Jahanian2010-12-021-2/+2
| | | | | | | | objects imported into blocks. //rdar://8594790. Will have a test case coming (as well as one sent to llvm test suite). llvm-svn: 120713
* Tweaks.John McCall2010-12-021-1/+1
| | | | llvm-svn: 120701
* ObjC support in the XML dumper.John McCall2010-12-021-1/+158
| | | | llvm-svn: 120700
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-026-95/+35
| | | | | | | | ObjCPropertyRefExpr into the latter. llvm-svn: 120643
* Eliminate two uses of NDEBUG in headers that cause different symbolsDouglas Gregor2010-12-022-16/+2
| | | | | | to be available in debug vs. release builds. llvm-svn: 120629
* Extend ExternalASTSource with the ability to lazily complete theDouglas Gregor2010-12-011-1/+31
| | | | | | | | | | | | | definition of an Objective-C class. Unlike with C/C++ classes, we don't have a well-defined point in Sema where Objective-C classes are checked for completeness, nor do we need to involve Sema when completing a class. Therefore, we take the appropriate of having the external AST source mark a particular Objective-C class as having an external declaration; when using one of the accessors of an Objective-C class that has an external declaration, we request that the external AST source fill in the Objective-C class definition. llvm-svn: 120627
* Sema/AST work for capturing copy init expressionFariborz Jahanian2010-12-011-0/+14
| | | | | | | to be used in copy helper synthesis of __block variables. wip. llvm-svn: 120617
* AST printing for scoped enumerations and enumerations with a fixed ↵Douglas Gregor2010-12-011-3/+16
| | | | | | underlying type, from Daniel Wallin llvm-svn: 120576
* Eliminate vtables from the Type hierarchy.John McCall2010-12-011-134/+164
| | | | llvm-svn: 120562
* Restore the lvalue-to-rvalue conversion patch with a minimal fix.John McCall2010-12-011-0/+2
| | | | llvm-svn: 120555
* Implement AST import support for class template specializations.Douglas Gregor2010-12-011-35/+363
| | | | llvm-svn: 120523
* Implement basic AST importing and merging support for class templateDouglas Gregor2010-11-301-5/+359
| | | | | | declarations. llvm-svn: 120448
* Eliminate more pointless default statementsDouglas Gregor2010-11-301-5/+16
| | | | llvm-svn: 120446
* L-value to r-value conversion is not ready for prime-time.John McCall2010-11-301-2/+0
| | | | llvm-svn: 120433
* Introduce an r-value to l-value cast kind. I'm not promising anythingJohn McCall2010-11-301-0/+2
| | | | | | about the reliability of this yet. llvm-svn: 120422
OpenPOWER on IntegriCloud