mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
Initial checkin of Module cloning support stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4788 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "llvm/iTerminators.h"
|
||||
#include "llvm/DerivedTypes.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "ValueMapper.h"
|
||||
|
||||
// RemapInstruction - Convert the instruction operands from referencing the
|
||||
// current values into those specified by ValueMap.
|
||||
@@ -18,10 +19,7 @@ static inline void RemapInstruction(Instruction *I,
|
||||
std::map<const Value *, Value*> &ValueMap) {
|
||||
for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) {
|
||||
const Value *Op = I->getOperand(op);
|
||||
Value *V = ValueMap[Op];
|
||||
if (!V && (isa<GlobalValue>(Op) || isa<Constant>(Op)))
|
||||
continue; // Globals and constants don't get relocated
|
||||
|
||||
Value *V = MapValue(Op, ValueMap);
|
||||
#ifndef NDEBUG
|
||||
if (!V) {
|
||||
std::cerr << "Val = \n" << Op << "Addr = " << (void*)Op;
|
||||
|
Reference in New Issue
Block a user