Commit Graph

23 Commits

Author SHA1 Message Date
Alex Lorenz c4d3e60b62 [index] Handle vector types in USR generator
rdar://25339187


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301635 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 09:46:36 +00:00
NAKAMURA Takumi 6d52512c28 clang/test/Index/usrs.cpp: Appease targeting msvc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223649 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 10:20:33 +00:00
Argyrios Kyrtzidis 07dfbf9c3e [libclang] Encode InjectedClassNameType in the USR.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223634 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 08:48:43 +00:00
Argyrios Kyrtzidis 773f68761c [libclang] Encode location info for anonymous embedded tag decls.
Otherwise the USR will conflict with different embedded tag decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223633 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 08:48:37 +00:00
Argyrios Kyrtzidis 03c39bf6c0 [libclang] Use same USR encoding for 'class' as 'struct'.
'class' and 'struct' can be used interchangebly for forward references.
Use the same encoding otherwise we may get into a weird situation where the USR for the same
declaration is different based on whether the definition of the tag reference is visible or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223632 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 08:48:33 +00:00
Argyrios Kyrtzidis ee59c373bb [libclang] Reflect in USR generation that 'signed char' and 'unsigned char' can overload a 'char' in C++, by giving them distinct encodings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223629 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 08:48:17 +00:00
Argyrios Kyrtzidis ab1d30c042 [libclang] Function templates can be 'overloaded' by return type, so encode the return type in the USR
and handle DependentNameType in order to be able to distinguish them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223628 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 08:48:11 +00:00
Argyrios Kyrtzidis d403cc9e76 [Index] Make the USRs more stable.
- Only include offsets with local (in function scope) symbols, where we don't encode scoping
- Only include the filename with non-system symbols. Presumably the system headers will not provide conflicting definitions.

rdar://15976823

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201990 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-23 18:23:29 +00:00
Argyrios Kyrtzidis e1c2c2023e [libclang] Declarations inside anonymous namespaces have internal linkage so
their USR should contain a location.

This uniques them from other declarations with the same name but in different translation units.
rdar://10546541

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169647 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 22:41:46 +00:00
Ted Kremenek 1d8052db5a Use the canonical decl when generating the locations for USRs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130748 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 01:33:35 +00:00
Abramo Bagnara 3deeb6deae Fixed type and declaration source range in presence of typeQuals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127535 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-12 11:02:00 +00:00
Abramo Bagnara acba90f308 Fixed NamespaceDecl source range.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127242 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-08 12:38:20 +00:00
Abramo Bagnara ff676cb48f Fixed source range for all DeclaratorDecl's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127225 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-08 08:55:46 +00:00
Abramo Bagnara 344577e6b5 Fixed TypedefDecl and TemplateTypeParameter source range.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127119 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-06 15:48:19 +00:00
Douglas Gregor 7e24256c95 Implement libclang support for using declarations. Clang actually uses
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 19:52:22 +00:00
Douglas Gregor 828629bd81 Add test for nothing... i.e., the contents of a USR for using directives
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112716 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 16:37:17 +00:00
Douglas Gregor 0a35bceb77 Implement libclang support for using directives (cursor + visitation +
suppressing USRs). Also, fix up the source location information for
using directives so that the declaration location refers to the
namespace name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112693 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 03:07:18 +00:00
Douglas Gregor 6931900f43 Add libclang support for namespace aliases (visitation + USRs) along
with a new cursor kind for a reference to a namespace. 

There's still some oddities in the source location information for
NamespaceAliasDecl that I'll address with a separate commit, so the
source locations displayed in the load-namespaces.cpp test will
change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112676 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 23:48:11 +00:00
Ted Kremenek 1f3b4a98d4 Update test case to include USRs containing offsets instead of line/columns.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109096 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 11:30:17 +00:00
Ted Kremenek 2ea5baf08d Extend C++ usrs to include type mangling for tag decl arguments, indicating whether a method
is static, and mangling in the qualifers of the method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 20:39:40 +00:00
Ted Kremenek 8e67219a7c Add initial USR support for mangling in the types of C++ functions and methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103225 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 01:04:32 +00:00
Ted Kremenek d5d90fedcc Add USR test case for C++ operator methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 01:04:23 +00:00
Ted Kremenek cbd66f00cf Add USR support for C++ namespaces, and unify mangling of location information in USRs
for anonymous symbols.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103212 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-06 23:38:28 +00:00