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)
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");
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 =
CGM.getStaticLocalDeclAddress(&D);
if (!addr)
- addr = CreateStaticVarDecl(D, ".", Linkage);
+ addr = CreateStaticVarDecl(D, Linkage);
// Store into LocalDeclMap before generating initializer to handle
// circular references.
} 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,