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

Unified Diff: src/IceCompileServer.cpp

Issue 1584923002: Subzero: Fix -build-atts option. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 11 months 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
« no previous file with comments | « no previous file | src/IceCompiler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCompileServer.cpp
diff --git a/src/IceCompileServer.cpp b/src/IceCompileServer.cpp
index 2e64f0b3416fd057443ec5368f6b992327e3f34e..011521ff3835df09283611cf0c15f45acaafd772 100644
--- a/src/IceCompileServer.cpp
+++ b/src/IceCompileServer.cpp
@@ -127,6 +127,30 @@ void reportFatalErrorThenExitSuccess(void *UserData, const std::string &Reason,
exit(0);
}
+struct {
+ const char *FlagName;
+ bool FlagValue;
+} ConditionalBuildAttributes[] = {
+ {"dump", BuildDefs::dump()},
+ {"llvm_cl", BuildDefs::llvmCl()},
+ {"llvm_ir", BuildDefs::llvmIr()},
+ {"llvm_ir_as_input", BuildDefs::llvmIrAsInput()},
+ {"minimal_build", BuildDefs::minimal()},
+ {"browser_mode", BuildDefs::browser()}};
+
+/// Dumps values of build attributes to Stream if Stream is non-null.
+void dumpBuildAttributes(Ostream &Str) {
+// List the supported targets.
+#define SUBZERO_TARGET(TARGET) Str << "target_" #TARGET << "\n";
+#include "llvm/Config/SZTargets.def"
+ const char *Prefix[2] = {"no", "allow"};
+ for (size_t i = 0; i < llvm::array_lengthof(ConditionalBuildAttributes);
+ ++i) {
+ const auto &A = ConditionalBuildAttributes[i];
+ Str << Prefix[A.FlagValue] << "_" << A.FlagName << "\n";
+ }
+}
+
} // end of anonymous namespace
void CLCompileServer::run() {
@@ -198,6 +222,11 @@ void CLCompileServer::run() {
return transferErrorCode(getReturnValue(ExtraFlags, Ice::EC_Bitcode));
}
+ if (ExtraFlags.getGenerateBuildAtts()) {
+ dumpBuildAttributes(*Os.get());
+ return transferErrorCode(getReturnValue(ExtraFlags, Ice::EC_None));
+ }
+
Ctx.reset(
new GlobalContext(Ls.get(), Os.get(), Ls.get(), ELFStr.get(), Flags));
if (Ctx->getFlags().getNumTranslationThreads() != 0) {
« no previous file with comments | « no previous file | src/IceCompiler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698