Subzero: Make Ice::Ostream a typedef for llvm::raw_ostream.
Previously Ostream was a class that wrapped a raw_ostream pointer,
structured that way in case we wanted to wrap an alternate stream
type.
Also, Ostream used to include a Cfg pointer, but that had to go away
when the Ostream became associated with the GlobalContext which
persists beyond the Cfg lifetime, so the Cfg pointer was removed
leaving only the raw_ostream.
Since llvm::raw_ostream is supposed to be very lightweight, we can
just give up the abstraction and equate it to Ice::Ostream.
BUG= none
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/413393005
diff --git a/src/IceTypes.cpp b/src/IceTypes.cpp
index 515be2d..0724e51 100644
--- a/src/IceTypes.cpp
+++ b/src/IceTypes.cpp
@@ -81,18 +81,13 @@
return ElementType;
}
-// ======================== Dump routines ======================== //
-
-template <> Ostream &operator<<(Ostream &Str, const Type &Ty) {
+const char *typeString(Type Ty) {
size_t Index = static_cast<size_t>(Ty);
if (Index < TypeAttributesSize) {
- Str << TypeAttributes[Index].DisplayString;
- } else {
- Str << "???";
- llvm_unreachable("Invalid type for printing");
+ return TypeAttributes[Index].DisplayString;
}
-
- return Str;
+ llvm_unreachable("Invalid type for typeString");
+ return "???";
}
} // end of namespace Ice