Separate out the symbol resolver from RSCompilerDriver.
This change makes compilation distinct from loading. The symbol resolvers
now need to be instantiated directly by the RS driver.
Change-Id: I37ce409f1b2e538d9091c025895e639a250d6466
diff --git a/lib/Renderscript/RSCompilerDriver.cpp b/lib/Renderscript/RSCompilerDriver.cpp
index dc04c2a..0f845bd 100644
--- a/lib/Renderscript/RSCompilerDriver.cpp
+++ b/lib/Renderscript/RSCompilerDriver.cpp
@@ -45,25 +45,19 @@
using namespace bcc;
RSCompilerDriver::RSCompilerDriver(bool pUseCompilerRT) :
- mConfig(NULL), mCompiler(), mCompilerRuntime(NULL), mDebugContext(false),
+ mConfig(NULL), mCompiler(), mDebugContext(false),
mLinkRuntimeCallback(NULL), mEnableGlobalMerge(true) {
init::Initialize();
- // Chain the symbol resolvers for compiler_rt and RS runtimes.
- if (pUseCompilerRT) {
- mCompilerRuntime = new CompilerRTSymbolResolver();
- mResolver.chainResolver(*mCompilerRuntime);
- }
- mResolver.chainResolver(mRSRuntime);
}
RSCompilerDriver::~RSCompilerDriver() {
- delete mCompilerRuntime;
delete mConfig;
}
RSExecutable *
RSCompilerDriver::loadScript(const char *pCacheDir, const char *pResName,
- const char *pBitcode, size_t pBitcodeSize) {
+ const char *pBitcode, size_t pBitcodeSize,
+ SymbolResolverProxy &pResolver) {
//android::StopWatch load_time("bcc: RSCompilerDriver::loadScript time");
if ((pCacheDir == NULL) || (pResName == NULL)) {
ALOGE("Missing pCacheDir and/or pResName");
@@ -140,7 +134,7 @@
//===--------------------------------------------------------------------===//
// Create the RSExecutable.
//===--------------------------------------------------------------------===//
- RSExecutable *result = RSExecutable::Create(*info, *object_file, mResolver);
+ RSExecutable *result = RSExecutable::Create(*info, *object_file, pResolver);
if (result == NULL) {
delete object_file;
delete info;