dumper doesn't really do what I want yet, but
at least it doesn't crash now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93272
91177308-0d34-0410-b5e6-
96231b3b80d8
namespace llvm {
class TargetInstrDesc;
namespace llvm {
class TargetInstrDesc;
namespace RegState {
enum {
namespace RegState {
enum {
MI->addOperand(MO);
return *this;
}
MI->addOperand(MO);
return *this;
}
+
+ const MachineInstrBuilder &addMetadata(MDNode *MD) const {
+ MI->addOperand(MachineOperand::CreateMetadata(MD));
+ return *this;
+ }
};
/// BuildMI - Builder interface. Specify how to create the initial instruction
};
/// BuildMI - Builder interface. Specify how to create the initial instruction
return Contents.OffsetedInfo.Val.SymbolName;
}
return Contents.OffsetedInfo.Val.SymbolName;
}
- MDNode *getMetadata() const {
+ const MDNode *getMetadata() const {
assert(isMetadata() && "Wrong MachineOperand accessor");
return Contents.MD;
}
assert(isMetadata() && "Wrong MachineOperand accessor");
return Contents.MD;
}
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/FoldingSet.h"
+#include "llvm/Metadata.h"
using namespace llvm;
//===----------------------------------------------------------------------===//
using namespace llvm;
//===----------------------------------------------------------------------===//
OS << '>';
break;
case MachineOperand::MO_BlockAddress:
OS << '>';
break;
case MachineOperand::MO_BlockAddress:
WriteAsOperand(OS, getBlockAddress(), /*PrintType=*/false);
OS << '>';
break;
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");
}
default:
llvm_unreachable("Unrecognized operand type");
}
if (const Function *Func = dyn_cast<Function>(V))
return new SlotTracker(Func);
if (const Function *Func = dyn_cast<Function>(V))
return new SlotTracker(Func);
+ if (isa<MDNode>(V))
+ return new SlotTracker((Function *)0);
+
+ if (!Machine)
+ Machine = createSlotTracker(V);
Out << '!' << Machine->getMetadataSlot(N);
return;
}
Out << '!' << Machine->getMetadataSlot(N);
return;
}