summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-10-30 01:27:03 +0000
committerDan Gohman <gohman@apple.com>2009-10-30 01:27:03 +0000
commit6c9388011b8a4b6985e0d17dbfe12ffd4aa405fa (patch)
treeee4402944c4ed14c2b873133d97b40cc0299b2f1 /llvm/lib/CodeGen/MachineInstr.cpp
parent430046321bc6272a808f3e158f11dcabd268c653 (diff)
downloadbcm5719-llvm-6c9388011b8a4b6985e0d17dbfe12ffd4aa405fa.tar.gz
bcm5719-llvm-6c9388011b8a4b6985e0d17dbfe12ffd4aa405fa.zip
Initial target-independent CodeGen support for BlockAddresses.
llvm-svn: 85556
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 1f85e922590..c27ecff72d2 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -13,6 +13,7 @@
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/Constants.h"
+#include "llvm/Function.h"
#include "llvm/InlineAsm.h"
#include "llvm/Value.h"
#include "llvm/Assembly/Writer.h"
@@ -180,6 +181,8 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const {
case MachineOperand::MO_ExternalSymbol:
return !strcmp(getSymbolName(), Other.getSymbolName()) &&
getOffset() == Other.getOffset();
+ case MachineOperand::MO_BlockAddress:
+ return getBlockAddress() == Other.getBlockAddress();
}
}
@@ -273,6 +276,13 @@ void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const {
if (getOffset()) OS << "+" << getOffset();
OS << '>';
break;
+ case MachineOperand::MO_BlockAddress:
+ OS << "<blockaddress: ";
+ WriteAsOperand(OS, getBlockAddress()->getFunction(), /*PrintType=*/false);
+ OS << ", ";
+ WriteAsOperand(OS, getBlockAddress()->getBasicBlock(), /*PrintType=*/false);
+ OS << '>';
+ break;
default:
llvm_unreachable("Unrecognized operand type");
}
OpenPOWER on IntegriCloud