aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
authorNishith Kumar M Shah <nishithshah2211@users.noreply.github.com>2024-06-03 08:20:43 -0700
committerGitHub <noreply@github.com>2024-06-03 17:20:43 +0200
commit9862080b1cbf685c0d462b29596e3f7206d24aa2 (patch)
tree34da158b3630f05d7dbb2e65180fdce39d86c0d3 /clang/lib/Frontend/FrontendActions.cpp
parentd1aa9bac3c8ecc30fcc5d4d80a1f70c729aec909 (diff)
downloadllvm-9862080b1cbf685c0d462b29596e3f7206d24aa2.zip
llvm-9862080b1cbf685c0d462b29596e3f7206d24aa2.tar.gz
llvm-9862080b1cbf685c0d462b29596e3f7206d24aa2.tar.bz2
Pass LangOpts from CompilerInstance to DependencyScanningWorker (#93753)
This commit fixes https://github.com/llvm/llvm-project/issues/88896 by passing LangOpts from the CompilerInstance to DependencyScanningWorker so that the original LangOpts are preserved/respected. This makes for more accurate parsing/lexing when certain language versions or features specific to versions are to be used.
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index 4f06432..1812b85 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -1169,8 +1169,8 @@ void PrintDependencyDirectivesSourceMinimizerAction::ExecuteAction() {
llvm::SmallVector<dependency_directives_scan::Token, 16> Tokens;
llvm::SmallVector<dependency_directives_scan::Directive, 32> Directives;
if (scanSourceForDependencyDirectives(
- FromFile.getBuffer(), Tokens, Directives, &CI.getDiagnostics(),
- SM.getLocForStartOfFile(SM.getMainFileID()))) {
+ FromFile.getBuffer(), Tokens, Directives, CI.getLangOpts(),
+ &CI.getDiagnostics(), SM.getLocForStartOfFile(SM.getMainFileID()))) {
assert(CI.getDiagnostics().hasErrorOccurred() &&
"no errors reported for failure");