summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndexCXX.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-11-16 08:15:36 +0000
committerTed Kremenek <kremenek@apple.com>2010-11-16 08:15:36 +0000
commit915542850b7bd6d8b9e3ff6535f38ce8f73bb8dd (patch)
tree03513c05a6d5259c6a82e075fa49e916553e039b /clang/tools/libclang/CIndexCXX.cpp
parent9813d3221d7d533032c44c2019e8614075d1a6c0 (diff)
downloadbcm5719-llvm-915542850b7bd6d8b9e3ff6535f38ce8f73bb8dd.tar.gz
bcm5719-llvm-915542850b7bd6d8b9e3ff6535f38ce8f73bb8dd.zip
Change CXTranslationUnit to not directly cast to an ASTUnit*,
but to wrap both an ASTUnit and a "string pool" that will be used for fast USR generation. This requires a bunch of mechanical changes, as there was a ton of code that assumed that CXTranslationUnit and ASTUnit* were the same. Along with this change, introduce CXStringBuf, which provides an llvm::SmallVector<char> backing for repeatedly generating CXStrings without a huge amount of malloc() traffic. This requires making some changes to the representation of CXString by renaming a few fields (but keeping the size of the object the same). llvm-svn: 119337
Diffstat (limited to 'clang/tools/libclang/CIndexCXX.cpp')
-rw-r--r--clang/tools/libclang/CIndexCXX.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/tools/libclang/CIndexCXX.cpp b/clang/tools/libclang/CIndexCXX.cpp
index fca89ed4104..0f49f65c2b8 100644
--- a/clang/tools/libclang/CIndexCXX.cpp
+++ b/clang/tools/libclang/CIndexCXX.cpp
@@ -55,7 +55,7 @@ enum CXCursorKind clang_getTemplateCursorKind(CXCursor C) {
if (TemplateDecl *Template
= dyn_cast_or_null<TemplateDecl>(getCursorDecl(C)))
return MakeCXCursor(Template->getTemplatedDecl(),
- getCursorASTUnit(C)).kind;
+ static_cast<CXTranslationUnit>(C.data[2])).kind;
break;
case CXCursor_ClassTemplatePartialSpecialization:
@@ -117,7 +117,7 @@ CXCursor clang_getSpecializedCursorTemplate(CXCursor C) {
if (!Template)
return clang_getNullCursor();
- return MakeCXCursor(Template, getCursorASTUnit(C));
+ return MakeCXCursor(Template, static_cast<CXTranslationUnit>(C.data[2]));
}
} // end extern "C"
OpenPOWER on IntegriCloud