summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-77/+90
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Teach ASTContext and Preprocessor to hold on to references to the sameDouglas Gregor2011-09-011-1/+1
| | | | | | | | | LangOptions, rather than making distinct copies of LangOptions. Granted, LangOptions doesn't actually get modified, but this will eventually make it easier to construct ASTContext and Preprocessor before we know all of the LangOptions. llvm-svn: 138959
* objc - fix up the builtin type for objc_assign_ivar.Fariborz Jahanian2011-08-231-1/+5
| | | | | | // rdar://9362887. llvm-svn: 138412
* Fix a bug in objc @encoding of C++ classes.Argyrios Kyrtzidis2011-08-221-1/+3
| | | | llvm-svn: 138235
* Fix else style. No functionality change intended.Chad Rosier2011-08-171-8/+4
| | | | llvm-svn: 137896
* Fix typo.Francois Pichet2011-08-141-4/+4
| | | | llvm-svn: 137585
* Implement function template specialization at class scope extension in ↵Francois Pichet2011-08-141-1/+20
| | | | | | | | | | | | | | | | | Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization. Example: template <class T> class A { public: template <class U> void f(U p) { } template <> void f(int p) { } // <== class scope specialization }; This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code. BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error. llvm-svn: 137573
* metadata generated by the compiler does not include the weak Fariborz Jahanian2011-08-121-0/+1
| | | | | | attribute of a property. patch by Remy Demarest fixes it. llvm-svn: 137509
* Switch the __int128_t and __uint128_t types over to predefined typesDouglas Gregor2011-08-121-1/+29
| | | | | | | in the AST format, which are built lazily by the ASTContext when requested. llvm-svn: 137437
* Switch the Objective-C 'SEL' type over to a predefined type in theDouglas Gregor2011-08-121-6/+11
| | | | | | | AST file format, lazily generating the actual declaration in ASTContext as needed. llvm-svn: 137434
* Switch the Objective-C 'Class' type over to a predefined type in theDouglas Gregor2011-08-121-4/+14
| | | | | | | AST file format, lazily generating the actual declaration in ASTContext as needed. llvm-svn: 137431
* Move the creation of the predefined typedef for Objective-C's 'id'Douglas Gregor2011-08-121-4/+13
| | | | | | | | | type over into the AST context, then make that declaration a predefined declaration in the AST format. This ensures that different AST files will at least agree on the (global) declaration ID for 'id', and eliminates one of the "special" types in the AST file format. llvm-svn: 137429
* Encapsulate the Objective-C id/Class/SEL "redefinition" types inDouglas Gregor2011-08-111-3/+0
| | | | | | | | | ASTContext with accessors/mutators. The only functional change is that the AST writer won't bother writing the id/Class/SEL redefinition type if it hasn't been explicitly set; previously, it ended up being written as a synonym for the built-in id/Class/SEL. llvm-svn: 137349
* Move the creation of the record type for the state of Objective-C fastDouglas Gregor2011-08-091-41/+1
| | | | | | | | enumerations from the ASTContext into CodeGen, so that we don't need to serialize it to AST files. This appears to be the last of the low-hanging fruit for SpecialTypes. llvm-svn: 137124
* Don't serialize the block descriptor or block extended descriptorDouglas Gregor2011-08-091-12/+0
| | | | | | | types to AST files; they're only used by debug info generation anyway, and shouldn't ever exist in the AST anyway. llvm-svn: 137122
* Move the construction of the RecordDecl representing the runtimeDouglas Gregor2011-08-091-43/+1
| | | | | | | | layout of a constant NSString from the ASTContext over to CodeGen, since this is solely CodeGen's responsibility. Eliminates one of the unnecessary "special" types that we serialize. llvm-svn: 137121
* More whitespace and naming fixup. No functionality change.Chad Rosier2011-08-041-2/+2
| | | | llvm-svn: 136944
* Whitespace.Chad Rosier2011-08-041-9/+7
| | | | llvm-svn: 136929
* Fix style and remove obviously redundant code.Chad Rosier2011-08-041-1/+0
| | | | llvm-svn: 136907
* Change ASTContext::getSideTableAllocatedMemory() to use ↵Ted Kremenek2011-07-271-12/+14
| | | | | | llvm::capacity_in_bytes(). llvm-svn: 136235
* After further discussion it has been determined that alignof should report Chad Rosier2011-07-261-4/+1
| | | | | | the preferred alignment. Thus, revert r135934, r135935, and r135940. llvm-svn: 136062
* Allow target to specify about using minimum alignment vs preferred. Takes ↵Chad Rosier2011-07-251-1/+4
| | | | | | | | | care of FIXME: Override "preferred align" for double and long long for ARM apcs-gnu ABI. Also part of rdar://9802874 llvm-svn: 135940
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-16/+16
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.Jordy Rose2011-07-221-17/+4
| | | | | | | | | This was previously not-const only because it has to lazily construct a chain of ivars the first time it is called (and after the chain is invalidated). In practice, all the clients were just const_casting their const Decls; all those now-unnecessary const_casts have been removed. llvm-svn: 135741
* In C99, emit an inline function when encountering an extern redeclaration.Nick Lewycky2011-07-181-1/+1
| | | | | | Fixes PR10233! llvm-svn: 135377
* revert fix for // rdar://9740328Fariborz Jahanian2011-07-121-1/+1
| | | | llvm-svn: 135010
* objc++: Some level of covariance is allowed in ObjC properties.Fariborz Jahanian2011-07-121-0/+4
| | | | | | Make it also available in ObjC++ propeties. // rdar://9740328 llvm-svn: 135001
* Centralize the getCanonicalType() calls in the Itanium C++ manglingDouglas Gregor2011-07-121-0/+25
| | | | | | code so that they only occur in a single place. No functionality change. llvm-svn: 134961
* r134634 causes a failure on MultiSource/Benchmarks/Olden/bh with TEST=nightly,Cameron Zwarich2011-07-071-1/+1
| | | | | | so roll it out. llvm-svn: 134638
* A redeclaration of an inline method in C99 mode should trigger emission of thatNick Lewycky2011-07-071-1/+1
| | | | | | function. Fixes PR10233! llvm-svn: 134634
* Zap a couple unnecessary loops.Eli Friedman2011-07-071-11/+1
| | | | llvm-svn: 134578
* Start switching the AST stats printing to use llvm::errs() instead ofChandler Carruth2011-07-041-26/+27
| | | | | | fprintf. There is more cleanup to be done to the AST stats printing... llvm-svn: 134373
* -Fix mistake in ASTContext::getInnerObjCOwnership noticed by DougArgyrios Kyrtzidis2011-07-011-1/+1
| | | | | | | | -Remove unnecessary 'return'. -Remove unnecessary 'if' check (llvm_unreachable make sure attrStr will be non-null) -Add a test of transferring ownership to a reference cast type. llvm-svn: 134285
* [ARC] When casting from a pointer to an objective-c object with known ↵Argyrios Kyrtzidis2011-07-011-0/+19
| | | | | | | | | | | | | | ownership, if the cast type has no ownership specified, implicitly "transfer" the ownership of the cast'ed type to the cast type: id x; static_cast<NSString**>(&x); // Casting as (__strong NSString**). This currently only works for C++ named casts, C casts to follow. llvm-svn: 134273
* Introduce the notion of instantiation dependence into Clang's AST. ADouglas Gregor2011-07-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | type/expression/template argument/etc. is instantiation-dependent if it somehow involves a template parameter, even if it doesn't meet the requirements for the more common kinds of dependence (dependent type, type-dependent expression, value-dependent expression). When we see an instantiation-dependent type, we know we always need to perform substitution into that instantiation-dependent type. This keeps us from short-circuiting evaluation in places where we shouldn't, and lets us properly implement C++0x [temp.type]p2. In theory, this would also allow us to properly mangle instantiation-dependent-but-not-dependent decltype types per the Itanium C++ ABI, but we aren't quite there because we still mangle based on the canonical type in cases like, e.g., template<unsigned> struct A { }; template<typename T> void f(A<sizeof(sizeof(decltype(T() + T())))>) { } template void f<int>(A<sizeof(sizeof(int))>); and therefore get the wrong answer. llvm-svn: 134225
* Preserve that a TemplateName was arrived at by substitutingJohn McCall2011-06-301-22/+79
| | | | | | | | | | | for a template template parameter. Uses to follow. I've also made the uniquing of SubstTemplateTemplateParmPacks use a ContextualFoldingSet as a minor space efficiency. llvm-svn: 134137
* Eliminate most uses of ShallowCollectObjCIvars which requiresFariborz Jahanian2011-06-281-2/+6
| | | | | | | a vector for collection. Use iterators where needed instead. // rdar://6817577 llvm-svn: 134015
* Be more thorough about mangling unresolved types.John McCall2011-06-281-1/+1
| | | | llvm-svn: 134011
* Fix regression with @encode string. rdar://9624314.Argyrios Kyrtzidis2011-06-171-2/+6
| | | | llvm-svn: 133312
* Automatic Reference Counting.John McCall2011-06-151-32/+20
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Eliminate a 'default' case in template argument deduction, where weDouglas Gregor2011-06-151-1/+1
| | | | | | | | | | | | | | | | | | were just punting on template argument deduction for a number of type nodes. Most of them, obviously, didn't matter. As a consequence of this, make extended vector types (via the ext_vector_type attribute) actually work properly for several important cases: - If the attribute appears in a type-id (i.e, not attached to a typedef), actually build a proper vector type - Build ExtVectorType whenever the size is constant; previously, we were building DependentSizedExtVectorType when the size was constant but the type was dependent, which makes no sense at all. - Teach template argument deduction to handle ExtVectorType/DependentSizedExtVectorType. llvm-svn: 133060
* Implement support for C++11 in-class initialization of non-static data members.Richard Smith2011-06-111-6/+12
| | | | llvm-svn: 132878
* Objective-C doesn't consider the use of incomplete types as methodDouglas Gregor2011-05-271-3/+16
| | | | | | | | | | | | | | parameter types to be ill-formed. However, it relies on the completeness of method parameter types when producing metadata, e.g., for a protocol, leading IR generating to crash in such cases. Since there's no real way to tighten down the semantics of Objective-C here without breaking existing code, do something safe but lame: suppress the generation of metadata when this happens. Fixes <rdar://problem/9123036>. llvm-svn: 132171
* Implement a little bit of cleanup and a lot more of the base workAlexis Hunt2011-05-251-1/+13
| | | | | | | | behind implicit moves. We now correctly identify move constructors and assignment operators and update bits on the record correctly. Generation of implicit moves (declarations or definitions) is not yet supported. llvm-svn: 132080
* Properly align UnaryTransformType when allocating itDouglas Gregor2011-05-251-3/+4
| | | | llvm-svn: 132064
* Implement a new type node, UnaryTransformType, designed to represent aAlexis Hunt2011-05-241-0/+18
| | | | | | | | type that turns one type into another. This is used as the basis to implement __underlying_type properly - with TypeSourceInfo and proper behavior in the face of templates. llvm-svn: 132017
* It's considered poor form to create references to the overloadedDouglas Gregor2011-05-211-0/+3
| | | | | | | function type. Educate template argument deduction thusly, fixing PR9974 / <rdar://problem/9479155>. llvm-svn: 131811
* Reapply the commits that r131401 reverted and add a fix for PR9927.Argyrios Kyrtzidis2011-05-171-23/+164
| | | | llvm-svn: 131446
* Revert 131377, 131369 and 131365.Rafael Espindola2011-05-161-163/+23
| | | | | | 131365 caused PR9927. llvm-svn: 131401
* Fix MSVC build.Argyrios Kyrtzidis2011-05-151-1/+1
| | | | llvm-svn: 131377
OpenPOWER on IntegriCloud