summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndexUSRs.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-201-0/+1
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* Re-commit r170428 changes with Linux style file endings.Guy Benyei2012-12-181-0/+6
| | | | | | Add OpenCL images as clang builtin types. llvm-svn: 170432
* Revert changes from r170428, as I accidentally changed the line endings of ↵Guy Benyei2012-12-181-912/+906
| | | | | | these files to Windows style. llvm-svn: 170431
* Add OpenCL images as clang builtin types.Guy Benyei2012-12-181-906/+912
| | | | llvm-svn: 170428
* [libclang] Declarations inside anonymous namespaces have internal linkage soArgyrios Kyrtzidis2012-12-071-7/+1
| | | | | | | | | their USR should contain a location. This uniques them from other declarations with the same name but in different translation units. rdar://10546541 llvm-svn: 169647
* Remove completely irrelevant code from USR generation.Ted Kremenek2012-11-061-29/+4
| | | | | | | | | | | | | | Thanks to Richard Smith for pointing this out. This code stopped serving its purpose during r103212 in a refactoring. My initial fix was to add back the logic to abort the USR generation for InternalLinkage, but enough tests broke suspiciously that I fear that USR generation for cursors with InternalLinkage is now expected by some clients (where it wasn't the case when the refactoring took place). I don't own this code anymore and have not looked at it for some time, but clearly this code is dead and can be removed pending further review on the proper logic here. llvm-svn: 167442
* Fix the AST representation for non-type template arguments to encodeEli Friedman2012-09-261-3/+5
| | | | | | | | | | | | enough information so we can mangle them correctly in cases involving dependent parameter types. (This specifically impacts cases involving null pointers and cases involving parameters of reference type.) Fix the mangler to use this information instead of trying to scavenge it out of the parameter declaration. <rdar://problem/12296776>. llvm-svn: 164656
* Normalize line endings of r163013.Joao Matos2012-08-311-935/+935
| | | | llvm-svn: 163024
* Improved MSVC __interface support by adding first class support for it, ↵Joao Matos2012-08-311-932/+935
| | | | | | instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins. llvm-svn: 163013
* Plug a long standing memory leak in TemplateArgument.Benjamin Kramer2012-06-071-1/+1
| | | | | | | | | | | | | | | The integral APSInt value is now stored in a decomposed form and the backing store for large values is allocated via the ASTContext. This way its not leaked as TemplateArguments are never destructed when they are allocated in the ASTContext. Since the integral data is immutable it is now shared between instances, making copying TemplateArguments a trivial operation. Currently getting the integral data out of a TemplateArgument requires creating a new APSInt object. This is cheap when the value is small but can be expensive if it's not. If this turns out to be an issue a more efficient accessor could be added. llvm-svn: 158150
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-1/+1
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* drop more llvm:: prefixes on SmallString<>Dylan Noblesmith2012-02-131-2/+2
| | | | | | More cleanup after r149799. llvm-svn: 150380
* drop more llvm:: prefixes on OwningPtr<>Dylan Noblesmith2012-02-131-1/+1
| | | | | | More cleanup after r149798. llvm-svn: 150379
* [libclang] Encode the template specialization parameters of a functionArgyrios Kyrtzidis2012-02-101-0/+10
| | | | | | specialization in its USR string. llvm-svn: 150264
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-2/+2
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* Eliminate ObjCForwardProtocolDecl, which is redundant now thatDouglas Gregor2012-01-011-7/+0
| | | | | | ObjCProtocolDecl modules forward declarations properly. llvm-svn: 147415
* Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDeclDouglas Gregor2011-12-271-7/+0
| | | | | | | covers both declarations (@class) and definitions (@interface) of an Objective-C class. llvm-svn: 147299
* [libclang] Add defensive checks to make sure we don't try to dereferenceArgyrios Kyrtzidis2011-12-101-0/+3
| | | | | | a null pointer after getCursorDecl() is called. rdar://10298421. llvm-svn: 146312
* [libclang] For a class extension, give it a unique USR but for any property ↵Argyrios Kyrtzidis2011-11-011-4/+16
| | | | | | | | | | or ivar it contains give it a USR based on its semantic context, which is the interface. This follows what we already did for objc methods. rdar://10371669 llvm-svn: 143464
* Use const_cast to make it obvious that it's just removing constness (and ↵Benjamin Kramer2011-10-281-1/+1
| | | | | | silence warnings). llvm-svn: 143193
* More metaprogramming with builtin types.John McCall2011-10-181-4/+3
| | | | llvm-svn: 142433
* [libclang] Since an objc extension semantically continues the interface of ↵Argyrios Kyrtzidis2011-10-181-4/+2
| | | | | | | | | the class don't use unique USRs for them, otherwise we fail to associate @implementation methods with the methods in extensions. llvm-svn: 142361
* [libclang] Introduce a new high level API for indexing clients that assumesArgyrios Kyrtzidis2011-10-171-2/+2
| | | | | | | | | more of the work involved in indexing a translation unit and simplifies client implementations. Only C/ObjC for now, C++ (and comments) to come. llvm-svn: 142233
* Add a new placeholder type to represent "unbridged"John McCall2011-10-171-0/+1
| | | | | | | | casts in ARC. No semantic analysis yet. llvm-svn: 142208
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-0/+2
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Change operator<< for raw_ostream and NamedDecl to take a reference instead ↵Benjamin Kramer2011-10-141-1/+1
| | | | | | | | of a pointer. Passing a pointer was a bad idea as it collides with the overload for void*. llvm-svn: 141971
* [libclang] Allow using getDeclCursorUSR function with a Decl* and not a cursor.Argyrios Kyrtzidis2011-10-121-30/+36
| | | | llvm-svn: 141770
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Mechanically rename SourceManager::getInstantiationLoc andChandler Carruth2011-07-251-1/+1
| | | | | | | | FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part of the API and documentation update from 'instantiation' as the term for macros to 'expansion'. llvm-svn: 135914
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-17/+17
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Use the canonical decl when generating the locations for USRs.Ted Kremenek2011-05-031-0/+3
| | | | llvm-svn: 130748
* Guard in USRGenerator::GenLoc() against null Decl* from invalid code.Ted Kremenek2011-04-291-0/+6
| | | | llvm-svn: 130541
* Make yet another placeholder type, this one marking that an expression is a ↵John McCall2011-04-261-0/+1
| | | | | | | | | | | bound member function, i.e. something of the form 'x.f' where 'f' is a non-static member function. Diagnose this in the general case. Some of the new diagnostics are probably worse than the old ones, but we now get this right much more universally, and there's certainly room for improvement in the diagnostics. llvm-svn: 130239
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-1/+1
| | | | llvm-svn: 129567
* Basic, untested implementation for an "unknown any" type requested by LLDB.John McCall2011-04-071-0/+1
| | | | | | | | | | | | The idea is that you can create a VarDecl with an unknown type, or a FunctionDecl with an unknown return type, and it will still be valid to access that object as long as you explicitly cast it at every use. I'm still going back and forth about how I want to test this effectively, but I wanted to go ahead and provide a skeletal implementation for the LLDB folks' benefit and because it also improves some diagnostic goodness for placeholder expressions. llvm-svn: 129065
* Implement the C++0x deduced 'auto' feature.Richard Smith2011-02-201-1/+0
| | | | | | This fixes PR 8738, 9060 and 9132. llvm-svn: 126069
* Don't crash when generating USRs for ObjC methods in protocols.Ted Kremenek2011-02-051-8/+13
| | | | llvm-svn: 124920
* USRs for Objective-C methods use the USR of the @interface as their base, ↵Ted Kremenek2011-02-041-18/+6
| | | | | | not the USR of the class category or extension. llvm-svn: 124859
* Teach libclang to generate USRs containing parameter packs and pack expansions.Douglas Gregor2011-01-191-3/+18
| | | | llvm-svn: 123848
* Replace the representation of template template argument packDouglas Gregor2011-01-051-1/+3
| | | | | | | | | | | | | expansions with something that is easier to use correctly: a new template argment kind, rather than a bit on an existing kind. Update all of the switch statements that deal with template arguments, fixing a few latent bugs in the process. I"m happy with this representation, now. And, oh look! Template instantiation and deduction work for template template argument pack expansions. llvm-svn: 122896
* The -fshort-wchar option causes wchar_t to become unsigned, in addition to beingChris Lattner2010-12-251-1/+2
| | | | | | | 16-bits in size. Implement this by splitting WChar into two enums, like we have for char. This fixes a miscompmilation of XULRunner, PR8856. llvm-svn: 122558
* Replace all uses of PathV1::getLast with PathV2::filename.Michael J. Spencer2010-12-181-2/+1
| | | | llvm-svn: 122117
* Rework USR generation from CXCursors to use CXStringBufsTed Kremenek2010-11-161-20/+42
| | | | | | | | | | | for the backing of generated USRs. This optmizes for the case when a client generates a sequence of USRs in sequence, disposing of them soon after generating them. By using a string buffer, we recycle malloc'ed memory instead of constantly malloc'ing and copying strings. llvm-svn: 119338
* Move CXString creation/management routines intoTed Kremenek2010-11-161-0/+1
| | | | | | | their own .cpp file and make the interpretation of its flags private. llvm-svn: 119319
* Fix a marvelous chained AST writing bug, where we end up with theDouglas Gregor2010-10-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | following amusing sequence: - AST writing schedules writing a type X* that it had never seen before - AST writing starts writing another declaration, ends up deserializing X* from a prior AST file. Now we have two type IDs for the same type! - AST writer tries to write X*. It only has the lower-numbered ID from the the prior AST file, so references to the higher-numbered ID that was scheduled for writing go off into lalaland. To fix this, keep the higher-numbered ID so we end up writing the type twice. Since this issue occurs so rarely, and type records are generally rather small, I deemed this better than the alternative: to keep a separate mapping from the higher-numbered IDs to the lower-numbered IDs, which we would end up having to check whenever we want to deserialize any type. Fixes <rdar://problem/8511624>, I think. llvm-svn: 115647
* Fix indentation.Ted Kremenek2010-09-211-1/+1
| | | | llvm-svn: 114394
* Check for null ObjCInterfaceDecls returned from getClassInterface() when ↵Ted Kremenek2010-09-211-4/+11
| | | | | | generating USRs. While I have no test case for this (could not create one), this shows up in crash reports. Tentatively fixes <rdar://problem/8452791>. llvm-svn: 114392
* Introduce a simple, substitution-based compression scheme for USRs, soDouglas Gregor2010-09-201-26/+43
| | | | | | | that redundant types don't result in super-long USRs. Fixes <rdar://problem/8447875>. llvm-svn: 114347
* Implement libclang support for using declarations. Clang actually usesDouglas Gregor2010-09-011-0/+9
| | | | | | | | | | | | | | | | three different kinds of AST nodes to represent using declarations: UsingDecl, UnresolvedUsingValueDecl, and UnresolvedUsingTypenameDecl. These three are collapsed into a single cursor kind for using declarations, since libclang clients don't need the distinction. Several related changes here: - Cursor visitation of the three AST nodes for using declarations - Proper source-range computation for these AST nodes - Using declarations have no USRs, since they don't actually declare any entities. llvm-svn: 112730
* Improve libclang indexing support for class template specializationsDouglas Gregor2010-09-011-0/+11
| | | | | | | | | | | | | in a few related ways: - Don't recurse into instantiations of templates. - Recurse into explicit specializations. - Visit the template arguments of an explicit specialization or explicit instantiation. - Include template specialization arguments in the USRs for class template specializations. llvm-svn: 112720
OpenPOWER on IntegriCloud