diff options
author | John McCall <rjmccall@apple.com> | 2010-03-19 23:29:14 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-03-19 23:29:14 +0000 |
commit | 7ec5043c2c64d376af9ddab5006d44f392870cbd (patch) | |
tree | df7555e132f782846f795d62e621bfc186a65bc9 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 3e2bb702db78bda5efd3aac2b025b5084e71f812 (diff) | |
download | bcm5719-llvm-7ec5043c2c64d376af9ddab5006d44f392870cbd.tar.gz bcm5719-llvm-7ec5043c2c64d376af9ddab5006d44f392870cbd.zip |
Change CodeGenModule to rely on the Module's symbol table instead of
shadowing it in the GlobalDeclMap. Eliminates the string-uniquing
requirement for mangled names, which should help C++ codegen times a little.
Forces us to do string lookups instead of pointer lookups, which might hurt
codegen times a little across the board. We'll see how it plays out.
Removing the string-uniquing requirement implicitly fixes any bugs like
PR6635 which arose from the fact that we had multiple uniquing tables for
different kinds of identifiers.
llvm-svn: 99012
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index a40a5fbdce4..ad97d08a2bf 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -569,13 +569,13 @@ CGDebugInfo::CreateCXXMemberFunction(const CXXMethodDecl *Method, isa<CXXConstructorDecl>(Method) || isa<CXXDestructorDecl>(Method); llvm::StringRef MethodName = getFunctionName(Method); - llvm::StringRef MethodLinkageName; llvm::DIType MethodTy = getOrCreateMethodType(Method, Unit); // Since a single ctor/dtor corresponds to multiple functions, it doesn't // make sense to give a single ctor/dtor a linkage name. + MangleBuffer MethodLinkageName; if (!IsCtorOrDtor) - MethodLinkageName = CGM.getMangledName(Method); + CGM.getMangledName(MethodLinkageName, Method); SourceManager &SM = CGM.getContext().getSourceManager(); @@ -1307,7 +1307,7 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType, CGBuilderTy &Builder) { llvm::StringRef Name; - llvm::StringRef LinkageName; + MangleBuffer LinkageName; const Decl *D = GD.getDecl(); if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { @@ -1326,11 +1326,11 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType, if (!Name.empty() && Name[0] == '\01') Name = Name.substr(1); // Use mangled name as linkage name for c/c++ functions. - LinkageName = CGM.getMangledName(GD); + CGM.getMangledName(LinkageName, GD); } else { // Use llvm function name as linkage name. Name = Fn->getName(); - LinkageName = Name; + LinkageName.setString(Name); if (!Name.empty() && Name[0] == '\01') Name = Name.substr(1); } |