mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-19 02:03:11 +00:00
Switch to getNameStr().
llvm-svn: 76962
This commit is contained in:
parent
076387bcc0
commit
e3fea713f1
@ -35,14 +35,14 @@ namespace llvm {
|
||||
template<>
|
||||
struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
|
||||
static std::string getGraphName(const Function *F) {
|
||||
return "CFG for '" + F->getName() + "' function";
|
||||
return "CFG for '" + F->getNameStr() + "' function";
|
||||
}
|
||||
|
||||
static std::string getNodeLabel(const BasicBlock *Node,
|
||||
const Function *Graph,
|
||||
bool ShortNames) {
|
||||
if (ShortNames && !Node->getName().empty())
|
||||
return Node->getName() + ":";
|
||||
return Node->getNameStr() + ":";
|
||||
|
||||
std::ostringstream Out;
|
||||
if (ShortNames) {
|
||||
@ -136,7 +136,7 @@ namespace {
|
||||
explicit CFGPrinter(void *pid) : FunctionPass(pid) {}
|
||||
|
||||
virtual bool runOnFunction(Function &F) {
|
||||
std::string Filename = "cfg." + F.getName() + ".dot";
|
||||
std::string Filename = "cfg." + F.getNameStr() + ".dot";
|
||||
cerr << "Writing '" << Filename << "'...";
|
||||
std::ofstream File(Filename.c_str());
|
||||
|
||||
@ -166,7 +166,7 @@ namespace {
|
||||
CFGOnlyPrinter() : FunctionPass(&ID) {}
|
||||
explicit CFGOnlyPrinter(void *pid) : FunctionPass(pid) {}
|
||||
virtual bool runOnFunction(Function &F) {
|
||||
std::string Filename = "cfg." + F.getName() + ".dot";
|
||||
std::string Filename = "cfg." + F.getNameStr() + ".dot";
|
||||
cerr << "Writing '" << Filename << "'...";
|
||||
std::ofstream File(Filename.c_str());
|
||||
|
||||
@ -196,7 +196,7 @@ P2("dot-cfg-only",
|
||||
/// being a 'dot' and 'gv' program in your path.
|
||||
///
|
||||
void Function::viewCFG() const {
|
||||
ViewGraph(this, "cfg" + getName());
|
||||
ViewGraph(this, "cfg" + getNameStr());
|
||||
}
|
||||
|
||||
/// viewCFGOnly - This function is meant for use from the debugger. It works
|
||||
@ -205,7 +205,7 @@ void Function::viewCFG() const {
|
||||
/// his can make the graph smaller.
|
||||
///
|
||||
void Function::viewCFGOnly() const {
|
||||
ViewGraph(this, "cfg" + getName(), true);
|
||||
ViewGraph(this, "cfg" + getNameStr(), true);
|
||||
}
|
||||
|
||||
FunctionPass *llvm::createCFGPrinterPass () {
|
||||
|
@ -304,7 +304,7 @@ namespace llvm {
|
||||
template<>
|
||||
struct DOTGraphTraits<const MachineFunction*> : public DefaultDOTGraphTraits {
|
||||
static std::string getGraphName(const MachineFunction *F) {
|
||||
return "CFG for '" + F->getFunction()->getName() + "' function";
|
||||
return "CFG for '" + F->getFunction()->getNameStr() + "' function";
|
||||
}
|
||||
|
||||
static std::string getNodeLabel(const MachineBasicBlock *Node,
|
||||
@ -312,7 +312,7 @@ namespace llvm {
|
||||
bool ShortNames) {
|
||||
if (ShortNames && Node->getBasicBlock() &&
|
||||
!Node->getBasicBlock()->getName().empty())
|
||||
return Node->getBasicBlock()->getName() + ":";
|
||||
return Node->getBasicBlock()->getNameStr() + ":";
|
||||
|
||||
std::ostringstream Out;
|
||||
if (ShortNames) {
|
||||
@ -339,7 +339,7 @@ namespace llvm {
|
||||
void MachineFunction::viewCFG() const
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
ViewGraph(this, "mf" + getFunction()->getName());
|
||||
ViewGraph(this, "mf" + getFunction()->getNameStr());
|
||||
#else
|
||||
cerr << "SelectionDAG::viewGraph is only available in debug builds on "
|
||||
<< "systems with Graphviz or gv!\n";
|
||||
@ -349,7 +349,7 @@ void MachineFunction::viewCFG() const
|
||||
void MachineFunction::viewCFGOnly() const
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
ViewGraph(this, "mf" + getFunction()->getName(), true);
|
||||
ViewGraph(this, "mf" + getFunction()->getNameStr(), true);
|
||||
#else
|
||||
cerr << "SelectionDAG::viewGraph is only available in debug builds on "
|
||||
<< "systems with Graphviz or gv!\n";
|
||||
|
@ -86,12 +86,12 @@ void ScheduleDAG::viewGraph() {
|
||||
// This code is only for debugging!
|
||||
#ifndef NDEBUG
|
||||
if (BB->getBasicBlock())
|
||||
ViewGraph(this, "dag." + MF.getFunction()->getName(), false,
|
||||
"Scheduling-Units Graph for " + MF.getFunction()->getName() +
|
||||
":" + BB->getBasicBlock()->getName());
|
||||
ViewGraph(this, "dag." + MF.getFunction()->getNameStr(), false,
|
||||
"Scheduling-Units Graph for " + MF.getFunction()->getNameStr() +
|
||||
":" + BB->getBasicBlock()->getNameStr());
|
||||
else
|
||||
ViewGraph(this, "dag." + MF.getFunction()->getName(), false,
|
||||
"Scheduling-Units Graph for " + MF.getFunction()->getName());
|
||||
ViewGraph(this, "dag." + MF.getFunction()->getNameStr(), false,
|
||||
"Scheduling-Units Graph for " + MF.getFunction()->getNameStr());
|
||||
#else
|
||||
cerr << "ScheduleDAG::viewGraph is only available in debug builds on "
|
||||
<< "systems with Graphviz or gv!\n";
|
||||
|
@ -568,8 +568,8 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
|
||||
if (ViewDAGCombine1 || ViewLegalizeTypesDAGs || ViewLegalizeDAGs ||
|
||||
ViewDAGCombine2 || ViewDAGCombineLT || ViewISelDAGs || ViewSchedDAGs ||
|
||||
ViewSUnitDAGs)
|
||||
BlockName = CurDAG->getMachineFunction().getFunction()->getName() + ":" +
|
||||
BB->getBasicBlock()->getName();
|
||||
BlockName = CurDAG->getMachineFunction().getFunction()->getNameStr() + ":" +
|
||||
BB->getBasicBlock()->getNameStr();
|
||||
|
||||
DOUT << "Initial selection DAG:\n";
|
||||
DEBUG(CurDAG->dump());
|
||||
|
@ -138,8 +138,8 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
|
||||
void SelectionDAG::viewGraph(const std::string &Title) {
|
||||
// This code is only for debugging!
|
||||
#ifndef NDEBUG
|
||||
ViewGraph(this, "dag." + getMachineFunction().getFunction()->getName(), false,
|
||||
Title);
|
||||
ViewGraph(this, "dag." + getMachineFunction().getFunction()->getNameStr(),
|
||||
false, Title);
|
||||
#else
|
||||
cerr << "SelectionDAG::viewGraph is only available in debug builds on "
|
||||
<< "systems with Graphviz or gv!\n";
|
||||
|
@ -96,15 +96,15 @@ static ExFunc lookupFunction(const Function *F) {
|
||||
const FunctionType *FT = F->getFunctionType();
|
||||
for (unsigned i = 0, e = FT->getNumContainedTypes(); i != e; ++i)
|
||||
ExtName += getTypeID(FT->getContainedType(i));
|
||||
ExtName += "_" + F->getName();
|
||||
ExtName + "_" + F->getNameStr();
|
||||
|
||||
sys::ScopedLock Writer(*FunctionsLock);
|
||||
ExFunc FnPtr = FuncNames[ExtName];
|
||||
if (FnPtr == 0)
|
||||
FnPtr = FuncNames["lle_X_"+F->getName()];
|
||||
FnPtr = FuncNames["lle_X_" + F->getNameStr()];
|
||||
if (FnPtr == 0) // Try calling a generic function... if it exists...
|
||||
FnPtr = (ExFunc)(intptr_t)
|
||||
sys::DynamicLibrary::SearchForAddressOfSymbol("lle_X_"+F->getName());
|
||||
sys::DynamicLibrary::SearchForAddressOfSymbol("lle_X_"+F->getNameStr());
|
||||
if (FnPtr != 0)
|
||||
ExportedFunctions->insert(std::make_pair(F, FnPtr)); // Cache for later
|
||||
return FnPtr;
|
||||
|
@ -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.
|
||||
@ -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) {
|
||||
|
@ -310,7 +310,7 @@ PIC16TargetAsmInfo::CreateBSSSectionForGlobal(const GlobalVariable *GV,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
std::string Prefix = GV->getName() + "." + Addr + ".";
|
||||
std::string Prefix = GV->getNameStr() + "." + Addr + ".";
|
||||
Name = PAN::getUdataSectionName(BSSSections.size(), Prefix) + " " + Addr;
|
||||
}
|
||||
|
||||
@ -361,7 +361,7 @@ PIC16TargetAsmInfo::CreateIDATASectionForGlobal(const GlobalVariable *GV,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
std::string Prefix = GV->getName() + "." + Addr + ".";
|
||||
std::string Prefix = GV->getNameStr() + "." + Addr + ".";
|
||||
Name = PAN::getIdataSectionName(IDATASections.size(), Prefix) + " " + Addr;
|
||||
}
|
||||
|
||||
@ -399,7 +399,7 @@ PIC16TargetAsmInfo::CreateROSectionForGlobal(const GlobalVariable *GV,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
std::string Prefix = GV->getName() + "." + Addr + ".";
|
||||
std::string Prefix = GV->getNameStr() + "." + Addr + ".";
|
||||
Name = PAN::getRomdataSectionName(ROSections.size(), Prefix) + " " + Addr;
|
||||
}
|
||||
|
||||
|
@ -45,8 +45,8 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
|
||||
|
||||
AlignmentIsInBytes = false;
|
||||
TextAlignFillValue = 0x90;
|
||||
|
||||
|
||||
|
||||
|
||||
if (!is64Bit)
|
||||
Data64bitsDirective = 0; // we can't emit a 64-bit unit
|
||||
ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
|
||||
@ -64,7 +64,7 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
|
||||
// Leopard and above support aligned common symbols.
|
||||
COMMDirectiveTakesAlignment = (Subtarget->getDarwinVers() >= 9);
|
||||
HasDotTypeDotSizeDirective = false;
|
||||
|
||||
|
||||
if (is64Bit) {
|
||||
PersonalityPrefix = "";
|
||||
PersonalitySuffix = "+4@GOTPCREL";
|
||||
|
@ -73,7 +73,7 @@ namespace {
|
||||
|
||||
std::string getDescription() const {
|
||||
return std::string((IsArg ? "Argument #" : "Return value #"))
|
||||
+ utostr(Idx) + " of function " + F->getName();
|
||||
+ utostr(Idx) + " of function " + F->getNameStr();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -307,11 +307,11 @@ Function *CodeExtractor::constructFunction(const Values &inputs,
|
||||
Value *Idx[2];
|
||||
Idx[0] = Context.getNullValue(Type::Int32Ty);
|
||||
Idx[1] = Context.getConstantInt(Type::Int32Ty, i);
|
||||
std::string GEPname = "gep_" + inputs[i]->getName();
|
||||
TerminatorInst *TI = newFunction->begin()->getTerminator();
|
||||
GetElementPtrInst *GEP = GetElementPtrInst::Create(AI, Idx, Idx+2,
|
||||
GEPname, TI);
|
||||
RewriteVal = new LoadInst(GEP, "load" + GEPname, TI);
|
||||
GetElementPtrInst *GEP =
|
||||
GetElementPtrInst::Create(AI, Idx, Idx+2,
|
||||
"gep_" + inputs[i]->getName(), TI);
|
||||
RewriteVal = new LoadInst(GEP, "loadgep_" + inputs[i]->getName(), TI);
|
||||
} else
|
||||
RewriteVal = AI++;
|
||||
|
||||
|
@ -353,7 +353,7 @@ Module *BugDriver::ExtractMappedBlocksFromModule(const
|
||||
// If the BB doesn't have a name, give it one so we have something to key
|
||||
// off of.
|
||||
if (!BB->hasName()) BB->setName("tmpbb");
|
||||
BlocksToNotExtractFile << BB->getParent()->getName() << " "
|
||||
BlocksToNotExtractFile << BB->getParent()->getNameStr() << " "
|
||||
<< BB->getName() << "\n";
|
||||
}
|
||||
BlocksToNotExtractFile.close();
|
||||
|
Loading…
x
Reference in New Issue
Block a user