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

llvm-svn: 270759
This commit is contained in:
Mehdi Amini 2016-05-25 21:03:21 +00:00
parent ad6c68d47a
commit 4f44ce6392
4 changed files with 9 additions and 9 deletions

View File

@ -46,7 +46,7 @@ private:
class LambdaMaterializer final : public ValueMaterializer { class LambdaMaterializer final : public ValueMaterializer {
public: public:
LambdaMaterializer(MaterializerFtor M) : M(std::move(M)) {} LambdaMaterializer(MaterializerFtor M) : M(std::move(M)) {}
Value *materializeDeclFor(Value *V) final { return M(V); } Value *materialize(Value *V) final { return M(V); }
private: private:
MaterializerFtor M; MaterializerFtor M;

View File

@ -49,7 +49,7 @@ protected:
public: public:
/// This method can be implemented to generate a mapped Value on demand. For /// 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. /// 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. /// These are flags that the value mapping APIs allow.

View File

@ -349,7 +349,7 @@ class GlobalValueMaterializer final : public ValueMaterializer {
public: public:
GlobalValueMaterializer(IRLinker &TheIRLinker) : TheIRLinker(TheIRLinker) {} GlobalValueMaterializer(IRLinker &TheIRLinker) : TheIRLinker(TheIRLinker) {}
Value *materializeDeclFor(Value *V) override; Value *materialize(Value *V) override;
}; };
class LocalValueMaterializer final : public ValueMaterializer { class LocalValueMaterializer final : public ValueMaterializer {
@ -357,7 +357,7 @@ class LocalValueMaterializer final : public ValueMaterializer {
public: public:
LocalValueMaterializer(IRLinker &TheIRLinker) : TheIRLinker(TheIRLinker) {} LocalValueMaterializer(IRLinker &TheIRLinker) : TheIRLinker(TheIRLinker) {}
Value *materializeDeclFor(Value *V) override; Value *materialize(Value *V) override;
}; };
/// Type of the Metadata map in \a ValueToValueMapTy. /// 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); return TheIRLinker.materialize(SGV, false);
} }
Value *LocalValueMaterializer::materializeDeclFor(Value *SGV) { Value *LocalValueMaterializer::materialize(Value *SGV) {
return TheIRLinker.materialize(SGV, true); return TheIRLinker.materialize(SGV, true);
} }

View File

@ -361,9 +361,9 @@ Value *Mapper::mapValue(const Value *V) {
// If we have a materializer and it can materialize a value, use that. // If we have a materializer and it can materialize a value, use that.
if (auto *Materializer = getMaterializer()) { if (auto *Materializer = getMaterializer()) {
if (Value *NewV = if (Value *NewV = Materializer->materialize(const_cast<Value *>(V))) {
Materializer->materializeDeclFor(const_cast<Value *>(V))) { getVM()[V] = NewV;
return getVM()[V] = NewV; return NewV;
} }
} }