aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CloneModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneModule.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneModule.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneModule.cpp b/llvm/lib/Transforms/Utils/CloneModule.cpp
index ab08335..53de62a 100644
--- a/llvm/lib/Transforms/Utils/CloneModule.cpp
+++ b/llvm/lib/Transforms/Utils/CloneModule.cpp
@@ -53,7 +53,7 @@ std::unique_ptr<Module> llvm::CloneModule(
for (Module::const_global_iterator I = M->global_begin(), E = M->global_end();
I != E; ++I) {
GlobalVariable *GV = new GlobalVariable(*New,
- I->getType()->getElementType(),
+ I->getValueType(),
I->isConstant(), I->getLinkage(),
(Constant*) nullptr, I->getName(),
(GlobalVariable*) nullptr,
@@ -66,7 +66,7 @@ std::unique_ptr<Module> llvm::CloneModule(
// Loop over the functions in the module, making external functions as before
for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) {
Function *NF =
- Function::Create(cast<FunctionType>(I->getType()->getElementType()),
+ Function::Create(cast<FunctionType>(I->getValueType()),
I->getLinkage(), I->getName(), New.get());
NF->copyAttributesFrom(&*I);
VMap[&*I] = NF;