summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Linker.cpp
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
commit330b7ac76ca31e49da0ee6a1a3349a6ff86e150b (patch)
tree51d69482f788499c3448374bc4f60ddef53a7394 /llvm/lib/Transforms/Utils/Linker.cpp
parentb80b69cc3e6d865b4f4900bae758c3d6aeff7383 (diff)
downloadbcm5719-llvm-330b7ac76ca31e49da0ee6a1a3349a6ff86e150b.tar.gz
bcm5719-llvm-330b7ac76ca31e49da0ee6a1a3349a6ff86e150b.zip
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. llvm-svn: 3328
Diffstat (limited to 'llvm/lib/Transforms/Utils/Linker.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Linker.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp
index 48e40d0b3d9..21e25b444a1 100644
--- a/llvm/lib/Transforms/Utils/Linker.cpp
+++ b/llvm/lib/Transforms/Utils/Linker.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);
OpenPOWER on IntegriCloud