aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorDominic Chen <d.c.ddcc@gmail.com>2020-01-24 17:21:14 -0500
committerDominic Chen <d.c.ddcc@gmail.com>2020-01-31 14:21:40 -0500
commit73713f3e5ef2ecf1e5afafa89f76ab89cc06b18e (patch)
tree324a81e2181de3f70a137c8afd9fa7497627a7c8 /llvm/lib/IR/Module.cpp
parentf465b1aff4d73a8b1f454ba8d0201a287735d246 (diff)
downloadllvm-73713f3e5ef2ecf1e5afafa89f76ab89cc06b18e.zip
llvm-73713f3e5ef2ecf1e5afafa89f76ab89cc06b18e.tar.gz
llvm-73713f3e5ef2ecf1e5afafa89f76ab89cc06b18e.tar.bz2
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
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r--llvm/lib/IR/Module.cpp8
1 files changed, 5 insertions, 3 deletions
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<RandomNumberGenerator> Module::createRNG(const Pass* P) const {
- SmallString<32> Salt(P->getPassName());
+std::unique_ptr<RandomNumberGenerator>
+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<RandomNumberGenerator> Module::createRNG(const Pass* P) const {
// store salt metadata from the Module constructor.
Salt += sys::path::filename(getModuleIdentifier());
- return std::unique_ptr<RandomNumberGenerator>(new RandomNumberGenerator(Salt));
+ return std::unique_ptr<RandomNumberGenerator>(
+ new RandomNumberGenerator(Salt));
}
/// getNamedValue - Return the first global value in the module with