From 4daffc176fddbedf0950cba2efd7f64201ec468d Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Thu, 17 Jan 2019 00:20:43 +0000 Subject: [PATCH] [Frontend] Make WrapperFrontendAction call WrappedAction.PrepareToExecuteAction. Fixes `-emit-header-module` when GenerateHeaderModuleAction is wrapped by another frontend action. rdar://problem/47302588 Reviewers: rsmith, arphaman Reviewed By: arphaman Subscribers: jkorous, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D56766 llvm-svn: 351402 --- clang/include/clang/Frontend/FrontendAction.h | 1 + clang/lib/Frontend/FrontendAction.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/clang/include/clang/Frontend/FrontendAction.h b/clang/include/clang/Frontend/FrontendAction.h index 22314386e060..530849537a37 100644 --- a/clang/include/clang/Frontend/FrontendAction.h +++ b/clang/include/clang/Frontend/FrontendAction.h @@ -305,6 +305,7 @@ class WrapperFrontendAction : public FrontendAction { std::unique_ptr WrappedAction; protected: + bool PrepareToExecuteAction(CompilerInstance &CI) override; std::unique_ptr CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override; bool BeginInvocation(CompilerInstance &CI) override; diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index f5226380b4dd..9ab8001b002a 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -1045,6 +1045,9 @@ PreprocessorFrontendAction::CreateASTConsumer(CompilerInstance &CI, llvm_unreachable("Invalid CreateASTConsumer on preprocessor action!"); } +bool WrapperFrontendAction::PrepareToExecuteAction(CompilerInstance &CI) { + return WrappedAction->PrepareToExecuteAction(CI); +} std::unique_ptr WrapperFrontendAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {