From 73713f3e5ef2ecf1e5afafa89f76ab89cc06b18e Mon Sep 17 00:00:00 2001 From: Dominic Chen Date: Fri, 24 Jan 2020 17:21:14 -0500 Subject: RNG: Take pass name as argument instead of pass pointer. Summary: With the new pass manager, it is not possible to obtain a pointer to the pass. Reviewers: jfb, rinon, yln Subscribers: hiraditya, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D73390 --- llvm/lib/IR/Module.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'llvm/lib/IR/Module.cpp') diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp index c2083f5..f1acf46 100644 --- a/llvm/lib/IR/Module.cpp +++ b/llvm/lib/IR/Module.cpp @@ -86,8 +86,9 @@ Module::~Module() { IFuncList.clear(); } -std::unique_ptr Module::createRNG(const Pass* P) const { - SmallString<32> Salt(P->getPassName()); +std::unique_ptr +Module::createRNG(const StringRef Name) const { + SmallString<32> Salt(Name); // This RNG is guaranteed to produce the same random stream only // when the Module ID and thus the input filename is the same. This @@ -101,7 +102,8 @@ std::unique_ptr Module::createRNG(const Pass* P) const { // store salt metadata from the Module constructor. Salt += sys::path::filename(getModuleIdentifier()); - return std::unique_ptr(new RandomNumberGenerator(Salt)); + return std::unique_ptr( + new RandomNumberGenerator(Salt)); } /// getNamedValue - Return the first global value in the module with -- cgit v1.1