summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Make the dumper safe against null declaration names.John McCall2010-11-301-0/+3
| | | | llvm-svn: 120421
* Take John McCall's suggestion and fix this silly gcc warnings in a way thatNick Lewycky2010-11-301-0/+2
| | | | | | Doug isn't likely to rip back out. llvm-svn: 120409
* I hate pointless default statementsDouglas Gregor2010-11-301-1/+0
| | | | llvm-svn: 120402
* Add a default clause to avoid this GCC warning:Nick Lewycky2010-11-301-0/+1
| | | | | | Type.cpp:1000: warning: control reaches end of non-void function llvm-svn: 120376
* Incomplete enum types not to be treated as integer typeFariborz Jahanian2010-11-291-4/+12
| | | | | | | when checking for integer signed/unsigned-ness. PR8694, // rdar://8707031 llvm-svn: 120345
* I hate default statementsDouglas Gregor2010-11-291-1/+0
| | | | llvm-svn: 120293
* Teach the ASTImporter how to create CXXMethodDecls. Somehow, this case was ↵Douglas Gregor2010-11-291-0/+7
| | | | | | missed previously llvm-svn: 120289
* Look through parentheses when deciding whether an expr is a temporary ↵Anders Carlsson2010-11-281-4/+4
| | | | | | object. Fixes PR8683. llvm-svn: 120247
* Move isNearlyEmpty out into the ASTContext so it can be called from CodeGen ↵Anders Carlsson2010-11-255-30/+40
| | | | | | as well. llvm-svn: 120137
* Remove the PrimaryBaseInfo class.Anders Carlsson2010-11-241-2/+3
| | | | llvm-svn: 120134
* Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.Anders Carlsson2010-11-243-4/+4
| | | | llvm-svn: 120133
* Use the newly added function in ASTRecordLayoutBuilder.Anders Carlsson2010-11-241-38/+3
| | | | llvm-svn: 120131
* Fix typo.Anders Carlsson2010-11-241-2/+2
| | | | llvm-svn: 120130
* Add CXXRecordDecl::getIndirectPrimaryBases.Anders Carlsson2010-11-241-0/+48
| | | | llvm-svn: 120129
OpenPOWER on IntegriCloud