diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2015-11-20 03:36:21 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2015-11-20 03:36:21 +0000 |
commit | a3e2ff19e59c587ea14611eb64400c6d0ecabcee (patch) | |
tree | 787b3e6b23f3170156981b77e973a045b946d26e /clang/lib/Frontend | |
parent | d9625276a78817dc340bf3c18ab490dcb5270140 (diff) | |
download | bcm5719-llvm-a3e2ff19e59c587ea14611eb64400c6d0ecabcee.tar.gz bcm5719-llvm-a3e2ff19e59c587ea14611eb64400c6d0ecabcee.zip |
[libclang] Make sure to use the raw module format for libclang parsing.
Fixes crash when passing '-gmodules' in the compiler options.
rdar://23588717
llvm-svn: 253645
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 6b89447305f..0d5dd536589 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -1934,6 +1934,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine( bool CacheCodeCompletionResults, bool IncludeBriefCommentsInCodeCompletion, bool AllowPCHWithCompilerErrors, bool SkipFunctionBodies, bool UserFilesAreVolatile, bool ForSerialization, + llvm::Optional<StringRef> ModuleFormat, std::unique_ptr<ASTUnit> *ErrAST) { assert(Diags.get() && "no DiagnosticsEngine was provided"); @@ -1967,6 +1968,9 @@ ASTUnit *ASTUnit::LoadFromCommandLine( CI->getFrontendOpts().SkipFunctionBodies = SkipFunctionBodies; + if (ModuleFormat) + CI->getHeaderSearchOpts().ModuleFormat = ModuleFormat.getValue(); + // Create the AST unit. std::unique_ptr<ASTUnit> AST; AST.reset(new ASTUnit(false)); |