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) {
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());
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());
/// 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
/// his can make the graph smaller.
///
void Function::viewCFGOnly() const {
- ViewGraph(this, "cfg" + getName(), true);
+ ViewGraph(this, "cfg" + getNameStr(), true);
}
FunctionPass *llvm::createCFGPrinterPass () {
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,
bool ShortNames) {
if (ShortNames && Node->getBasicBlock() &&
!Node->getBasicBlock()->getName().empty())
- return Node->getBasicBlock()->getName() + ":";
+ return Node->getBasicBlock()->getNameStr() + ":";
std::ostringstream Out;
if (ShortNames) {
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";
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";
// 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";
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());
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";
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;
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.
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) {
}
}
} else {
- std::string Prefix = GV->getName() + "." + Addr + ".";
+ std::string Prefix = GV->getNameStr() + "." + Addr + ".";
Name = PAN::getUdataSectionName(BSSSections.size(), Prefix) + " " + Addr;
}
}
}
} else {
- std::string Prefix = GV->getName() + "." + Addr + ".";
+ std::string Prefix = GV->getNameStr() + "." + Addr + ".";
Name = PAN::getIdataSectionName(IDATASections.size(), Prefix) + " " + Addr;
}
}
}
} else {
- std::string Prefix = GV->getName() + "." + Addr + ".";
+ std::string Prefix = GV->getNameStr() + "." + Addr + ".";
Name = PAN::getRomdataSectionName(ROSections.size(), Prefix) + " " + Addr;
}
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.
// Leopard and above support aligned common symbols.
COMMDirectiveTakesAlignment = (Subtarget->getDarwinVers() >= 9);
HasDotTypeDotSizeDirective = false;
-
+
if (is64Bit) {
PersonalityPrefix = "";
PersonalitySuffix = "+4@GOTPCREL";
std::string getDescription() const {
return std::string((IsArg ? "Argument #" : "Return value #"))
- + utostr(Idx) + " of function " + F->getName();
+ + utostr(Idx) + " of function " + F->getNameStr();
}
};
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++;
// 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();