summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReaderDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* First pass at implementing C++ enum semantics: calculate (and store) anJohn McCall2009-12-091-0/+1
| | | | | | | | | | | | "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
* DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated ↵John McCall2009-12-071-4/+4
| | | | | | | | | | | | | | | | | | | | | 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
* Parse C++ member check attributes - base_check, hiding, and override.Alexis Hunt2009-11-251-0/+3
| | | | | | The attributes are currently ignored. llvm-svn: 89837
* Added rudimentary C++0x attribute support.Alexis Hunt2009-11-211-0/+1
| | | | | | | | | | | | | | The following attributes are currently supported in C++0x attribute lists (and in GNU ones as well): - align() - semantics believed to be conformant to n3000, except for redeclarations and what entities it may apply to - final - semantics believed to be conformant to CWG issue 817's proposed wording, except for redeclarations - noreturn - semantics believed to be conformant to n3000, except for redeclarations - carries_dependency - currently ignored (this is an optimization hint) llvm-svn: 89543
* Add SourceLocations to ObjCClassDecl for the class identifiers referenced by ↵Ted Kremenek2009-11-181-1/+6
| | | | | | @class. llvm-svn: 89170
* Add support for cdecl attribute. (As far as I know, it doesn't affect CodeGenEli Friedman2009-11-091-0/+2
| | | | | | | | unless we start implementing command-line switches which override the default calling convention, so the effect is mostly to silence unknown attribute warnings.) llvm-svn: 86571
* Rename FunctionDecl::isInline/setInline toDouglas Gregor2009-10-271-1/+1
| | | | | | FunctionDecl::isInlineSpecified/setInlineSpecified. llvm-svn: 85305
* Preserve type source information in TypedefDecls. Preserve it acrossJohn McCall2009-10-241-4/+4
| | | | | | | | | template instantiation. Preserve it through PCH. Show it off to the indexer. I'm healthily ignoring the vector type cases because we don't have a sensible TypeLoc implementation for them anyway. llvm-svn: 84994
* Remove OriginalTypeParmDecl; the original type is the one specifiedJohn McCall2009-10-231-10/+0
| | | | | | | | | | | | | in the DeclaratorInfo, if one is present. Preserve source information through template instantiation. This is made more complicated by the possibility that ParmVarDecls don't have DIs, which is possibly worth fixing in the future. Also preserve source information for function parameters in ObjC method declarations. llvm-svn: 84971
* Factor out routines to encode/decode DeclaratorInfos and move them into theJohn McCall2009-10-161-77/+3
| | | | | | core PCH reader/writer implementation files. llvm-svn: 84278
* Keep track of whether declararions were loaded from a precompiledDouglas Gregor2009-10-161-0/+1
| | | | | | | | | | header or not via a new "PCHLevel" field in Decl. We currently use this information to help CIndex filter out declarations that came from a precompiled header (rather than from an AST file). Further down the road, it can be used to help implement multi-level precompiled headers. llvm-svn: 84267
* Better living through metaprogramming. Create a base class which abstractsJohn McCall2009-10-151-1/+4
| | | | | | | | | | | most of the unsafe boilerplate out of TypeLoc. Create a QualifiedLoc class to represent the idea that we *might* start representing source locations of qualifiers. Dealing with qualifiers explicitly like this also lets us efficiently ignore them in all the concrete cases. This should make it obvious and easy to add new TypeLoc subclasses. llvm-svn: 84168
* Pull TypeLocVisitor into its own header file.Argyrios Kyrtzidis2009-09-291-1/+1
| | | | llvm-svn: 83112
* Introduce ObjCInterfaceLoc which provides type source information for ObjC ↵Argyrios Kyrtzidis2009-09-291-0/+3
| | | | | | interfaces. llvm-svn: 83097
* Introduce ObjCProtocolListLoc for keeping source location information for ↵Argyrios Kyrtzidis2009-09-291-0/+6
| | | | | | protocol references. llvm-svn: 83094
* Update PCH serialization of FunctionDecl flags.Daniel Dunbar2009-09-221-0/+3
| | | | llvm-svn: 82526
* PCH: When deserializing an explicit "external definition", don't pass it to ↵Daniel Dunbar2009-09-171-1/+2
| | | | | | | | HandleTopLevelDecl -- this is already being done inside the reader. This is something of a hack, since whether the reader actually did this depends on the "isConsumerInterestedIn" predicate. I think we need to rework how this works, but I need to discuss with Doug. llvm-svn: 82111
* Rework the way we determine whether an externally visible symbol isDouglas Gregor2009-09-131-1/+0
| | | | | | | | generated for an inline function definition, taking into account C99 and GNU inline/extern inline semantics. This solution is simpler, cleaner, and fixes PR4536. llvm-svn: 81670
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-25/+25
| | | | llvm-svn: 81346
* Regularize the case and sort.Mike Stump2009-08-261-2/+2
| | | | llvm-svn: 80163
* Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use ↵Argyrios Kyrtzidis2009-08-211-5/+2
| | | | | | DeclaratorInfo to get this information. llvm-svn: 79584
* Store/load type source info from/to PCH files.Argyrios Kyrtzidis2009-08-191-3/+73
| | | | llvm-svn: 79396
* Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema ↵Argyrios Kyrtzidis2009-08-191-6/+6
| | | | | | | | | | | | interfaces. DeclaratorDecl contains a DeclaratorInfo* to keep type source info. Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl. EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo. Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet. llvm-svn: 79392
* map previously ignored __attribute((malloc)) to noalias attribute of llvm ↵Ryan Flynn2009-08-091-0/+1
| | | | | | function's return llvm-svn: 78541
* Introduce a new PragmaPack attribute, and use it for #pragma pack. The ↵Anders Carlsson2009-08-081-1/+2
| | | | | | | | PackedAttr now only represents __attribute__((packed)). This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug. llvm-svn: 78483
* Make tag declarations redeclarable. This change has three purposes:Douglas Gregor2009-07-291-0/+2
| | | | | | | | | | | | | | | | 1) Allow the Index library (and any other interested client) to walk the set of declarations for a given tag (enum, union, class, whatever). At the moment, this information is not readily available. 2) Reduce our dependence on TagDecl::TypeForDecl being mapped down to a TagType (for which getDecl() will return the tag definition, if one exists). This property won't exist for class template partial specializations. 3) Make the canonical declaration of a TagDecl actually canonical, e.g., so that it does not change when the tag is defined. llvm-svn: 77523
* Make ObjCImplDecl inherit from ObjCContainerDecl.Argyrios Kyrtzidis2009-07-271-2/+1
| | | | | | ObjCContainerDecl now is the root class for objc decls that contain methods. llvm-svn: 77235
* Add the location of the tag keyword into TagDecl. From EneaDouglas Gregor2009-07-211-2/+3
| | | | | | Zaffanella, with tweaks from Abramo Bagnara. llvm-svn: 76576
* Reuse VarDecl::Init to store the default argument of a ParmVarDecl,Douglas Gregor2009-07-201-1/+0
| | | | | | | reducing the size of ParmVarDecl by one pointer. Also means that we'll properly (de-)serialize default arguments in C++ PCH files. llvm-svn: 76487
* Location should be passed to setLocEnd() not to setAtEndLoc() which belongs ↵Argyrios Kyrtzidis2009-07-181-1/+1
| | | | | | to ObjCContainerDecl. llvm-svn: 76268
* Add a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella.Steve Naroff2009-07-141-1/+2
| | | | | Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary). llvm-svn: 75635
* Read/write TagDecl's RBraceLoc from/to PCH files.Argyrios Kyrtzidis2009-07-141-0/+1
| | | | llvm-svn: 75592
* Patch adds test to my previous patch for assigning toFariborz Jahanian2009-07-081-0/+1
| | | | | | | gc'able structs in the Next runtime and adds missing PCH info. llvm-svn: 75014
* Fix PR 4489, a crash in PCH loading that occurs when loading the nameDouglas Gregor2009-07-061-0/+3
| | | | | | | | | | of a top-level declaration loads another top-level declaration of the same name whose type depends on the first declaration having been completed. This commit breaks the circular dependency by delaying loads of top-level declarations triggered by loading a name until we are no longer recursively loading types or declarations. llvm-svn: 74847
* Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis2009-06-301-1/+1
| | | | | | | | | The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
* OpenCL 1.0 support: attributesNate Begeman2009-06-261-0/+8
| | | | llvm-svn: 74280
* Serialize FunctionDecl's EndRangeLoc out to the PCH file.Argyrios Kyrtzidis2009-06-201-0/+1
| | | | llvm-svn: 73822
* Keep track of when declarations are "used" according to C andDouglas Gregor2009-06-191-0/+1
| | | | | | | | | | | | C++. This logic is required to trigger implicit instantiation of function templates and member functions of class templates, which will be implemented separately. This commit includes support for -Wunused-parameter, printing warnings for named parameters that are not used within a function/Objective-C method/block. Fixes <rdar://problem/6505209>. llvm-svn: 73797
* Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor2009-06-181-1/+1
| | | | llvm-svn: 73702
* Enumeration declarations that were instantiated from an enumerationDouglas Gregor2009-05-271-0/+1
| | | | | | | | within a template now have a link back to the enumeration from which they were instantiated. This means that we can now find the instantiation of an anonymous enumeration. llvm-svn: 72482
* When evaluating a VarDecl as a constant or determining whether it isDouglas Gregor2009-05-261-1/+1
| | | | | | | | an integral constant expression, maintain a cache of the value and the is-an-ICE flag within the VarDecl itself. This eliminates exponential-time behavior of the Fibonacci template metaprogram. llvm-svn: 72428
* Fix lots of PCH crashes caused by the new assertions inDouglas Gregor2009-05-221-4/+4
| | | | | | | llvm::SmallVector, using data() instead of &[0]. The PCH testsuite now runs cleanly (again). llvm-svn: 72292
* Fix PCH crash caused by new assertions in llvm::SmallVector. UseTed Kremenek2009-05-221-1/+1
| | | | | | ProtoRefs.data() instead of &ProtoRefs[0] to access the raw buffer. llvm-svn: 72291
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-5/+5
| | | | llvm-svn: 72210
* implementation of format_arg for ObjC methods/functions.Fariborz Jahanian2009-05-201-0/+6
| | | | | | Still more to do. llvm-svn: 72173
* Check that the function being overridden is virtual.Anders Carlsson2009-05-141-1/+1
| | | | llvm-svn: 71802
* Improvements to the FunctionDecl getters/setters.Anders Carlsson2009-05-141-2/+2
| | | | llvm-svn: 71800
* Link FunctionDecls instantiated from the member functions of a classDouglas Gregor2009-05-141-0/+1
| | | | | | | | template to the FunctionDecls from which they were instantiated. This is a necessary first step to support instantiation of the definitions of such functions, but by itself does essentially nothing. llvm-svn: 71792
* Some early declarations to support sentinel attribute onFariborz Jahanian2009-05-131-0/+7
| | | | | | | message dispatches (and function calls later). No change in functionality. llvm-svn: 71683
* Add back Parse/Sema support for attributes cf_returns_retained andTed Kremenek2009-05-091-0/+2
| | | | | | | ns_returns_retained, but do not include the other ownership attributes we previously had. llvm-svn: 71308
OpenPOWER on IntegriCloud