aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-24 05:29:24 +0000
committerChris Lattner <sabre@nondot.org>2008-11-24 05:29:24 +0000
commitd9d22dd9c94618490dbffb0e2caf222530ca39d3 (patch)
treeb93ae748c2c5dc85678512aa3c958323b717ae26 /lib/CodeGen/CodeGenModule.cpp
parente8a32b855ce4e8580a191f8d29d2f3f459834302 (diff)
Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
uses of getName() with uses of getDeclName(). This upgrades a bunch of diags to take DeclNames instead of std::strings. This also tweaks a couple of diagnostics to be cleaner and changes CheckInitializerTypes/PerformInitializationByConstructor to pass around DeclarationNames instead of std::strings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59947 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 2ff2beeb83..f0aa8b7d14 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -321,9 +321,7 @@ void CodeGenModule::EmitAliases() {
llvm::GlobalValue *GA =
new llvm::GlobalAlias(aliasee->getType(),
llvm::Function::ExternalLinkage,
- D->getName(),
- aliasee,
- &getModule());
+ D->getNameAsString(), aliasee, &getModule());
llvm::GlobalValue *&Entry = GlobalDeclMap[D->getIdentifier()];
if (Entry) {
@@ -482,7 +480,7 @@ void CodeGenModule::EmitGlobalDefinition(const ValueDecl *D) {
if (!Entry)
Entry = new llvm::GlobalVariable(Ty, false,
llvm::GlobalValue::ExternalLinkage,
- 0, D->getName(), &getModule(), 0,
+ 0, D->getNameAsString(), &getModule(), 0,
ASTTy.getAddressSpace());
// Make sure the result is of the correct type.
@@ -518,7 +516,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
if (!GV) {
GV = new llvm::GlobalVariable(InitType, false,
llvm::GlobalValue::ExternalLinkage,
- 0, D->getName(), &getModule(), 0,
+ 0, D->getNameAsString(), &getModule(), 0,
ASTTy.getAddressSpace());
} else if (GV->getType() !=
llvm::PointerType::get(InitType, ASTTy.getAddressSpace())) {
@@ -542,7 +540,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
// Make a new global with the correct type
GV = new llvm::GlobalVariable(InitType, false,
llvm::GlobalValue::ExternalLinkage,
- 0, D->getName(), &getModule(), 0,
+ 0, D->getNameAsString(), &getModule(), 0,
ASTTy.getAddressSpace());
// Steal the name of the old global
GV->takeName(OldGV);
@@ -630,7 +628,7 @@ CodeGenModule::EmitForwardFunctionDefinition(const FunctionDecl *D) {
const llvm::Type *Ty = getTypes().ConvertType(D->getType());
llvm::Function *F = llvm::Function::Create(cast<llvm::FunctionType>(Ty),
llvm::Function::ExternalLinkage,
- D->getName(), &getModule());
+ D->getNameAsString(),&getModule());
SetFunctionAttributes(D, F);
return F;
}