forked from OSchip/llvm-project
The following code would not work before this patch, due to the inability to take the address of a global object:
void func1() { ... } int main(int argc, char** argv) { void (*pFunc)(); pFunc = &func1 pFunc(); ... } Phabricator review: http://reviews.llvm.org/D19368 llvm-svn: 267120
This commit is contained in:
parent
f8997cf5ae
commit
431fc8af7b
|
@ -296,7 +296,7 @@ void Filler::insertCallDefsUses(MachineBasicBlock::iterator MI,
|
|||
RegUses.insert(Reg.getReg());
|
||||
|
||||
const MachineOperand &RegOrImm = MI->getOperand(1);
|
||||
if (RegOrImm.isImm())
|
||||
if (RegOrImm.isImm() || RegOrImm.isGlobal())
|
||||
break;
|
||||
assert(RegOrImm.isReg() && "CALLrr second operand is not a register.");
|
||||
assert(RegOrImm.isUse() && "CALLrr second operand is not a use.");
|
||||
|
|
Loading…
Reference in New Issue