aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-05-19 21:51:10 +0000
committerTed Kremenek <kremenek@apple.com>2010-05-19 21:51:10 +0000
commit50aa6acd0b8d40c8956372a69e0a73f0802a5494 (patch)
tree39084ad3a556335a173323a0dc2fb109ab125061
parente4da7a034a2fcf4b14d0bcc28d05de0878159061 (diff)
Move CXCursor_FirstDecl definition later to make the results more readable in the debugger.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104171 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang-c/Index.h2
-rw-r--r--tools/libclang/CIndex.cpp9
2 files changed, 6 insertions, 5 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index d1840f5e6b..663737a0f3 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -648,7 +648,6 @@ CINDEX_LINKAGE void clang_disposeTranslationUnit(CXTranslationUnit);
*/
enum CXCursorKind {
/* Declarations */
- CXCursor_FirstDecl = 1,
/**
* \brief A declaration whose specific kind is not exposed via this
* interface.
@@ -707,6 +706,7 @@ enum CXCursorKind {
/** \brief A linkage specification, e.g. 'extern "C"'. */
CXCursor_LinkageSpec = 23,
+ CXCursor_FirstDecl = CXCursor_UnexposedDecl,
CXCursor_LastDecl = CXCursor_LinkageSpec,
/* References */
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 505633649a..945d05bf23 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -1585,10 +1585,11 @@ static CXString getDeclSpelling(Decl *D) {
// ObjCCategoryImplDecl returns the category name.
return createCXString(CIMP->getIdentifier()->getNameStart());
- if (ND->getIdentifier())
- return createCXString(ND->getIdentifier()->getNameStart());
-
- return createCXString("");
+ llvm::SmallString<1024> S;
+ llvm::raw_svector_ostream os(S);
+ ND->printName(os);
+
+ return createCXString(os.str());
}
CXString clang_getCursorSpelling(CXCursor C) {