| Index: src/IceOperand.cpp
|
| diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
|
| index 02e85c76854df1ade16f3f62de2a317209822e19..be63ff6c7054ea933103972702808c0842b86a37 100644
|
| --- a/src/IceOperand.cpp
|
| +++ b/src/IceOperand.cpp
|
| @@ -237,6 +237,70 @@ void ConstantRelocatable::dump(GlobalContext *Ctx) const {
|
| Str << "+" << Offset;
|
| }
|
|
|
| +namespace {
|
| +
|
| +// Read an item of type T and return it. Advance the buffer pointer
|
| +// by the size of T.
|
| +template <typename T> T convertAndAdvance(const char *&Src) {
|
| + T Dest;
|
| + std::memcpy(&Dest, Src, sizeof(T));
|
| + Src += sizeof(T);
|
| + return Dest;
|
| +}
|
| +
|
| +} // end anonymous namespace
|
| +
|
| +template <> void ConstantVector::dump(GlobalContext *Ctx) const {
|
| + Ostream &Str = Ctx->getStrDump();
|
| +
|
| + Type Ty = getType();
|
| + const char *Window = Value.data();
|
| +
|
| + Type ElementType = typeElementType(Ty);
|
| + size_t NumElements = typeNumElements(Ty);
|
| +
|
| + assert(Value.size() == VECT128_BYTES);
|
| + assert(typeElementType(Ty) != IceType_i1);
|
| +
|
| + Str << "<";
|
| + for (unsigned I = 0; I < NumElements; ++I) {
|
| + if (I > 0)
|
| + Str << ", ";
|
| + Str << ElementType << " ";
|
| + switch (ElementType) {
|
| + default:
|
| + llvm_unreachable("Unknown element type");
|
| + break;
|
| + case IceType_i8:
|
| + Str << (unsigned)convertAndAdvance<uint8_t>(Window);
|
| + break;
|
| + case IceType_i16:
|
| + Str << convertAndAdvance<uint16_t>(Window);
|
| + break;
|
| + case IceType_i32:
|
| + Str << convertAndAdvance<uint32_t>(Window);
|
| + break;
|
| + case IceType_f32:
|
| + Str << convertAndAdvance<float>(Window);
|
| + break;
|
| + }
|
| + }
|
| + assert(Window == Value.data() + VECT128_BYTES);
|
| + Str << ">";
|
| +}
|
| +
|
| +template <> void ConstantBitVector::dump(GlobalContext *Ctx) const {
|
| + Ostream &Str = Ctx->getStrDump();
|
| + unsigned NumElements = typeNumElements(getType());
|
| + Str << "<";
|
| + for (unsigned I = 0; I < NumElements; ++I) {
|
| + if (I > 0)
|
| + Str << ", ";
|
| + Str << "i1 " << (Value[I] ? "1" : "0");
|
| + }
|
| + Str << ">";
|
| +}
|
| +
|
| void LiveRange::dump(Ostream &Str) const {
|
| Str << "(weight=" << Weight << ") ";
|
| for (RangeType::const_iterator I = Range.begin(), E = Range.end(); I != E;
|
|
|