aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Linker
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-14 18:24:09 +0000
committerChris Lattner <sabre@nondot.org>2002-08-14 18:24:09 +0000
commitad333484ea5ae976b83e35ccd3f6cfa6e71290e2 (patch)
tree31537909533fda5bb35bec362a4a0b26b56a3683 /lib/Linker
parent9b2b80fd48b10396be85a71735ffda0c155e5f72 (diff)
downloadexternal_llvm-ad333484ea5ae976b83e35ccd3f6cfa6e71290e2.zip
external_llvm-ad333484ea5ae976b83e35ccd3f6cfa6e71290e2.tar.gz
external_llvm-ad333484ea5ae976b83e35ccd3f6cfa6e71290e2.tar.bz2
Remove support for Not ConstantExpr. This simplifies the unary case to only
have to support the cast instruction, so the function is renamed to getCast. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3328 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r--lib/Linker/LinkModules.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index 48e40d0..21e25b4 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -119,10 +119,10 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap,
Result = ConstantPointerRef::get(cast<GlobalValue>(V));
} else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CPV)) {
if (CE->getNumOperands() == 1) {
- // Cast instruction, unary operator
+ // Cast instruction
+ assert(CE->getOpcode() == Instruction::Cast);
Value *V = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
- Result = ConstantExpr::get(CE->getOpcode(), cast<Constant>(V),
- CE->getType());
+ Result = ConstantExpr::getCast(cast<Constant>(V), CE->getType());
} else if (CE->getNumOperands() == 2) {
// Binary operator...
Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);