Switch to using llvm::Value::getName()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77147 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index aec7fad..b8269eb 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -95,8 +95,7 @@
     if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(CurFuncDecl))
       ContextName = CGM.getMangledName(FD);
     else if (isa<ObjCMethodDecl>(CurFuncDecl))
-      ContextName = std::string(CurFn->getNameStart(), 
-                                CurFn->getNameStart() + CurFn->getNameLen());
+      ContextName = CurFn->getName();
     else
       assert(0 && "Unknown context for block var decl");
     
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp
index a89ef9e..445efe8 100644
--- a/lib/CodeGen/CGExprComplex.cpp
+++ b/lib/CodeGen/CGExprComplex.cpp
@@ -261,8 +261,8 @@
 /// load the real and imaginary pieces, returning them as Real/Imag.
 ComplexPairTy ComplexExprEmitter::EmitLoadOfComplex(llvm::Value *SrcPtr,
                                                     bool isVolatile) {
-  llvm::SmallString<64> Name(SrcPtr->getNameStart(),
-                             SrcPtr->getNameStart()+SrcPtr->getNameLen());
+  llvm::SmallString<64> Name(SrcPtr->getName().begin(),
+                             SrcPtr->getName().end());
   
   llvm::Value *Real=0, *Imag=0;