summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-08-04 22:35:30 +0000
committerReid Kleckner <reid@kleckner.net>2014-08-04 22:35:30 +0000
commitfe5b4ed82247eac485b6cc0f03c53204c81bcb35 (patch)
treebf68e246bda7d4cda0d28e19154164997a3b3669
parentdd44a7fb0fcfc23506c4d7a5feadd43d54d41ae5 (diff)
downloadbcm5719-llvm-fe5b4ed82247eac485b6cc0f03c53204c81bcb35.tar.gz
bcm5719-llvm-fe5b4ed82247eac485b6cc0f03c53204c81bcb35.zip
Remove separator parameter from static local naming code
It was always set to ".", which was duplicated in a few places. llvm-svn: 214792
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp12
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h1
2 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 7caa4b241e3..3b7d2bcb807 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -146,8 +146,7 @@ void CodeGenFunction::EmitVarDecl(const VarDecl &D) {
return EmitAutoVarDecl(D);
}
-static std::string GetStaticDeclName(CodeGenFunction &CGF, const VarDecl &D,
- const char *Separator) {
+static std::string GetStaticDeclName(CodeGenFunction &CGF, const VarDecl &D) {
CodeGenModule &CGM = CGF.CGM;
if (CGF.getLangOpts().CPlusPlus)
@@ -169,12 +168,11 @@ static std::string GetStaticDeclName(CodeGenFunction &CGF, const VarDecl &D,
else
llvm_unreachable("Unknown context for static var decl");
- return ContextName.str() + Separator + D.getNameAsString();
+ return ContextName.str() + "." + D.getNameAsString();
}
llvm::Constant *
CodeGenFunction::CreateStaticVarDecl(const VarDecl &D,
- const char *Separator,
llvm::GlobalValue::LinkageTypes Linkage) {
QualType Ty = D.getType();
assert(Ty->isConstantSizeType() && "VLAs can't be static");
@@ -184,7 +182,7 @@ CodeGenFunction::CreateStaticVarDecl(const VarDecl &D,
if (D.hasAttr<AsmLabelAttr>())
Name = CGM.getMangledName(&D);
else
- Name = GetStaticDeclName(*this, D, Separator);
+ Name = GetStaticDeclName(*this, D);
llvm::Type *LTy = CGM.getTypes().ConvertTypeForMem(Ty);
unsigned AddrSpace =
@@ -302,7 +300,7 @@ void CodeGenFunction::EmitStaticVarDecl(const VarDecl &D,
CGM.getStaticLocalDeclAddress(&D);
if (!addr)
- addr = CreateStaticVarDecl(D, ".", Linkage);
+ addr = CreateStaticVarDecl(D, Linkage);
// Store into LocalDeclMap before generating initializer to handle
// circular references.
@@ -1129,7 +1127,7 @@ void CodeGenFunction::EmitAutoVarInit(const AutoVarEmission &emission) {
} else {
// Otherwise, create a temporary global with the initializer then
// memcpy from the global to the alloca.
- std::string Name = GetStaticDeclName(*this, D, ".");
+ std::string Name = GetStaticDeclName(*this, D);
llvm::GlobalVariable *GV =
new llvm::GlobalVariable(CGM.getModule(), constant->getType(), true,
llvm::GlobalValue::PrivateLinkage,
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index b612415a4d6..84962927990 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -2425,7 +2425,6 @@ public:
/// CreateStaticVarDecl - Create a zero-initialized LLVM global for
/// a static local variable.
llvm::Constant *CreateStaticVarDecl(const VarDecl &D,
- const char *Separator,
llvm::GlobalValue::LinkageTypes Linkage);
/// AddInitializerToStaticVarDecl - Add the initializer for 'D' to the
OpenPOWER on IntegriCloud