aboutsummaryrefslogtreecommitdiff
path: root/tools/CIndex/CIndexUSRs.cpp
AgeCommit message (Collapse)Author
2010-04-30Rename 'CIndex' to 'libclang', since it has basically become our stable publicDaniel Dunbar
(C) API, and will likely grow further in this direction in the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-29Add USR support for 'static inline' functions (which can be declared in ↵Ted Kremenek
header files). Add USR support for 'static' functions and local variables, which can be handy for resolving named variables within a translation unit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102641 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-29Remove USRGenerator::VisitBlockDecl(). We don't need to generate USRs for ↵Ted Kremenek
blocks, since they have no linkage and by definition are anonymous. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20Fix USRs for 'extern' variables declaration in functions/method bodies.Ted Kremenek
Fix USRs for @synthesize. Add more USR tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17Add raw_ostream operators to NamedDecl for convenience. Switch over all ↵Benjamin Kramer
users of getNameAsString on a stream. The next step is to print the name directly into the stream, avoiding a temporary std::string copy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17Remove unneeded assertion and don't return a null CXString.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101585 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16Rework USR generation for symbols with no linkage. Many of the USRs are now ↵Ted Kremenek
shortened, and we now include the file name that declares the symbol with no linkage in the USR. USRs for such symbols are generated only in restructed cases, e.g., anonymous enum declarations, typedefs, etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101542 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15Better support USRs for anonymous enums, structs, by including the location ↵Ted Kremenek
where the tag was declared. WIP. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101403 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15Do not generate USRs for declarations with 'no linkage' except for enums, ↵Ted Kremenek
structs, typedefs. Those still need work to disambiguate them across translation units. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101401 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12Prune includes.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101059 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11Add initial USR support for macro definitions.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100997 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11Augment clang_getCursorUSR() to not always expect that clang_getCursorDecl() ↵Ted Kremenek
does the right thing if the cursor is not a decl (such as in the case of macros). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08CIndex: move extractUSRSuffix out of extern "C" and simplify it.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100773 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25Require that all Clang-based USRs start with the prefix 'c:' for the "USR ↵Ted Kremenek
space". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19Make the CIndex API more resilient to being used on invalid code.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15Rename clang_constructUSR_ObjCategory to clang_constructUSR_ObjCCategory.Ted Kremenek
(there was a missing 'C'). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98554 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13Implement several CIndex functions for constructing USRs from C-strings ↵Ted Kremenek
instead of AST elements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98421 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17Move createCXString() functions out of CIndexer and into the clang::cxstring ↵Ted Kremenek
namespace. We can much more succinctly refer to these functions this way. Also change the default behavior of createCXString(StringRef&) to duplicate the string. This is almost always what we want. The other case is where we pass a constant c-string, which uses the other version of createCXString(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96423 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-31CIndex/USRs: Disable a bogus assert, we don't want CIndex to crash liberally. IDaniel Dunbar
have sent Ted a test case for this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22Eliminate CIndex's dependency on the Clang Index library, since weDouglas Gregor
weren't actually using any of its facilities. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20Kill CXEntity and CXDecl. The first has never been used, while theDouglas Gregor
second has been wholly replaced by cursors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18Tweak USR output for ObjC categories.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18Refactor USR generation for TagDecls into a common method.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93799 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18Tweak USR generation to handle anonymous bitfields.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18Replace clang_getDeclUSR() with clang_getCursorUSR(). Also remove printing ↵Ted Kremenek
'contexts' from c-index-test output; it wasn't helpful and was extremely brittle. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15Refactor USR logic for EnumDecls and RecordDecls so that both handle ↵Ted Kremenek
'anonymous' declarations in the same way. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93585 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15USR generation: look at the typedef of an anonymous struct (if any) when ↵Ted Kremenek
trying to generate a USR. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93572 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15Add USR generation for enums.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93543 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14Further tweak USR generation by shorting names and distinguish between ↵Ted Kremenek
namespaces and functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93404 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12Rename clang_getUSR() -> clang_getDeclUSR(). For now we take a CXDecl ↵Ted Kremenek
instead of a CXEntity. Enhance USR generation a bit with support for records. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12Further tweaking of USR generation. WIP.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93250 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12Remove trailing semicolons and silence MSVC warning about C linkage.Benjamin Kramer
warning C4190: 'GetEntity' has C-linkage specified, but returns UDT 'clang::idx::Entity' which is incompatible with C git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93237 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12Add a boilerplate implementation for clang_getUSR(). WIP.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12Change clang_getUSR() to return a CXString instead of a 'const char *'.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93213 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11CIndex:Ted Kremenek
- Remove unused (and unimplemented) clang_getDeclarationName(). - Remove unused (and unimplemented) clang_getEntity(). - Add clang_getEntityFromDecl(): maps from a CXDecl to a CXEntity) - Add clang_getDeclaration(): maps from a (CXEntity, CXTranslationUnit) to a CXDecl). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05Split (mostly nonexistent) USR code out from the main CIndex logic.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92789 91177308-0d34-0410-b5e6-96231b3b80d8