summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-071-1/+2
| | | | | | | | 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
* Add BlocksAttr assert on __block specificFariborz Jahanian2010-12-061-1/+6
| | | | | | routines. llvm-svn: 121007
* 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
* 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
* 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
* Move isNearlyEmpty out into the ASTContext so it can be called from CodeGen ↵Anders Carlsson2010-11-251-0/+5
| | | | | | as well. llvm-svn: 120137
* Switch a lot of call-sites over to using the new value-kind calculations.John McCall2010-11-241-1/+1
| | | | llvm-svn: 120084
* Fixes synthesis of type for the object which holds info.Fariborz Jahanian2010-11-171-0/+7
| | | | | | about a __block cxx object. llvm-svn: 119411
* 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
* 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
* Generalize ASTContext::areCompatibleVectorTypes to handle new Neon vector types.Bob Wilson2010-11-121-6/+7
| | | | llvm-svn: 118901
* Add a variant of GCC-style vector types for ARM NEON.Bob Wilson2010-11-101-11/+11
| | | | | | | | | 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
* 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
* Provide a precise builtin declaration for objc_msgSendFariborz Jahanian2010-11-081-0/+6
| | | | | | to avoid a bogus warning. Fixes //rdar: //8632525 llvm-svn: 118451
* Remove broken support for variadic templates, along with the variousDouglas Gregor2010-11-071-7/+5
| | | | | | | | | | | | | 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
* 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
* Restore patch for PR8453 which was undone in r117829Fariborz Jahanian2010-11-011-20/+33
| | | | | | (was project bugs). llvm-svn: 117951
* Revert r117678, "Qualified 'id' should implement all of static class ↵Daniel Dunbar2010-10-301-33/+20
| | | | | | type's", it breaks things. llvm-svn: 117829
* Qualified 'id' should implement all of static class type'sFariborz Jahanian2010-10-291-20/+33
| | | | | | | | protocols, including those added to class, super class and categories; otherewise issue a warning. This fixes pr8453. llvm-svn: 117678
* Initialize the ASTMutationListener. Thanks goes to Abramo Bagnara!Argyrios Kyrtzidis2010-10-281-1/+1
| | | | llvm-svn: 117541
* No really, we don't have a retain/release system for statements/expressionsJohn McCall2010-10-261-13/+6
| | | | | | anymore. llvm-svn: 117357
* When de-serializing a type that is supposed to be canonical, callDouglas Gregor2010-10-261-22/+23
| | | | | | | | | | | | | getCanonicalType() to make sure that the type we got back is actually canonical. This is the case for most types, which always build a canonical type when given canonical components. However, some types that involve expressions in their canonicalization (e.g., array types with dependent sizes) don't always build canonical types from canonical components, because there is no such thing as a "canonical" expression. Therefore, we do this extra mapping to ensure that the canonical types we store are actually canonical. llvm-svn: 117344
* Implement GNU C extension: two types are compatible if they appearPeter Collingbourne2010-10-241-2/+46
| | | | | | | as a function argument, one of the types is a transparent union type and the other type is compatible with a union member llvm-svn: 117243
* Put the mechanism in place to track modifications in an AST entity that were ↵Argyrios Kyrtzidis2010-10-241-0/+3
| | | | | | | | | | | | committed after its initial creation/deserialization and store the changes in a chained PCH. The idea is that the AST entities call methods on the ASTMutationListener to give notifications of changes; the PCHWriter implements the ASTMutationListener interface and stores the incremental changes of the updated entity. WIP llvm-svn: 117235
* Add some infrastructure for dealing with expressions of 'placeholder' type,John McCall2010-10-121-4/+4
| | | | | | | i.e. expressions with an internally-convenient type which should not be appearing in generally valid, complete ASTs. llvm-svn: 116281
* IRgen/Obj-C: Fix encoding of "long double".Daniel Dunbar2010-10-111-1/+1
| | | | | | - The mind boggles. llvm-svn: 116226
* Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor2010-10-081-2/+2
| | | | | | bit by me). llvm-svn: 116122
* __attribute__((aligned(n))) directly specifies the alignment of a declarationJohn McCall2010-10-081-2/+20
| | | | | | | | | | unless it's a non-packed field, in which case it can only increase the alignment. [[align]] effectively works the same way for well-formed code (because it's ill-formed for [[align]] to decrease alignment ever). Fixes rdar://problem/8335865 llvm-svn: 116070
* Fix a crash encoding ivars of vector types and Fariborz Jahanian2010-10-071-2/+9
| | | | | | to match gcc's encoding. Fixes //rdar: // 8519948. llvm-svn: 115980
* enhance ASTContext::GetBuiltinType to return a bitmask indicating which ↵Chris Lattner2010-10-011-12/+29
| | | | | | | | arguments are required to be ICE's. No clients of this new functionality yet! llvm-svn: 115366
* random cleanups, no functionality change.Chris Lattner2010-10-011-41/+42
| | | | llvm-svn: 115361
* Implement the C++0x "trailing return type" feature, e.g.,Douglas Gregor2010-10-011-0/+1
| | | | | | | | | | auto f(int) -> int from Daniel Wallin! (With a few minor bug fixes from me). llvm-svn: 115322
* Various builtins a require an integer constant. Not providingChris Lattner2010-10-011-1/+8
| | | | | | | | | | | | one results in an obscure error from the backend that doesn't make sense. Capture this information in the .def files for builtins with a new "I" modifier letter indicating the an argument needs to be an ICE. Nothing uses this yet, but sema will eventually enforce this (eliminating some special cases from semachecking.cpp) and codegen will use this to force an ICE value, preventing backend error messages. llvm-svn: 115302
* Centralize the management of CXXRecordDecl::DefinitionData's Empty bitDouglas Gregor2010-09-281-4/+0
| | | | | | | | | | | | in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>. This reinstates r114924, with one crucial bug fix: we were ignoring the implicit fields created by anonymous structs/unions when updating the bits in CXXRecordDecl, which means that a class/struct containing only an anonymous class/struct would be considered "empty". Hilarity follows. llvm-svn: 114980
* Temporarily revert 114929 114925 114924 114921. It looked like they (or at leastBill Wendling2010-09-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | one of them) was causing a series of failures: http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518 svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114929 into '.': U include/clang/Sema/Sema.h U include/clang/AST/DeclCXX.h U lib/Sema/SemaDeclCXX.cpp U lib/Sema/SemaTemplateInstantiateDecl.cpp U lib/Sema/SemaDecl.cpp U lib/Sema/SemaTemplateInstantiate.cpp U lib/AST/DeclCXX.cpp svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114925 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/AST/DeclCXX.cpp svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114924 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/Sema/SemaDecl.cpp G lib/AST/DeclCXX.cpp U lib/AST/ASTContext.cpp svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114921 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/Sema/SemaDecl.cpp G lib/AST/DeclCXX.cpp llvm-svn: 114933
* Centralize the management of CXXRecordDecl::DefinitionData's Empty bitDouglas Gregor2010-09-271-4/+0
| | | | | | in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>. llvm-svn: 114924
* Patch implements passing arrays to functions expectingFariborz Jahanian2010-09-241-2/+49
| | | | | | vla. Implements pr7827. llvm-svn: 114737
* Implement -Wpadded and -Wpacked.Argyrios Kyrtzidis2010-09-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Wpadded warns when undesired padding is introduced in a struct. (rdar://7469556) -Wpacked warns if a struct is given the packed attribute, but the packed attribute has no effect on the layout or the size of the struct. Such structs may be mis-aligned for little benefit. The warnings are emitted at the point where layout is calculated, that is at RecordLayoutBuilder. To avoid calculating the layouts of all structs regardless of whether they are needed or not, I let the layouts be lazily constructed when needed. This has the disadvantage that the above warnings will be emitted only when they are used for IR gen, and not e.g with -fsyntax-only: $ cat t.c struct S { char c; int i; }; void f(struct S* s) {} $ clang -fsyntax-only -Wpadded t.c $ clang -c -Wpadded t.c -o t.o t.c:3:7: warning: padding struct 'struct S' with 3 bytes to align 'i' [-Wpadded] int i; ^ 1 warning generated. This is a good tradeoff between providing the warnings and not calculating layouts for all structs in case the user has enabled a couple of rarely used warnings. llvm-svn: 114544
* Transfer calling-convention attributes down to member function pointers.Douglas Gregor2010-09-011-0/+9
| | | | llvm-svn: 112715
* Split ObjCInterfaceDecl::ReferencedProtocols into two lists: ↵Ted Kremenek2010-09-011-3/+5
| | | | | | | | | | | | | ReferencedProtocols and AllReferencedProtocols. ReferencedProtocols (and thus protocol_begin(), protocol_end()) now only contains the list of protocols that were directly referenced in an @interface declaration. 'all_referenced_protocol_[begin,end]()' now returns the set of protocols that were referenced in both the @interface and class extensions. The latter is needed for semantic analysis/codegen, while the former is needed to maintain the lexical information of the original source. Fixes <rdar://problem/8380046>. llvm-svn: 112691
* Heap-allocate the attribute vectors inDouglas Gregor2010-08-301-1/+26
| | | | | | | | | ASTContext::DeclAttrs. Otherwise, iterators will go stale when the DenseMap reallocates, which can cause crashes when, e.g., looping over the attributes in a template to instantiate them and add the results to the instantiation of that template. llvm-svn: 112488
* Don't recurse twice when we can recurse onceDouglas Gregor2010-08-271-3/+4
| | | | llvm-svn: 112246
* Revert r112043, static volatiles are removed by the optimizer. Thanks Chris!Argyrios Kyrtzidis2010-08-251-4/+0
| | | | llvm-svn: 112112
* Make sure volatile variables are emitted even if static. Fixes rdar://8315219Argyrios Kyrtzidis2010-08-251-0/+4
| | | | llvm-svn: 112043
* Detabify.Eli Friedman2010-08-221-2/+2
| | | | llvm-svn: 111768
* The ARM C++ ABI is sufficiently different from the Itanium C++ ABI thatJohn McCall2010-08-211-2/+6
| | | | | | | it deserves its own enumerator. Obviously the implementations should closely follow the Itanium ABI except in cases of divergence. llvm-svn: 111749
OpenPOWER on IntegriCloud