summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Create a new InjectedClassNameType to represent bare-word references to the John McCall2010-03-101-1/+58
| | | | | | | | | | | | | injected class name of a class template or class template partial specialization. This is a non-canonical type; the canonical type is still a template specialization type. This becomes the TypeForDecl of the pattern declaration, which cleans up some amount of code (and complicates some other parts, but whatever). Fixes PR6326 and probably a few others, primarily by re-establishing a few invariants about TypeLoc sizes. llvm-svn: 98134
* Allocate ASTRecordLayout objects using the allocator associated with ASTContext.Ted Kremenek2010-03-081-13/+13
| | | | | | | This allows them to be allocated using a BumpPtrAllocated in the common case. llvm-svn: 97978
* Patch to build qualifier on objective-cFariborz Jahanian2010-03-051-3/+5
| | | | | | pointer types. Fixes radar 7626768. llvm-svn: 97847
* Eliminate the static map of overridden C++ methods, which was going toDouglas Gregor2010-03-021-0/+80
| | | | | | come back to bite us at some point. llvm-svn: 97607
* Split out types that are non-canonical unless dependent as their ownJohn McCall2010-03-011-3/+1
| | | | | | | | | | | category. Use this in a few places to eliminate unnecessary TST cases and do some future-proofing. Provide terrible manglings for typeof. Mangle decltype with some hope of accuracy. Our manglings for some of the cases covered in the testcase are different from gcc's, which I've raised as an issue with the ABI list. llvm-svn: 97523
* Forgot to include nested protocols in collection, resulting inFariborz Jahanian2010-02-251-1/+3
| | | | | | bogus warning. Fixes radar 7682116. llvm-svn: 97157
* When a reference to a field of a struct/union/class is passed to theCharles Davis2010-02-231-0/+6
| | | | | | | __alignof__ operator, make sure to take into account the packed alignment of the struct/union/class itself. Matches GCC's behavior and fixes PR6362. llvm-svn: 96884
* More support for ivars in class extension.Fariborz Jahanian2010-02-231-0/+8
| | | | llvm-svn: 96850
* Eliminate the default arguments to ASTContext::getFunctionType(),Douglas Gregor2010-02-211-2/+6
| | | | | | | | fixing up a few callers that thought they were propagating NoReturn information but were in fact saying something about exception specifications. llvm-svn: 96766
* Patch removes IVars list from ObjCInterfaceDecl andFariborz Jahanian2010-02-191-7/+14
| | | | | | instead relies on their DeclContext for iteration, etc. llvm-svn: 96638
* Make the various type-decl Types (and their associated ASTContext routines)John McCall2010-02-161-7/+8
| | | | | | accept const decls. llvm-svn: 96325
* Patch to fix a warning which exposed a bug in buildingFariborz Jahanian2010-02-121-12/+12
| | | | | | | a qualified objective-c pointer type. Fixes radar 7638810. (Also removes a FIXME). llvm-svn: 96003
* Fix a latent bug found by Ahmed Charles, where we were callingDouglas Gregor2010-02-121-1/+1
| | | | | | ASTContext::getFunctionType with the wrong set of arguments. llvm-svn: 95986
* Have ~ASTContext() delete StoredDeclsMap (internal to DeclContext) byTed Kremenek2010-02-111-0/+4
| | | | | | | | | storing the set of StoredDeclsMaps in an internal vector of void*. This isn't an ideal solution, but for the time being this fixes a major memory leak with these DenseMaps not being freed. Fixes: <rdar://problem/7634755> llvm-svn: 95861
* Eliminate a bunch of unnecessary ASTContexts from members functions ofDouglas Gregor2010-02-111-6/+6
| | | | | | Decl subclasses. No functionality change. llvm-svn: 95841
* Eliminate the ASTContext parameter from RecordDecl::getDefinition()Douglas Gregor2010-02-111-2/+2
| | | | | | | and CXXRecordDecl::getDefinition(); it's totally unnecessary. No functionality change. llvm-svn: 95836
* Reverse a partial fix patch for radar 7214820. It broke some code andFariborz Jahanian2010-02-101-16/+3
| | | | | | I don't have time to refix it for now. llvm-svn: 95733
* Eliminate a pointer of storage in each ObjCInterfaceType andDouglas Gregor2010-02-081-7/+15
| | | | | | | ObjCObjectPointerType AST node by allocating the list of protocols after the type node itself. No functionality change. llvm-svn: 95597
* Merge block/function pointer types with objc's __weakFariborz Jahanian2010-02-081-3/+16
| | | | | | | | | attribute properly and avoid bogus warning. This is an objective-c fix only. objective-c++ follows different code pass and requires separate fix (which will come at a later time). Fixes radar 7214820. llvm-svn: 95571
* Standardize the parsing of function type attributes in a way thatJohn McCall2010-02-051-15/+5
| | | | | | | | | | | | follows (as conservatively as possible) gcc's current behavior: attributes written on return types that don't apply there are applied to the function instead, etc. Only parse CC attributes as type attributes, not as decl attributes; don't accepet noreturn as a decl attribute on ValueDecls, either (it still needs to apply to other decls, like blocks). Consistently consume CC/noreturn information throughout codegen; enforce this by removing their default values in CodeGenTypes::getFunctionInfo(). llvm-svn: 95436
* Always start tag definitions before completing them. Assert same.John McCall2010-02-051-0/+5
| | | | | | Fixes latent and not-so-latent objc++ and blocks++ bugs. llvm-svn: 95340
* First stage of adding AltiVec supportJohn Thompson2010-02-051-8/+12
| | | | llvm-svn: 95335
* Fix an obscure crash found in the Boost.MPL test suite, along with aDouglas Gregor2010-02-041-16/+58
| | | | | | | | | | | | | | | | | | | | | | | | ton of potential crashes of the same kind. The fundamental problem is that type creation was following a dangerous pattern when using its FoldingSets: 1) Use FindNodeOrInsertPos to see if the type is available 2) If not, and we aren't looking at a canonical type, build the canonical type 3) Build and insert the new node into the FoldingSet The problem here is that building the canonical type can, in very rare circumstances, force the hash table inside the FoldingSet to reallocate. That invalidates the insertion position we computed in step 1, and in step 3 we end up inserting the new node into the wrong place. BOOM! I've audited all of ASTContext, fixing this problem everywhere I found it. The vast majority of wrong code was C++-specific (and *ahem* written by me), so I also audited other major folding sets in the C++ code (e.g., template specializations), but found no other instances of this problem. llvm-svn: 95315
* Allow calling convention attributes to apply to types. Patch by Chip Davis!John McCall2010-02-041-3/+3
| | | | llvm-svn: 95291
* Define two types to be "compatible" in C++ if they are the same, andDouglas Gregor2010-02-031-9/+6
| | | | | | | remove some age-old FIXMEs and C++ workarounds within the type-compatibility logic. llvm-svn: 95249
* When determining whether a function without a prototype is compatibleDouglas Gregor2010-02-031-0/+6
| | | | | | | with a function with a prototype, treat parameters of enumeration type based on the enumeration type's promotion type. llvm-svn: 95238
* Change the return type of ASTContext::getDeclAlignInBytes() to CharUnits and,Ken Dyck2010-01-271-3/+3
| | | | | | | now that the "InBytes" part of the name is implied by the return type, rename it to getDeclAlign(). llvm-svn: 94681
* Patch to add 'volatile' to first argument of allFariborz Jahanian2010-01-261-0/+3
| | | | | | | | sync compare_and_swap to match them with gcc. It also fixes a few incorrect argument defitions. (fixes radar 7540291). llvm-svn: 94607
* Correct cut-and-paste error in doxygen comment for newly introducedKen Dyck2010-01-261-1/+1
| | | | | | getTypeAlignInChars(). llvm-svn: 94553
* Add getTypeAlignInChars() for use in code that works in alignments in characterKen Dyck2010-01-261-0/+9
| | | | | | units. llvm-svn: 94552
* Allocate the 'Protocols' array in ObjCInterfaceType andTed Kremenek2010-01-211-2/+3
| | | | | | | | ObjCObjectPointerType using the allocator associated with ASTContext. Not only does this fix a memory leak, but it also makes these arrays BumpPtrAllocated (in the typical case). llvm-svn: 94090
* Give UnresolvedSet the ability to store access specifiers for each declaration.John McCall2010-01-201-3/+3
| | | | | | | Change LookupResult to use UnresolvedSet. Also extract UnresolvedSet into its own header and make it templated over an inline capacity. llvm-svn: 93959
* Encoding calling conventions in the type system, from Charles Davis!Douglas Gregor2010-01-181-29/+64
| | | | llvm-svn: 93726
* Fix the CodeGen half of PR5911 by changing reference initialization toChandler Carruth2010-01-121-4/+2
| | | | | | | correctly look through arrays to see cv-qualifiers. Also enhances the routine for doing this to preserve more type sugaring for diagnostics. llvm-svn: 93252
* Change return type of getObjCEncodingTypeSize() to CharUnits as the units ↵Ken Dyck2010-01-111-6/+6
| | | | | | are in characters. llvm-svn: 93171
* Roll out ASTContext::getTypeSizeInChars(), replacing instances ofKen Dyck2010-01-111-22/+28
| | | | | | | | | | "ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits ones as appropriate. Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType, fromQuantity(), and getQuantity() for clarity. llvm-svn: 93153
* Revert r92318. Instead fix the analyzer: do not call Zhongxing Xu2010-01-051-7/+0
| | | | | | ASTContext::hasSameUnqualifiedType() when one of the type is VariableArrayType. llvm-svn: 92723
* if an arraytype is canonical, then its element is guaranteed to be canonical.Zhongxing Xu2010-01-051-1/+2
| | | | llvm-svn: 92715
* The element type should also be canonicalized. Add a case for VariableArrayType.Zhongxing Xu2009-12-301-1/+7
| | | | llvm-svn: 92318
* Correctly refer to element CVR qualifications when determining if a type isChandler Carruth2009-12-291-0/+30
| | | | | | | | | | more or less cv-qualified than another during implicit conversion and overload resolution ([basic.type.qualifier] p5). Factors the logic out of template deduction and into the ASTContext so it can be shared. This fixes several aspects of PR5542, but not all of them. llvm-svn: 92248
* Get rid of FixedWidthIntType, as suggested by Chris and Eli.Anders Carlsson2009-12-291-28/+0
| | | | llvm-svn: 92246
* Remove some dead variables clang-analyzer found.Benjamin Kramer2009-12-251-2/+0
| | | | llvm-svn: 92162
* Tidy up ~ASTContext a bit by turning orphan compound statements intoTed Kremenek2009-12-231-25/+24
| | | | | | | | for loops. Also do not manually free the Type objects when the 'FreeMemory' flag is set, as they will be deallocated when the BumpPtrAllocator is destroyed. llvm-svn: 92047
* Move the implementation of ASTContext::getTypeSizeInChars() to the .cpp file toKen Dyck2009-12-221-0/+10
| | | | | | avoid #including CharUnits.h in ASTContext.h. llvm-svn: 91903
* Factor operator new declaration checking out into a separate function.Anders Carlsson2009-12-121-1/+1
| | | | llvm-svn: 91189
* Clean up enum constants so that they're finally sane. Fixes PR3173 and aEli Friedman2009-12-101-1/+1
| | | | | | recently introduced crash. llvm-svn: 91070
* First pass at implementing C++ enum semantics: calculate (and store) anJohn McCall2009-12-091-1/+7
| | | | | | | | | | | | "integer promotion" type associated with an enum decl, and use this type to determine which type to promote to. This type obeys C++ [conv.prom]p2 and is therefore generally signed unless the range of the enumerators forces it to be unsigned. Kills off a lot of false positives from -Wsign-compare in C++, addressing rdar://7455616 llvm-svn: 90965
* Implemented an implicit conversion from "noreturn" function types (andDouglas Gregor2009-12-091-20/+30
| | | | | | | | | | | | | | pointers thereof) to their corresponding non-noreturn function types. This conversion is considered an exact match for overload-resolution purposes. Note that we are a little more strict that GCC is, because we encode noreturn in the type system, but that's a Good Thing (TM) because it does not allow us to pretend that potentially-returning function pointers are non-returning function pointers. Fxies PR5620. llvm-svn: 90913
* Move key functions to a separate map.Anders Carlsson2009-12-071-0/+14
| | | | llvm-svn: 90745
* DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated ↵John McCall2009-12-071-17/+17
| | | | | | | | | | | | | | | | | | | | | variables, but the results are imperfect. For posterity, I did: cat <<EOF > $cmdfile s/DeclaratorInfo/TypeSourceInfo/g s/DInfo/TInfo/g s/TypeTypeSourceInfo/TypeSourceInfo/g s/SourceTypeSourceInfo/TypeSourceInfo/g EOF find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \; find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \; find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \; llvm-svn: 90743
OpenPOWER on IntegriCloud