SegmentInfo::generateName: move to BinaryFile.cpp

This commit is contained in:
Alessandro Di Federico
2021-05-30 08:25:34 +02:00
parent 1359bd967d
commit c8ff9cde04
3 changed files with 11 additions and 11 deletions
-10
View File
@@ -346,16 +346,6 @@ CodeGenerator::CodeGenerator(BinaryFile &Binary,
NeededLibsStream << Library << "\n";
}
std::string SegmentInfo::generateName() {
// Create name from start and size
std::stringstream NameStream;
NameStream << "o_" << (IsReadable ? "r" : "") << (IsWriteable ? "w" : "")
<< (IsExecutable ? "x" : "") << "_0x" << std::hex
<< StartVirtualAddress.address();
return NameStream.str();
}
static BasicBlock *replaceFunction(Function *ToReplace) {
// Save metadata
SmallVector<std::pair<unsigned, MDNode *>, 4> SavedMetadata;