diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-24 03:54:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-24 03:54:41 +0000 |
commit | 8ec03f58c33c33a917f54bb7f2cd61b6d7ffe0ca (patch) | |
tree | ab82837deaf7ca40831de4b7467d2d3c1982c9ff /lib/CodeGen/CGDecl.cpp | |
parent | bb49c3ee5d270485f4b273691fd14bc97403fa5d (diff) |
Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
assert if the name is not an identifier. Update callers to do the right
thing and avoid this method in unsafe cases. This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59936 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 7a86d24801..77ef57750e 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -146,7 +146,8 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { if (!Target.useGlobalsForAutomaticVariables()) { // A normal fixed sized variable becomes an alloca in the entry block. const llvm::Type *LTy = ConvertType(Ty); - llvm::AllocaInst * Alloc = CreateTempAlloca(LTy, D.getIdentifierName()); + llvm::AllocaInst *Alloc = + CreateTempAlloca(LTy, D.getIdentifier()->getName()); unsigned align = getContext().getTypeAlign(Ty); if (const AlignedAttr* AA = D.getAttr<AlignedAttr>()) align = std::max(align, AA->getAlignment()); @@ -164,7 +165,8 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { // FIXME: VLA: Add VLA support. For now just make up enough to let // the compile go through. const llvm::Type *LTy = ConvertType(Ty); - llvm::AllocaInst * Alloc = CreateTempAlloca(LTy, D.getIdentifierName()); + llvm::AllocaInst *Alloc = + CreateTempAlloca(LTy, D.getIdentifier()->getName()); DeclPtr = Alloc; } |