Add -disable-sil-linking to sil-function-extractor and enable it by default.

Requested by @gottesmm
This commit is contained in:
Roman Levenstein
2017-03-24 13:05:44 -07:00
parent c01a9537e7
commit 40f2fc7eaa
2 changed files with 7 additions and 2 deletions

View File

@@ -116,6 +116,11 @@ static llvm::cl::opt<bool> AssumeUnqualifiedOwnershipWhenParsing(
llvm::cl::init(false),
llvm::cl::desc("Assume all parsed functions have unqualified ownership"));
static llvm::cl::opt<bool>
DisableSILLinking("disable-sil-linking",
llvm::cl::init(true),
llvm::cl::desc("Disable SIL linking"));
// This function isn't referenced outside its translation unit, but it
// can't use the "static" keyword because its address is used for
// getMainExecutable (since some platforms don't support taking the
@@ -303,7 +308,7 @@ int main(int argc, char **argv) {
std::unique_ptr<SerializedSILLoader> SL = SerializedSILLoader::create(
CI.getASTContext(), CI.getSILModule(), nullptr);
if (extendedInfo.isSIB())
if (extendedInfo.isSIB() || DisableSILLinking)
SL->getAllForModule(CI.getMainModule()->getName(), nullptr);
else
SL->getAll();