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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119337 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index c0c7a29..c13f031 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -1305,7 +1305,7 @@
return not_usr("<class USR>", I[2]);
else {
CXString x;
- x.Spelling = I[2];
+ x.data = (void*) I[2];
x.private_flags = 0;
print_usr(clang_constructUSR_ObjCIvar(I[1], x));
}
@@ -1332,7 +1332,7 @@
return not_usr("<class USR>", I[3]);
else {
CXString x;
- x.Spelling = I[3];
+ x.data = (void*) I[3];
x.private_flags = 0;
print_usr(clang_constructUSR_ObjCMethod(I[1], atoi(I[2]), x));
}
@@ -1362,7 +1362,7 @@
return not_usr("<class USR>", I[2]);
else {
CXString x;
- x.Spelling = I[2];
+ x.data = (void*) I[2];
x.private_flags = 0;
print_usr(clang_constructUSR_ObjCProperty(I[1], x));
}