Avoid compiler warning (in -Asserts mode)
[oota-llvm.git] / lib / Target / PIC16 / PIC16DebugInfo.cpp
index 1766fde4b6b43fc5a744a55177821b585364021c..fd0d309e141c94fd7a37654b078d0d0a9d9cf59f 100644 (file)
@@ -16,7 +16,7 @@
 #include "llvm/GlobalVariable.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/Support/DebugLoc.h"
-#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/FormattedStream.h"
 
 using namespace llvm;
 
@@ -117,7 +117,7 @@ void PIC16DbgInfo::PopulateStructOrUnionTypeInfo (DIType Ty,
   CTy.getName(TagName);
   // UniqueSuffix is .number where number is obtained from
   // llvm.dbg.composite<number>.
-  std::string UniqueSuffix = "." + Ty.getGV()->getName().substr(18);
+  std::string UniqueSuffix = "." + Ty.getGV()->getNameStr().substr(18);
   TagName += UniqueSuffix;
   unsigned short size = CTy.getSizeInBits()/8;
   // 7th and 8th byte represent size.
@@ -327,7 +327,7 @@ void PIC16DbgInfo::EmitCompositeTypeDecls(Module &M) {
     // Structures and union declaration's debug info has llvm.dbg.composite
     // in its name.
     // FIXME: Checking and relying on llvm.dbg.composite name is not a good idea.
-    if(I->getName().find("llvm.dbg.composite") != std::string::npos) {
+    if(I->getNameStr().find("llvm.dbg.composite") != std::string::npos) {
       GlobalVariable *GV = cast<GlobalVariable >(I);
       DICompositeType CTy(GV);
       if (CTy.getTag() == dwarf::DW_TAG_union_type ||
@@ -446,7 +446,7 @@ void PIC16DbgInfo::EmitVarDebugInfo(Module &M) {
     bool HasAux = false;
     int Aux[PIC16Dbg::AuxSize] = { 0 };
     std::string TagName = "";
-    std::string VarName = TAI->getGlobalPrefix()+DIGV.getGlobal()->getName();
+    std::string VarName = TAI->getGlobalPrefix()+DIGV.getGlobal()->getNameStr();
     PopulateDebugInfo(Ty, TypeNo, HasAux, Aux, TagName);
     // Emit debug info only if type information is availaible.
     if (TypeNo != PIC16Dbg::T_NULL) {