1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Rename variables to reflect linker split (NFC)

Renamed variables to be more reflective of whether they are
an instance of Linker, IRLinker or ModuleLinker. Also fix a stale
comment.

llvm-svn: 256011
This commit is contained in:
Teresa Johnson 2015-12-18 19:28:59 +00:00
parent d315447cf7
commit d80a73c588
4 changed files with 26 additions and 26 deletions

View File

@ -171,7 +171,7 @@ private:
LLVMContext &Context;
std::unique_ptr<Module> MergedModule;
std::unique_ptr<Linker> IRLinker;
std::unique_ptr<Linker> TheLinker;
std::unique_ptr<TargetMachine> TargetMach;
bool EmitDwarfDebugInfo = false;
bool ScopeRestrictionsDone = false;

View File

@ -66,7 +66,7 @@ const char* LTOCodeGenerator::getVersionString() {
LTOCodeGenerator::LTOCodeGenerator(LLVMContext &Context)
: Context(Context), MergedModule(new Module("ld-temp.o", Context)),
IRLinker(new Linker(*MergedModule)) {
TheLinker(new Linker(*MergedModule)) {
initializeLTOPasses();
}
@ -106,7 +106,7 @@ bool LTOCodeGenerator::addModule(LTOModule *Mod) {
assert(&Mod->getModule().getContext() == &Context &&
"Expected module in same context");
bool ret = IRLinker->linkInModule(Mod->takeModule());
bool ret = TheLinker->linkInModule(Mod->takeModule());
const std::vector<const char *> &undefs = Mod->getAsmUndefinedRefs();
for (int i = 0, e = undefs.size(); i != e; ++i)
@ -122,7 +122,7 @@ void LTOCodeGenerator::setModule(std::unique_ptr<LTOModule> Mod) {
AsmUndefinedRefs.clear();
MergedModule = Mod->takeModule();
IRLinker = make_unique<Linker>(*MergedModule);
TheLinker = make_unique<Linker>(*MergedModule);
const std::vector<const char*> &Undefs = Mod->getAsmUndefinedRefs();
for (int I = 0, E = Undefs.size(); I != E; ++I)

View File

@ -335,7 +335,7 @@ LinkDiagnosticInfo::LinkDiagnosticInfo(DiagnosticSeverity Severity,
void LinkDiagnosticInfo::print(DiagnosticPrinter &DP) const { DP << Msg; }
//===----------------------------------------------------------------------===//
// ModuleLinker implementation.
// IRLinker implementation.
//===----------------------------------------------------------------------===//
namespace {
@ -345,10 +345,10 @@ class IRLinker;
/// speeds up linking for modules with many/ lazily linked functions of which
/// few get used.
class GlobalValueMaterializer final : public ValueMaterializer {
IRLinker *ModLinker;
IRLinker *TheIRLinker;
public:
GlobalValueMaterializer(IRLinker *ModLinker) : ModLinker(ModLinker) {}
GlobalValueMaterializer(IRLinker *TheIRLinker) : TheIRLinker(TheIRLinker) {}
Value *materializeDeclFor(Value *V) override;
void materializeInitFor(GlobalValue *New, GlobalValue *Old) override;
Metadata *mapTemporaryMetadata(Metadata *MD) override;
@ -358,10 +358,10 @@ public:
};
class LocalValueMaterializer final : public ValueMaterializer {
IRLinker *ModLinker;
IRLinker *TheIRLinker;
public:
LocalValueMaterializer(IRLinker *ModLinker) : ModLinker(ModLinker) {}
LocalValueMaterializer(IRLinker *TheIRLinker) : TheIRLinker(TheIRLinker) {}
Value *materializeDeclFor(Value *V) override;
void materializeInitFor(GlobalValue *New, GlobalValue *Old) override;
Metadata *mapTemporaryMetadata(Metadata *MD) override;
@ -567,47 +567,47 @@ static void forceRenaming(GlobalValue *GV, StringRef Name) {
}
Value *GlobalValueMaterializer::materializeDeclFor(Value *V) {
return ModLinker->materializeDeclFor(V, false);
return TheIRLinker->materializeDeclFor(V, false);
}
void GlobalValueMaterializer::materializeInitFor(GlobalValue *New,
GlobalValue *Old) {
ModLinker->materializeInitFor(New, Old, false);
TheIRLinker->materializeInitFor(New, Old, false);
}
Metadata *GlobalValueMaterializer::mapTemporaryMetadata(Metadata *MD) {
return ModLinker->mapTemporaryMetadata(MD);
return TheIRLinker->mapTemporaryMetadata(MD);
}
void GlobalValueMaterializer::replaceTemporaryMetadata(const Metadata *OrigMD,
Metadata *NewMD) {
ModLinker->replaceTemporaryMetadata(OrigMD, NewMD);
TheIRLinker->replaceTemporaryMetadata(OrigMD, NewMD);
}
bool GlobalValueMaterializer::isMetadataNeeded(Metadata *MD) {
return ModLinker->isMetadataNeeded(MD);
return TheIRLinker->isMetadataNeeded(MD);
}
Value *LocalValueMaterializer::materializeDeclFor(Value *V) {
return ModLinker->materializeDeclFor(V, true);
return TheIRLinker->materializeDeclFor(V, true);
}
void LocalValueMaterializer::materializeInitFor(GlobalValue *New,
GlobalValue *Old) {
ModLinker->materializeInitFor(New, Old, true);
TheIRLinker->materializeInitFor(New, Old, true);
}
Metadata *LocalValueMaterializer::mapTemporaryMetadata(Metadata *MD) {
return ModLinker->mapTemporaryMetadata(MD);
return TheIRLinker->mapTemporaryMetadata(MD);
}
void LocalValueMaterializer::replaceTemporaryMetadata(const Metadata *OrigMD,
Metadata *NewMD) {
ModLinker->replaceTemporaryMetadata(OrigMD, NewMD);
TheIRLinker->replaceTemporaryMetadata(OrigMD, NewMD);
}
bool LocalValueMaterializer::isMetadataNeeded(Metadata *MD) {
return ModLinker->isMetadataNeeded(MD);
return TheIRLinker->isMetadataNeeded(MD);
}
Value *IRLinker::materializeDeclFor(Value *V, bool ForAlias) {
@ -1650,9 +1650,9 @@ bool IRMover::move(
std::function<void(GlobalValue &, ValueAdder Add)> AddLazyFor,
DenseMap<unsigned, MDNode *> *ValIDToTempMDMap,
bool IsMetadataLinkingPostpass) {
IRLinker TheLinker(Composite, IdentifiedStructTypes, Src, ValuesToLink,
AddLazyFor, ValIDToTempMDMap, IsMetadataLinkingPostpass);
bool RetCode = TheLinker.run();
IRLinker TheIRLinker(Composite, IdentifiedStructTypes, Src, ValuesToLink,
AddLazyFor, ValIDToTempMDMap, IsMetadataLinkingPostpass);
bool RetCode = TheIRLinker.run();
Composite.dropTriviallyDeadConstantArrays();
return RetCode;
}

View File

@ -803,14 +803,14 @@ bool Linker::linkInModule(std::unique_ptr<Module> Src, unsigned Flags,
const FunctionInfoIndex *Index,
DenseSet<const GlobalValue *> *FunctionsToImport,
DenseMap<unsigned, MDNode *> *ValIDToTempMDMap) {
ModuleLinker TheLinker(Mover, *Src, Flags, Index, FunctionsToImport,
ModuleLinker ModLinker(Mover, *Src, Flags, Index, FunctionsToImport,
ValIDToTempMDMap);
return TheLinker.run();
return ModLinker.run();
}
bool Linker::linkInModuleForCAPI(Module &Src) {
ModuleLinker TheLinker(Mover, Src, 0, nullptr, nullptr);
return TheLinker.run();
ModuleLinker ModLinker(Mover, Src, 0, nullptr, nullptr);
return ModLinker.run();
}
bool Linker::linkInMetadata(Module &Src,