summaryrefslogtreecommitdiff
path: root/cpu_ref/rsCpuScript.cpp
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2015-02-19 10:46:29 -0800
committerPirama Arumuga Nainar <pirama@google.com>2015-02-19 13:01:52 -0800
commit508b1afdff080ccb8546021649559fc5c720aecd (patch)
tree721f88f24f7d128bae387b4e527ac322cf3b421d /cpu_ref/rsCpuScript.cpp
parent5efcbfc764767113bc8ca8546e134a9f01b0d23d (diff)
Move bcc::getCommandLine to fw/rs
libbcc had a utility function to concatenate string arguments. This patch moves that function to frameworks/rs. The function will no longer be needed in libbcc once we move all the checksum/cache invalidation logic to frameworks/rs. Change-Id: I2b1c15c2763d90d7b099e41257bb72f200680943
Diffstat (limited to 'cpu_ref/rsCpuScript.cpp')
-rw-r--r--cpu_ref/rsCpuScript.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/cpu_ref/rsCpuScript.cpp b/cpu_ref/rsCpuScript.cpp
index a618a176..6804d590 100644
--- a/cpu_ref/rsCpuScript.cpp
+++ b/cpu_ref/rsCpuScript.cpp
@@ -25,7 +25,6 @@
#include <bcc/BCCContext.h>
#include <bcc/Config/Config.h>
#include <bcc/Renderscript/RSCompilerDriver.h>
- #include <bcc/Renderscript/RSInfo.h>
#include <bcinfo/MetadataExtractor.h>
#include <cutils/properties.h>
@@ -257,6 +256,17 @@ static bool compileBitcode(const std::string &bcFileName,
}
}
+std::string getCommandLine(int argc, const char* const* argv) {
+ std::string s;
+ for (int i = 0; i < argc; i++) {
+ if (i > 0) {
+ s += ' ';
+ }
+ s += argv[i];
+ }
+ return s;
+}
+
#endif // !defined(RS_COMPATIBILITY_LIB)
} // namespace
@@ -289,7 +299,7 @@ bool SharedLibraryUtils::createSharedLibrary(const char *cacheDir, const char *r
nullptr
};
- std::string cmdLineStr = bcc::getCommandLine(args.size()-1, args.data());
+ std::string cmdLineStr = getCommandLine(args.size()-1, args.data());
pid_t pid = fork();
@@ -837,7 +847,7 @@ bool RsdCpuScriptImpl::init(char const *resName, char const *cacheDir,
useRSDebugContext, bccPluginName);
// The last argument of compileArguments ia a nullptr, so remove 1 from the size.
std::string compileCommandLine =
- bcc::getCommandLine(compileArguments.size() - 1, compileArguments.data());
+ getCommandLine(compileArguments.size() - 1, compileArguments.data());
if (!is_force_recompile() && !useRSDebugContext) {
mScriptSO = SharedLibraryUtils::loadSharedLibrary(cacheDir, resName);