Convert Subzero's bitcode reader to generate ICE types.
Changes Subzero's bitcode reader to build and store ICE types,
instead of using LLVM's types. Note: This code doesn't remove
all uses of LLVM types. They are still used to check types for
instructions and to generate function addresses.
BUG=None
R=jvoung@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/625243002
diff --git a/src/IceTypes.cpp b/src/IceTypes.cpp
index 11ac5b7..6b81d8a 100644
--- a/src/IceTypes.cpp
+++ b/src/IceTypes.cpp
@@ -230,7 +230,7 @@
SizeT getScalarIntBitWidth(Type Ty) {
assert(isScalarIntegerType(Ty));
- if (Ty == Ice::IceType_i1)
+ if (Ty == IceType_i1)
return 1;
return typeWidthInBytes(Ty) * CHAR_BIT;
}
@@ -245,4 +245,18 @@
return "???";
}
+void FuncSigType::dump(Ostream &Stream) const {
+ Stream << ReturnType << " (";
+ bool IsFirst = true;
+ for (const Type ArgTy : ArgList) {
+ if (IsFirst) {
+ IsFirst = false;
+ } else {
+ Stream << ", ";
+ }
+ Stream << ArgTy;
+ }
+ Stream << ")";
+}
+
} // end of namespace Ice