summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-09-11 18:45:02 +0000
committerAdrian Prantl <aprantl@apple.com>2015-09-11 18:45:02 +0000
commitb67dbced9c036b40830408a3fe47fd099f05ca3c (patch)
treedd30d06596c5198f9d71060b844fcb9bc94932ac
parent17dacc401c70ca5b316b91c98387b2bc06a4902c (diff)
downloadbcm5719-llvm-b67dbced9c036b40830408a3fe47fd099f05ca3c.tar.gz
bcm5719-llvm-b67dbced9c036b40830408a3fe47fd099f05ca3c.zip
Cleanup: Get rid of a bunch of unnecessary invocations of internString()
in CGDebugInfo.cpp: MDString::get() copies its arguments. llvm-svn: 247445
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp35
1 files changed, 14 insertions, 21 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 38be54ea751..a24934e6240 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -345,13 +345,6 @@ void CGDebugInfo::CreateCompileUnit() {
}
}
- // Save filename string.
- StringRef Filename = internString(MainFileName);
-
- // Save split dwarf file string.
- std::string SplitDwarfFile = CGM.getCodeGenOpts().SplitDwarfFile;
- StringRef SplitDwarfFilename = internString(SplitDwarfFile);
-
llvm::dwarf::SourceLanguage LangTag;
const LangOptions &LO = CGM.getLangOpts();
if (LO.CPlusPlus) {
@@ -377,13 +370,13 @@ void CGDebugInfo::CreateCompileUnit() {
// Create new compile unit.
// FIXME - Eliminate TheCU.
TheCU = DBuilder.createCompileUnit(
- LangTag, Filename, getCurrentDirname(), Producer, LO.Optimize,
- CGM.getCodeGenOpts().DwarfDebugFlags, RuntimeVers, SplitDwarfFilename,
+ LangTag, MainFileName, getCurrentDirname(), Producer, LO.Optimize,
+ CGM.getCodeGenOpts().DwarfDebugFlags, RuntimeVers,
+ CGM.getCodeGenOpts().SplitDwarfFile,
DebugKind <= CodeGenOptions::DebugLineTablesOnly
? llvm::DIBuilder::LineTablesOnly
: llvm::DIBuilder::FullDebug,
- 0 /* DWOid */,
- DebugKind != CodeGenOptions::LocTrackingOnly);
+ 0 /* DWOid */, DebugKind != CodeGenOptions::LocTrackingOnly);
}
llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) {
@@ -775,9 +768,9 @@ llvm::DIType *CGDebugInfo::CreateType(const TemplateSpecializationType *Ty,
Ty->getTemplateName().getAsTemplateDecl())->getTemplatedDecl();
SourceLocation Loc = AliasDecl->getLocation();
- return DBuilder.createTypedef(
- Src, internString(OS.str()), getOrCreateFile(Loc), getLineNumber(Loc),
- getDeclContextDescriptor(AliasDecl));
+ return DBuilder.createTypedef(Src, OS.str(), getOrCreateFile(Loc),
+ getLineNumber(Loc),
+ getDeclContextDescriptor(AliasDecl));
}
llvm::DIType *CGDebugInfo::CreateType(const TypedefType *Ty,
@@ -1688,13 +1681,13 @@ CGDebugInfo::getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod) {
}
}
llvm::DIBuilder DIB(CGM.getModule());
- auto *CU = DIB.createCompileUnit(
- TheCU->getSourceLanguage(), internString(Mod.ModuleName),
- internString(Mod.Path), TheCU->getProducer(), true, StringRef(), 0,
- internString(Mod.ASTFile), llvm::DIBuilder::FullDebug, Mod.Signature);
- llvm::DIModule *M = DIB.createModule(
- CU, Mod.ModuleName, ConfigMacros, internString(Mod.Path),
- internString(CGM.getHeaderSearchOpts().Sysroot));
+ auto *CU = DIB.createCompileUnit(TheCU->getSourceLanguage(), Mod.ModuleName,
+ Mod.Path, TheCU->getProducer(), true,
+ StringRef(), 0, Mod.ASTFile,
+ llvm::DIBuilder::FullDebug, Mod.Signature);
+ llvm::DIModule *M =
+ DIB.createModule(CU, Mod.ModuleName, ConfigMacros, Mod.Path,
+ CGM.getHeaderSearchOpts().Sysroot);
DIB.finalize();
ModRef.reset(M);
return M;
OpenPOWER on IntegriCloud