diff options
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 5ae4dfe83c..39a9ef788f 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -156,12 +156,10 @@ StringRef CGDebugInfo::getObjCMethodName(const ObjCMethodDecl *OMD) { /// getSelectorName - Return selector name. This is used for debugging /// info. StringRef CGDebugInfo::getSelectorName(Selector S) { - llvm::SmallString<256> SName; - llvm::raw_svector_ostream OS(SName); - OS << S.getAsString(); - char *StrPtr = DebugInfoNames.Allocate<char>(OS.tell()); - memcpy(StrPtr, SName.begin(), OS.tell()); - return StringRef(StrPtr, OS.tell()); + const std::string &SName = S.getAsString(); + char *StrPtr = DebugInfoNames.Allocate<char>(SName.size()); + memcpy(StrPtr, SName.data(), SName.size()); + return StringRef(StrPtr, SName.size()); } /// getClassName - Get class name including template argument list. |