diff options
author | Dale Johannesen <dalej@apple.com> | 2010-01-13 00:00:24 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2010-01-13 00:00:24 +0000 |
commit | 7b1a7ed330212335bbaeca43a41dd7c2b19c4e1d (patch) | |
tree | 24b8844dd3b835e479e26dbc80e066e51718cf09 /llvm/lib | |
parent | 6fada5be91e2d684f9ac45e571745adf72bbd51e (diff) | |
download | bcm5719-llvm-7b1a7ed330212335bbaeca43a41dd7c2b19c4e1d.tar.gz bcm5719-llvm-7b1a7ed330212335bbaeca43a41dd7c2b19c4e1d.zip |
Further progration of metadata operands. The
dumper doesn't really do what I want yet, but
at least it doesn't crash now.
llvm-svn: 93272
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/VMCore/AsmWriter.cpp | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index f9c20e64730..cf3e3e16014 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -34,6 +34,7 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/ADT/FoldingSet.h" +#include "llvm/Metadata.h" using namespace llvm; //===----------------------------------------------------------------------===// @@ -278,10 +279,15 @@ void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const { OS << '>'; break; case MachineOperand::MO_BlockAddress: - OS << "<"; + OS << '<'; WriteAsOperand(OS, getBlockAddress(), /*PrintType=*/false); OS << '>'; break; + case MachineOperand::MO_Metadata: + OS << '<'; + WriteAsOperand(OS, getMetadata(), /*PrintType=*/false); + OS << '>'; + break; default: llvm_unreachable("Unrecognized operand type"); } diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index 7cb5a7c7598..92dbd93d353 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -564,6 +564,9 @@ static SlotTracker *createSlotTracker(const Value *V) { if (const Function *Func = dyn_cast<Function>(V)) return new SlotTracker(Func); + if (isa<MDNode>(V)) + return new SlotTracker((Function *)0); + return 0; } @@ -1136,6 +1139,8 @@ static void WriteAsOperandInternal(raw_ostream &Out, const Value *V, return; } + if (!Machine) + Machine = createSlotTracker(V); Out << '!' << Machine->getMetadataSlot(N); return; } |