mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-15 07:59:57 +00:00
ValueMaterializer: rename materializeDeclFor() to materialize()
It may materialize a declaration, or a definition. The name could be misleading. This is following a merge of materializeInitFor() into materializeDeclFor(). Differential Revision: http://reviews.llvm.org/D20593 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270759 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f29dafd655
commit
055a0c9555
@ -46,7 +46,7 @@ private:
|
||||
class LambdaMaterializer final : public ValueMaterializer {
|
||||
public:
|
||||
LambdaMaterializer(MaterializerFtor M) : M(std::move(M)) {}
|
||||
Value *materializeDeclFor(Value *V) final { return M(V); }
|
||||
Value *materialize(Value *V) final { return M(V); }
|
||||
|
||||
private:
|
||||
MaterializerFtor M;
|
||||
|
@ -49,7 +49,7 @@ protected:
|
||||
public:
|
||||
/// This method can be implemented to generate a mapped Value on demand. For
|
||||
/// example, if linking lazily. Returns null if the value is not materialized.
|
||||
virtual Value *materializeDeclFor(Value *V) = 0;
|
||||
virtual Value *materialize(Value *V) = 0;
|
||||
};
|
||||
|
||||
/// These are flags that the value mapping APIs allow.
|
||||
|
@ -349,7 +349,7 @@ class GlobalValueMaterializer final : public ValueMaterializer {
|
||||
|
||||
public:
|
||||
GlobalValueMaterializer(IRLinker &TheIRLinker) : TheIRLinker(TheIRLinker) {}
|
||||
Value *materializeDeclFor(Value *V) override;
|
||||
Value *materialize(Value *V) override;
|
||||
};
|
||||
|
||||
class LocalValueMaterializer final : public ValueMaterializer {
|
||||
@ -357,7 +357,7 @@ class LocalValueMaterializer final : public ValueMaterializer {
|
||||
|
||||
public:
|
||||
LocalValueMaterializer(IRLinker &TheIRLinker) : TheIRLinker(TheIRLinker) {}
|
||||
Value *materializeDeclFor(Value *V) override;
|
||||
Value *materialize(Value *V) override;
|
||||
};
|
||||
|
||||
/// Type of the Metadata map in \a ValueToValueMapTy.
|
||||
@ -513,11 +513,11 @@ static void forceRenaming(GlobalValue *GV, StringRef Name) {
|
||||
}
|
||||
}
|
||||
|
||||
Value *GlobalValueMaterializer::materializeDeclFor(Value *SGV) {
|
||||
Value *GlobalValueMaterializer::materialize(Value *SGV) {
|
||||
return TheIRLinker.materialize(SGV, false);
|
||||
}
|
||||
|
||||
Value *LocalValueMaterializer::materializeDeclFor(Value *SGV) {
|
||||
Value *LocalValueMaterializer::materialize(Value *SGV) {
|
||||
return TheIRLinker.materialize(SGV, true);
|
||||
}
|
||||
|
||||
|
@ -361,9 +361,9 @@ Value *Mapper::mapValue(const Value *V) {
|
||||
|
||||
// If we have a materializer and it can materialize a value, use that.
|
||||
if (auto *Materializer = getMaterializer()) {
|
||||
if (Value *NewV =
|
||||
Materializer->materializeDeclFor(const_cast<Value *>(V))) {
|
||||
return getVM()[V] = NewV;
|
||||
if (Value *NewV = Materializer->materialize(const_cast<Value *>(V))) {
|
||||
getVM()[V] = NewV;
|
||||
return NewV;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user