diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-07-03 21:34:13 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-07-03 21:34:13 +0000 |
commit | 0a7b297d01812a26d9aea2ec332dc8472928e88b (patch) | |
tree | 76494ae8181ea78992e67c5fee55371437de8124 /clang/lib | |
parent | dcac0a3b5e0032e5b2e11c4001550abfbad042bc (diff) | |
download | bcm5719-llvm-0a7b297d01812a26d9aea2ec332dc8472928e88b.tar.gz bcm5719-llvm-0a7b297d01812a26d9aea2ec332dc8472928e88b.zip |
Factor out Clang's desired 8MB stack size constant from the various
places we hardcode it.
llvm-svn: 336231
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 4 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Frontend/ModelInjector.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index d9900867d88..c4863d6c03d 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -16,6 +16,7 @@ #include "clang/Basic/FileManager.h" #include "clang/Basic/MemoryBufferCache.h" #include "clang/Basic/SourceManager.h" +#include "clang/Basic/Stack.h" #include "clang/Basic/TargetInfo.h" #include "clang/Basic/Version.h" #include "clang/Config/config.h" @@ -1164,14 +1165,13 @@ compileModuleImpl(CompilerInstance &ImportingInstance, SourceLocation ImportLoc, // Execute the action to actually build the module in-place. Use a separate // thread so that we get a stack large enough. - const unsigned ThreadStackSize = 8 << 20; llvm::CrashRecoveryContext CRC; CRC.RunSafelyOnThread( [&]() { GenerateModuleFromModuleMapAction Action; Instance.ExecuteAction(Action); }, - ThreadStackSize); + DesiredStackSize); PostBuildStep(Instance); diff --git a/clang/lib/StaticAnalyzer/Frontend/ModelInjector.cpp b/clang/lib/StaticAnalyzer/Frontend/ModelInjector.cpp index 853aec2ea6c..c43d30440c8 100644 --- a/clang/lib/StaticAnalyzer/Frontend/ModelInjector.cpp +++ b/clang/lib/StaticAnalyzer/Frontend/ModelInjector.cpp @@ -10,6 +10,7 @@ #include "ModelInjector.h" #include "clang/AST/Decl.h" #include "clang/Basic/IdentifierTable.h" +#include "clang/Basic/Stack.h" #include "clang/Frontend/ASTUnit.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Frontend/FrontendAction.h" @@ -95,11 +96,10 @@ void ModelInjector::onBodySynthesis(const NamedDecl *D) { ParseModelFileAction parseModelFile(Bodies); - const unsigned ThreadStackSize = 8 << 20; llvm::CrashRecoveryContext CRC; CRC.RunSafelyOnThread([&]() { Instance.ExecuteAction(parseModelFile); }, - ThreadStackSize); + DesiredStackSize); Instance.getPreprocessor().FinalizeForModelFile(); |