diff options
author | Jean-Luc Brouillet <jeanluc@google.com> | 2017-02-17 13:29:47 -0800 |
---|---|---|
committer | Jean-Luc Brouillet <jeanluc@google.com> | 2017-02-20 12:28:24 -0800 |
commit | 0a2acce3493df1609be2730e3058fe27af01b88f (patch) | |
tree | 19a173b45fabe35a5dcf2b1299d211ae948c5b7f /tools | |
parent | a9dd44f7e6c67a62fa9c0a91ef6248a8ce8111a1 (diff) | |
download | libbcc-0a2acce3493df1609be2730e3058fe27af01b88f.tar.gz |
Merge RSScript.cpp and Script.cpp
We don't need two classes.
Bug: 34265954
Test: Compiled. Ran imageprocessing_jb and a compat lab test.
Test: Compared that the APK have not changed in size.
Change-Id: Ib91e16d80bd5ba33c5946ff6f5b11a579338eb1c
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bcc/Main.cpp | 3 | ||||
-rw-r--r-- | tools/bcc_compat/Main.cpp | 10 |
2 files changed, 7 insertions, 6 deletions
diff --git a/tools/bcc/Main.cpp b/tools/bcc/Main.cpp index 3cc2ae6..3887bd9 100644 --- a/tools/bcc/Main.cpp +++ b/tools/bcc/Main.cpp @@ -345,7 +345,7 @@ int main(int argc, char **argv) { return EXIT_FAILURE; } - std::unique_ptr<RSScript> s(new (std::nothrow) RSScript(*source, RSCD.getConfig())); + std::unique_ptr<Script> s(new (std::nothrow) Script(source)); if (s == nullptr) { llvm::errs() << "Out of memory when creating script for file `" << OptInputFilenames[0] << "'!\n"; @@ -353,6 +353,7 @@ int main(int argc, char **argv) { return EXIT_FAILURE; } + s->setOptimizationLevel(RSCD.getConfig()->getOptimizationLevel()); llvm::SmallString<80> output(OptOutputPath); llvm::sys::path::append(output, "/", OptOutputFilename); llvm::sys::path::replace_extension(output, ".o"); diff --git a/tools/bcc_compat/Main.cpp b/tools/bcc_compat/Main.cpp index da4ed38..bc42a44 100644 --- a/tools/bcc_compat/Main.cpp +++ b/tools/bcc_compat/Main.cpp @@ -109,9 +109,9 @@ void BCCVersionPrinter() { } // end anonymous namespace -RSScript *PrepareRSScript(BCCContext &pContext, - const llvm::cl::list<std::string> &pBitcodeFiles) { - RSScript *result = nullptr; +Script *PrepareScript(BCCContext &pContext, + const llvm::cl::list<std::string> &pBitcodeFiles) { + Script *result = nullptr; for (unsigned i = 0; i < pBitcodeFiles.size(); i++) { const std::string &input_bitcode = pBitcodeFiles[i]; @@ -130,7 +130,7 @@ RSScript *PrepareRSScript(BCCContext &pContext, return nullptr; } } else { - result = new (std::nothrow) RSScript(*source); + result = new (std::nothrow) Script(source); if (result == nullptr) { llvm::errs() << "Out of memory when create script for file `" << input_bitcode << "'!\n"; @@ -270,7 +270,7 @@ int main(int argc, char **argv) { return EXIT_FAILURE; } - std::unique_ptr<RSScript> s(PrepareRSScript(context, OptInputFilenames)); + std::unique_ptr<Script> s(PrepareScript(context, OptInputFilenames)); if (!rscd.buildForCompatLib(*s, OutputFilename.c_str(), nullptr, OptRuntimePath.c_str(), false)) { fprintf(stderr, "Failed to compile script!"); return EXIT_FAILURE; |