forked from OSchip/llvm-project
parent
04f442c515
commit
0d61eebd81
|
@ -78,7 +78,7 @@ llvm::StringRef CGDebugInfo::getFunctionName(const FunctionDecl *FD) {
|
||||||
std::string NS = FD->getNameAsString();
|
std::string NS = FD->getNameAsString();
|
||||||
|
|
||||||
// Copy this name on the side and use its reference.
|
// Copy this name on the side and use its reference.
|
||||||
char *StrPtr = FunctionNames.Allocate<char>(NS.length());
|
char *StrPtr = DebugInfoNames.Allocate<char>(NS.length());
|
||||||
memcpy(StrPtr, NS.data(), NS.length());
|
memcpy(StrPtr, NS.data(), NS.length());
|
||||||
return llvm::StringRef(StrPtr, NS.length());
|
return llvm::StringRef(StrPtr, NS.length());
|
||||||
}
|
}
|
||||||
|
@ -716,7 +716,7 @@ llvm::StringRef CGDebugInfo::getVtableName(const CXXRecordDecl *Decl) {
|
||||||
std::string Name = "_vptr$" + Decl->getNameAsString();
|
std::string Name = "_vptr$" + Decl->getNameAsString();
|
||||||
|
|
||||||
// Copy this name on the side and use its reference.
|
// Copy this name on the side and use its reference.
|
||||||
char *StrPtr = FunctionNames.Allocate<char>(Name.length());
|
char *StrPtr = DebugInfoNames.Allocate<char>(Name.length());
|
||||||
memcpy(StrPtr, Name.data(), Name.length());
|
memcpy(StrPtr, Name.data(), Name.length());
|
||||||
return llvm::StringRef(StrPtr, Name.length());
|
return llvm::StringRef(StrPtr, Name.length());
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,9 +62,9 @@ class CGDebugInfo {
|
||||||
|
|
||||||
std::vector<llvm::TrackingVH<llvm::MDNode> > RegionStack;
|
std::vector<llvm::TrackingVH<llvm::MDNode> > RegionStack;
|
||||||
|
|
||||||
/// FunctionNames - This is a storage for function names that are
|
/// DebugInfoNames - This is a storage for names that are
|
||||||
/// constructed on demand. For example, C++ destructors, C++ operators etc..
|
/// constructed on demand. For example, C++ destructors, C++ operators etc..
|
||||||
llvm::BumpPtrAllocator FunctionNames;
|
llvm::BumpPtrAllocator DebugInfoNames;
|
||||||
|
|
||||||
llvm::DenseMap<const FunctionDecl *, llvm::WeakVH> SPCache;
|
llvm::DenseMap<const FunctionDecl *, llvm::WeakVH> SPCache;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue