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
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 7a86d24..77ef577 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -146,7 +146,8 @@
     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 @@
     // 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;
   }