diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Analysis/CallGraph.cpp | 5 | ||||
-rw-r--r-- | clang/lib/Index/Entity.cpp | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/Analysis/CallGraph.cpp b/clang/lib/Analysis/CallGraph.cpp index 2ec6d2014d8..b4f57b8fde4 100644 --- a/clang/lib/Analysis/CallGraph.cpp +++ b/clang/lib/Analysis/CallGraph.cpp @@ -118,10 +118,11 @@ void CallGraph::print(llvm::raw_ostream &os) { for (iterator I = begin(), E = end(); I != E; ++I) { if (I->second->hasCallee()) { ASTContext &Ctx = *CallerCtx[I->second]; - os << "function: " << I->first->getName(Ctx) << " calls:\n"; + os << "function: " << I->first->getPrintableName(Ctx).c_str() + << " calls:\n"; for (CallGraphNode::iterator CI = I->second->begin(), CE = I->second->end(); CI != CE; ++CI) { - os << " " << CI->second->getName(Ctx); + os << " " << CI->second->getName(Ctx).c_str(); } os << '\n'; } diff --git a/clang/lib/Index/Entity.cpp b/clang/lib/Index/Entity.cpp index ca2e7c8f3e6..7a6c05c416a 100644 --- a/clang/lib/Index/Entity.cpp +++ b/clang/lib/Index/Entity.cpp @@ -126,11 +126,11 @@ Decl *Entity::getDecl(ASTContext &AST) { return 0; // Failed to find a decl using this Entity. } -const char *Entity::getName(ASTContext &Ctx) { +std::string Entity::getPrintableName(ASTContext &Ctx) { if (const NamedDecl *ND = dyn_cast_or_null<NamedDecl>(getDecl(Ctx))) { - return ND->getNameAsCString(); + return ND->getNameAsString(); } - return 0; + return std::string(); } /// \brief Get an Entity associated with the given Decl. |