diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-04-11 22:20:34 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-04-11 22:20:34 +0000 |
commit | fa8231dae543924399428db2d1364eb6eed29fee (patch) | |
tree | e0965224825c73ed9e657a564995f175a8abec1b | |
parent | c3ef91d784a08efbda6fac063215a163552a8e75 (diff) |
Add initial USR support for macro definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100997 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/CIndex/CIndexUSRs.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/CIndex/CIndexUSRs.cpp b/tools/CIndex/CIndexUSRs.cpp index a2cb040282..a2be617d8a 100644 --- a/tools/CIndex/CIndexUSRs.cpp +++ b/tools/CIndex/CIndexUSRs.cpp @@ -281,8 +281,18 @@ static CXString getDeclCursorUSR(const CXCursor &C) { extern "C" { CXString clang_getCursorUSR(CXCursor C) { - if (clang_isDeclaration(clang_getCursorKind(C))) + const CXCursorKind &K = clang_getCursorKind(C); + + if (clang_isDeclaration(K)) return getDeclCursorUSR(C); + + if (K == CXCursor_MacroDefinition) { + StringUSRGenerator SUG; + SUG << "macro@" + << cxcursor::getCursorMacroDefinition(C)->getName()->getNameStart(); + return createCXString(SUG.str(), true); + } + return createCXString(""); } |