Temporarily XFAIL this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66866 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index 4120d9f..7190b92 100644
--- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
@@ -1619,14 +1619,12 @@
/// ConstructTypeDIE - Construct basic type die from DIBasicType.
void ConstructTypeDIE(CompileUnit *DW_Unit, DIE &Buffer,
DIBasicType BTy) {
-
// Get core information.
- std::string Name;
- BTy.getName(Name);
+ const char *Name = BTy.getName();
Buffer.setTag(DW_TAG_base_type);
AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, BTy.getEncoding());
// Add name if not anonymous or intermediate type.
- if (!Name.empty())
+ if (Name)
AddString(&Buffer, DW_AT_name, DW_FORM_string, Name);
uint64_t Size = BTy.getSizeInBits() >> 3;
AddUInt(&Buffer, DW_AT_byte_size, 0, Size);
@@ -1635,10 +1633,8 @@
/// ConstructTypeDIE - Construct derived type die from DIDerivedType.
void ConstructTypeDIE(CompileUnit *DW_Unit, DIE &Buffer,
DIDerivedType DTy) {
-
// Get core information.
- std::string Name;
- DTy.getName(Name);
+ const char *Name = DTy.getName();
uint64_t Size = DTy.getSizeInBits() >> 3;
unsigned Tag = DTy.getTag();
@@ -1652,7 +1648,7 @@
AddType(DW_Unit, &Buffer, FromTy);
// Add name if not anonymous or intermediate type.
- if (!Name.empty())
+ if (Name)
AddString(&Buffer, DW_AT_name, DW_FORM_string, Name);
// Add size if non-zero (derived types might be zero-sized.)
@@ -1669,8 +1665,7 @@
void ConstructTypeDIE(CompileUnit *DW_Unit, DIE &Buffer,
DICompositeType CTy) {
// Get core information.
- std::string Name;
- CTy.getName(Name);
+ const char *Name = CTy.getName();
uint64_t Size = CTy.getSizeInBits() >> 3;
unsigned Tag = CTy.getTag();
@@ -1746,7 +1741,7 @@
}
// Add name if not anonymous or intermediate type.
- if (!Name.empty())
+ if (Name)
AddString(&Buffer, DW_AT_name, DW_FORM_string, Name);
if (Tag == DW_TAG_enumeration_type || Tag == DW_TAG_structure_type
@@ -1811,8 +1806,7 @@
DIE *ConstructEnumTypeDIE(CompileUnit *DW_Unit, DIEnumerator *ETy) {
DIE *Enumerator = new DIE(DW_TAG_enumerator);
- std::string Name;
- ETy->getName(Name);
+ const char *Name = ETy->getName();
AddString(Enumerator, DW_AT_name, DW_FORM_string, Name);
int64_t Value = ETy->getEnumValue();
AddSInt(Enumerator, DW_AT_const_value, DW_FORM_sdata, Value);
@@ -1823,12 +1817,10 @@
DIE *CreateGlobalVariableDIE(CompileUnit *DW_Unit, const DIGlobalVariable &GV)
{
DIE *GVDie = new DIE(DW_TAG_variable);
- std::string Name;
- GV.getDisplayName(Name);
+ const char *Name = GV.getDisplayName();
AddString(GVDie, DW_AT_name, DW_FORM_string, Name);
- std::string LinkageName;
- GV.getLinkageName(LinkageName);
- if (!LinkageName.empty())
+ const char *LinkageName = GV.getLinkageName();
+ if (LinkageName)
AddString(GVDie, DW_AT_MIPS_linkage_name, DW_FORM_string, LinkageName);
AddType(DW_Unit, GVDie, GV.getType());
if (!GV.isLocalToUnit())
@@ -1840,9 +1832,8 @@
/// CreateMemberDIE - Create new member DIE.
DIE *CreateMemberDIE(CompileUnit *DW_Unit, const DIDerivedType &DT) {
DIE *MemberDie = new DIE(DT.getTag());
- std::string Name;
- DT.getName(Name);
- if (!Name.empty())
+ const char *Name = DT.getName();
+ if (Name)
AddString(MemberDie, DW_AT_name, DW_FORM_string, Name);
AddType(DW_Unit, MemberDie, DT.getTypeDerivedFrom());
@@ -1885,12 +1876,10 @@
const DISubprogram &SP,
bool IsConstructor = false) {
DIE *SPDie = new DIE(DW_TAG_subprogram);
- std::string Name;
- SP.getName(Name);
+ const char *Name = SP.getName();
AddString(SPDie, DW_AT_name, DW_FORM_string, Name);
- std::string LinkageName;
- SP.getLinkageName(LinkageName);
- if (!LinkageName.empty())
+ const char *LinkageName = SP.getLinkageName();
+ if (LinkageName)
AddString(SPDie, DW_AT_MIPS_linkage_name, DW_FORM_string,
LinkageName);
AddSourceLine(SPDie, &SP);
@@ -1956,8 +1945,7 @@
// Define variable debug information entry.
DIE *VariableDie = new DIE(Tag);
- std::string Name;
- VD.getName(Name);
+ const char *Name = VD.getName();
AddString(VariableDie, DW_AT_name, DW_FORM_string, Name);
// Add source line info if available.
@@ -2819,24 +2807,23 @@
void ConstructCompileUnit(GlobalVariable *GV) {
DICompileUnit DIUnit(GV);
- std::string Dir, FN, Prod;
- unsigned ID = GetOrCreateSourceID(DIUnit.getDirectory(Dir),
- DIUnit.getFilename(FN));
+ const char *Dir = DIUnit.getDirectory();
+ const char *FN = DIUnit.getFilename();
+ unsigned ID = GetOrCreateSourceID(Dir, FN);
DIE *Die = new DIE(DW_TAG_compile_unit);
AddSectionOffset(Die, DW_AT_stmt_list, DW_FORM_data4,
DWLabel("section_line", 0), DWLabel("section_line", 0),
false);
- AddString(Die, DW_AT_producer, DW_FORM_string, DIUnit.getProducer(Prod));
+ AddString(Die, DW_AT_producer, DW_FORM_string, DIUnit.getProducer());
AddUInt(Die, DW_AT_language, DW_FORM_data1, DIUnit.getLanguage());
AddString(Die, DW_AT_name, DW_FORM_string, FN);
- if (!Dir.empty())
+ if (Dir)
AddString(Die, DW_AT_comp_dir, DW_FORM_string, Dir);
if (DIUnit.isOptimized())
AddUInt(Die, DW_AT_APPLE_optimized, DW_FORM_flag, 1);
- std::string Flags;
- DIUnit.getFlags(Flags);
- if (!Flags.empty())
+ const char *Flags = DIUnit.getFlags();
+ if (Flags)
AddString(Die, DW_AT_APPLE_flags, DW_FORM_string, Flags);
unsigned RVer = DIUnit.getRunTimeVersion();
if (RVer)
@@ -2895,8 +2882,7 @@
// Add to context owner.
DW_Unit->getDie()->AddChild(VariableDie);
// Expose as global. FIXME - need to check external flag.
- std::string Name;
- DW_Unit->AddGlobal(DI_GV.getName(Name), VariableDie);
+ DW_Unit->AddGlobal(DI_GV.getName(), VariableDie);
return true;
}
@@ -2948,8 +2934,7 @@
// Add to context owner.
Unit->getDie()->AddChild(SubprogramDie);
// Expose as global.
- std::string Name;
- Unit->AddGlobal(SP.getName(Name), SubprogramDie);
+ Unit->AddGlobal(SP.getName(), SubprogramDie);
return true;
}
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 229376d..a0ed475 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -319,9 +319,8 @@
DbgStopPointInst *SPI = cast<DbgStopPointInst>(I);
if (DW && DW->ValidDebugInfo(SPI->getContext())) {
DICompileUnit CU(cast<GlobalVariable>(SPI->getContext()));
- std::string Dir, FN;
- unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(Dir),
- CU.getFilename(FN));
+ unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(),
+ CU.getFilename());
unsigned Line = SPI->getLine();
unsigned Col = SPI->getColumn();
unsigned ID = DW->RecordSourceLine(Line, Col, SrcFile);
@@ -362,9 +361,8 @@
// (most?) gdb expects.
DISubprogram Subprogram(cast<GlobalVariable>(SP));
DICompileUnit CompileUnit = Subprogram.getCompileUnit();
- std::string Dir, FN;
- unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(Dir),
- CompileUnit.getFilename(FN));
+ unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(),
+ CompileUnit.getFilename());
// Record the source line but does not create a label for the normal
// function start. It will be emitted at asm emission time. However,
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 8c074e7..0854aad 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -1287,9 +1287,8 @@
GlobalVariable *CU_GV = cast<GlobalVariable>(DSP->getCompileUnit());
if (DW && (useDEBUG_LOC || useLABEL) && !CU_GV->isDeclaration()) {
DICompileUnit CU(cast<GlobalVariable>(DSP->getCompileUnit()));
- std::string Dir, FN;
- unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(Dir),
- CU.getFilename(FN));
+ unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(),
+ CU.getFilename());
unsigned Line = DSP->getLine();
unsigned Col = DSP->getColumn();
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 71560fe2..4afc3b5 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2931,8 +2931,11 @@
return false;
GlobalVariable *GV = dyn_cast<GlobalVariable>(G->getGlobal());
- if (GV && GetConstantStringInfo(GV, Str, SrcDelta, false))
- return true;
+ if (GV) {
+ const char *SI = GetConstantStringInfo(GV, SrcDelta, false);
+ Str = (SI ? SI : "");
+ if (!Str.empty()) return true;
+ }
return false;
}
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 0dbc35b..b3a06ea 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -335,9 +335,8 @@
if (DW && DW->ValidDebugInfo(SPI->getContext())) {
DICompileUnit CU(cast<GlobalVariable>(SPI->getContext()));
- std::string Dir, FN;
- unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(Dir),
- CU.getFilename(FN));
+ unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(),
+ CU.getFilename());
unsigned idx = MF->getOrCreateDebugLocID(SrcFile,
SPI->getLine(),
SPI->getColumn());
@@ -355,9 +354,8 @@
if (DW->ValidDebugInfo(SP)) {
DISubprogram Subprogram(cast<GlobalVariable>(SP));
DICompileUnit CU(Subprogram.getCompileUnit());
- std::string Dir, FN;
- unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(Dir),
- CU.getFilename(FN));
+ unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(),
+ CU.getFilename());
unsigned Line = Subprogram.getLineNumber();
DL = DebugLoc::get(MF->getOrCreateDebugLocID(SrcFile, Line, 0));
}
@@ -3904,9 +3902,8 @@
SPI.getColumn(),
SPI.getContext()));
DICompileUnit CU(cast<GlobalVariable>(SPI.getContext()));
- std::string Dir, FN;
- unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(Dir),
- CU.getFilename(FN));
+ unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(),
+ CU.getFilename());
unsigned idx = MF.getOrCreateDebugLocID(SrcFile,
SPI.getLine(), SPI.getColumn());
setCurDebugLoc(DebugLoc::get(idx));
@@ -3950,9 +3947,8 @@
MachineFunction &MF = DAG.getMachineFunction();
DISubprogram Subprogram(cast<GlobalVariable>(SP));
DICompileUnit CompileUnit = Subprogram.getCompileUnit();
- std::string Dir, FN;
- unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(Dir),
- CompileUnit.getFilename(FN));
+ unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(),
+ CompileUnit.getFilename());
// Record the source line but does not create a label for the normal
// function start. It will be emitted at asm emission time. However,
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index 0392338..9475ffa 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
@@ -179,8 +179,8 @@
}
} else if (const DbgStopPointSDNode *D = dyn_cast<DbgStopPointSDNode>(Node)) {
DICompileUnit CU(cast<GlobalVariable>(D->getCompileUnit()));
- std::string FN;
- Op += ": " + CU.getFilename(FN);
+ const char *FN = CU.getFilename();
+ Op += ": " + std::string(FN ? FN : "");
Op += ":" + utostr(D->getLine());
if (D->getColumn() != 0)
Op += ":" + utostr(D->getColumn());