summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2016-02-14 22:30:14 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2016-02-14 22:30:14 +0000
commitca741cef3e41a09943709ca052791048301cdd60 (patch)
tree81f515ea7ce03d0597edf450bf5895f6817c75da /clang/tools/c-index-test
parent652f7808943530774846dea60516bfa16ba0bc73 (diff)
downloadbcm5719-llvm-ca741cef3e41a09943709ca052791048301cdd60.tar.gz
bcm5719-llvm-ca741cef3e41a09943709ca052791048301cdd60.zip
[index] Factor libclang's functionality to determing the mangled name of symbols into the clangIndex library.
llvm-svn: 260858
Diffstat (limited to 'clang/tools/c-index-test')
-rw-r--r--clang/tools/c-index-test/core_main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/tools/c-index-test/core_main.cpp b/clang/tools/c-index-test/core_main.cpp
index c56d66f2147..e37b3422ac6 100644
--- a/clang/tools/c-index-test/core_main.cpp
+++ b/clang/tools/c-index-test/core_main.cpp
@@ -14,6 +14,7 @@
#include "clang/Index/IndexingAction.h"
#include "clang/Index/IndexDataConsumer.h"
#include "clang/Index/USRGeneration.h"
+#include "clang/Index/CodegenNameGenerator.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/raw_ostream.h"
@@ -60,11 +61,16 @@ namespace {
class PrintIndexDataConsumer : public IndexDataConsumer {
raw_ostream &OS;
+ std::unique_ptr<CodegenNameGenerator> CGNameGen;
public:
PrintIndexDataConsumer(raw_ostream &OS) : OS(OS) {
}
+ void initialize(ASTContext &Ctx) override {
+ CGNameGen.reset(new CodegenNameGenerator(Ctx));
+ }
+
bool handleDeclOccurence(const Decl *D, SymbolRoleSet Roles,
ArrayRef<SymbolRelation> Relations,
FileID FID, unsigned Offset,
@@ -82,6 +88,10 @@ public:
printSymbolNameAndUSR(D, Ctx, OS);
OS << " | ";
+ if (CGNameGen->writeName(D, OS))
+ OS << "<no-cgname>";
+ OS << " | ";
+
printSymbolRoles(Roles, OS);
OS << " | ";
OpenPOWER on IntegriCloud