mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Add a pass to do call graph analyis to overlay the autos and frame sections of
leaf functions. This pass will be extended to color other nodes of the call tree as well in future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79631 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -82,6 +82,35 @@ getSectionForFunctionFrame(const std::string &FnName) const {
|
||||
return getPIC16Section(T.c_str(), SectionKind::getDataRel());
|
||||
}
|
||||
|
||||
std::string PIC16TargetObjectFile::getNameForFunctFrame(const Function *F,
|
||||
bool IsAutosSection) {
|
||||
std::string SectionName = F->getName();
|
||||
if (F->hasSection()) {
|
||||
std::string Sectn = F->getSection();
|
||||
std::string StrToFind = "Overlay=";
|
||||
unsigned Pos = Sectn.find(StrToFind);
|
||||
if (Pos != std::string::npos) {
|
||||
Pos += StrToFind.length();
|
||||
std::string Color = "";
|
||||
char c = Sectn.at(Pos);
|
||||
// A Color can only consist on upper case letters or underscore.
|
||||
while ((c >= 'A' && c<= 'Z') || c == '_') {
|
||||
Color.append(1,c);
|
||||
Pos++;
|
||||
if (Pos >= Sectn.length())
|
||||
break;
|
||||
c = Sectn.at(Pos);
|
||||
}
|
||||
// Autos Section need to be given a different name from function frame.
|
||||
if (IsAutosSection)
|
||||
SectionName = PAN::getAutosSectionForColor(Color);
|
||||
else
|
||||
SectionName = Color;
|
||||
}
|
||||
}
|
||||
return SectionName;
|
||||
}
|
||||
|
||||
const MCSection *
|
||||
PIC16TargetObjectFile::getBSSSectionForGlobal(const GlobalVariable *GV) const {
|
||||
assert(GV->hasInitializer() && "This global doesn't need space");
|
||||
|
Reference in New Issue
Block a user