Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(745)

Unified Diff: src/PNaClTranslator.cpp

Issue 686913005: Turn off dump/emit routines when building minimal subzero. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/PNaClTranslator.cpp
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index 07fd5afa119bae193c897d42465003b59052fc94..0f4feacafe5d2768bd8edae99a2ab2f6c5a65087 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -87,11 +87,15 @@ private:
};
Ice::Ostream &operator<<(Ice::Ostream &Stream, const ExtendedType &Ty) {
+ if (!ALLOW_DUMP)
+ return Stream;
Ty.dump(Stream);
return Stream;
}
Ice::Ostream &operator<<(Ice::Ostream &Stream, ExtendedType::TypeKind Kind) {
+ if (!ALLOW_DUMP)
+ return Stream;
Stream << "ExtendedType::";
switch (Kind) {
case ExtendedType::Undefined:
@@ -138,6 +142,8 @@ public:
};
void ExtendedType::dump(Ice::Ostream &Stream) const {
+ if (!ALLOW_DUMP)
+ return;
Stream << Kind;
switch (Kind) {
case Simple: {
@@ -545,7 +551,13 @@ protected:
std::string Buffer;
raw_string_ostream StrBuf(Buffer);
StrBuf << "(" << format("%" PRIu64 ":%u", (Bit / 8),
- static_cast<unsigned>(Bit % 8)) << ") " << Message;
+ static_cast<unsigned>(Bit % 8)) << ") ";
+ // Note: If dump routines have been turned off, the error messages
+ // will not be readable. Hence, replace with simple error.
+ if (ALLOW_DUMP)
+ StrBuf << Message;
+ else
+ StrBuf << "Invalid input record";
return Context->Error(StrBuf.str());
}
@@ -1394,6 +1406,8 @@ private:
void dumpVectorIndexCheckValue(raw_ostream &Stream,
VectorIndexCheckValue Value) const {
+ if (!ALLOW_DUMP)
+ return;
switch (Value) {
default:
report_fatal_error("Unknown VectorIndexCheckValue");
« no previous file with comments | « src/IceTypes.cpp ('k') | src/llvm2ice.cpp » ('j') | tests_lit/reader_tests/alloca.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698