Revert "Merge lib/Transforms into lib/ExecutionEngine."
This reverts commit cd52b55716a2e4d78b0a6609b041c3aeb45b40f2.
diff --git a/lib/ExecutionEngine/Compiler.cpp b/lib/ExecutionEngine/Compiler.cpp
index 458d835..c4a0870 100644
--- a/lib/ExecutionEngine/Compiler.cpp
+++ b/lib/ExecutionEngine/Compiler.cpp
@@ -33,7 +33,7 @@
#include "librsloader.h"
-#include "RSTransforms.h"
+#include "Transforms/BCCTransforms.h"
#include "llvm/ADT/StringRef.h"
@@ -270,7 +270,8 @@
std::vector<std::string> &VarNameList = mpResult->mExportVarsName;
std::vector<std::string> &FuncNameList = mpResult->mExportFuncsName;
std::vector<std::string> &ForEachExpandList = mpResult->mExportForEachName;
- RSInfo::ExportForeachFuncListTy ForEachFuncList;
+ std::vector<std::string> ForEachNameList;
+ std::vector<uint32_t> ForEachSigList;
std::vector<const char*> ExportSymbols;
// Defaults to maximum optimization level from MetadataExtractor.
@@ -366,9 +367,10 @@
const char **ForEachNames = ME.getExportForEachNameList();
const uint32_t *ForEachSigs = ME.getExportForEachSignatureList();
for (size_t i = 0; i < ForEachSigCount; i++) {
- ForEachFuncList.push_back(std::make_pair(ForEachNames[i],
- ForEachSigs[i]));
- ForEachExpandList.push_back(std::string(ForEachNames[i]) + ".expand");
+ std::string Name(ForEachNames[i]);
+ ForEachNameList.push_back(Name);
+ ForEachExpandList.push_back(Name + ".expand");
+ ForEachSigList.push_back(ForEachSigs[i]);
}
// Need to wait until ForEachExpandList is fully populated to fill in
@@ -386,7 +388,7 @@
}
}
- runInternalPasses(ForEachFuncList);
+ runInternalPasses(ForEachNameList, ForEachSigList);
// Perform link-time optimization if we have multiple modules
if (option.RunLTO) {
@@ -514,11 +516,12 @@
return 0;
}
-int Compiler::runInternalPasses(RSInfo::ExportForeachFuncListTy pForEachFuncs) {
+int Compiler::runInternalPasses(std::vector<std::string>& Names,
+ std::vector<uint32_t>& Signatures) {
llvm::PassManager BCCPasses;
// Expand ForEach on CPU path to reduce launch overhead.
- BCCPasses.add(createRSForEachExpandPass(pForEachFuncs));
+ BCCPasses.add(createForEachExpandPass(Names, Signatures));
BCCPasses.run(*mModule);