FrontendAction.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. //===--- FrontendAction.cpp -----------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #include "clang/Frontend/FrontendAction.h"
  10. #include "clang/AST/ASTConsumer.h"
  11. #include "clang/AST/ASTContext.h"
  12. #include "clang/AST/DeclGroup.h"
  13. #include "clang/Frontend/ASTUnit.h"
  14. #include "clang/Frontend/ChainedIncludesSource.h"
  15. #include "clang/Frontend/CompilerInstance.h"
  16. #include "clang/Frontend/FrontendDiagnostic.h"
  17. #include "clang/Frontend/FrontendPluginRegistry.h"
  18. #include "clang/Frontend/LayoutOverrideSource.h"
  19. #include "clang/Frontend/MultiplexConsumer.h"
  20. #include "clang/Frontend/Utils.h"
  21. #include "clang/Lex/HeaderSearch.h"
  22. #include "clang/Lex/Preprocessor.h"
  23. #include "clang/Parse/ParseAST.h"
  24. #include "clang/Serialization/ASTDeserializationListener.h"
  25. #include "clang/Serialization/ASTReader.h"
  26. #include "clang/Serialization/GlobalModuleIndex.h"
  27. #include "llvm/Support/ErrorHandling.h"
  28. #include "llvm/Support/FileSystem.h"
  29. #include "llvm/Support/MemoryBuffer.h"
  30. #include "llvm/Support/Timer.h"
  31. #include "llvm/Support/raw_ostream.h"
  32. #include "llvm/Support/system_error.h"
  33. using namespace clang;
  34. namespace {
  35. class DelegatingDeserializationListener : public ASTDeserializationListener {
  36. ASTDeserializationListener *Previous;
  37. bool DeletePrevious;
  38. public:
  39. explicit DelegatingDeserializationListener(
  40. ASTDeserializationListener *Previous, bool DeletePrevious)
  41. : Previous(Previous), DeletePrevious(DeletePrevious) {}
  42. virtual ~DelegatingDeserializationListener() {
  43. if (DeletePrevious)
  44. delete Previous;
  45. }
  46. void ReaderInitialized(ASTReader *Reader) override {
  47. if (Previous)
  48. Previous->ReaderInitialized(Reader);
  49. }
  50. void IdentifierRead(serialization::IdentID ID,
  51. IdentifierInfo *II) override {
  52. if (Previous)
  53. Previous->IdentifierRead(ID, II);
  54. }
  55. void TypeRead(serialization::TypeIdx Idx, QualType T) override {
  56. if (Previous)
  57. Previous->TypeRead(Idx, T);
  58. }
  59. void DeclRead(serialization::DeclID ID, const Decl *D) override {
  60. if (Previous)
  61. Previous->DeclRead(ID, D);
  62. }
  63. void SelectorRead(serialization::SelectorID ID, Selector Sel) override {
  64. if (Previous)
  65. Previous->SelectorRead(ID, Sel);
  66. }
  67. void MacroDefinitionRead(serialization::PreprocessedEntityID PPID,
  68. MacroDefinition *MD) override {
  69. if (Previous)
  70. Previous->MacroDefinitionRead(PPID, MD);
  71. }
  72. };
  73. /// \brief Dumps deserialized declarations.
  74. class DeserializedDeclsDumper : public DelegatingDeserializationListener {
  75. public:
  76. explicit DeserializedDeclsDumper(ASTDeserializationListener *Previous,
  77. bool DeletePrevious)
  78. : DelegatingDeserializationListener(Previous, DeletePrevious) {}
  79. void DeclRead(serialization::DeclID ID, const Decl *D) override {
  80. llvm::outs() << "PCH DECL: " << D->getDeclKindName();
  81. if (const NamedDecl *ND = dyn_cast<NamedDecl>(D))
  82. llvm::outs() << " - " << *ND;
  83. llvm::outs() << "\n";
  84. DelegatingDeserializationListener::DeclRead(ID, D);
  85. }
  86. };
  87. /// \brief Checks deserialized declarations and emits error if a name
  88. /// matches one given in command-line using -error-on-deserialized-decl.
  89. class DeserializedDeclsChecker : public DelegatingDeserializationListener {
  90. ASTContext &Ctx;
  91. std::set<std::string> NamesToCheck;
  92. public:
  93. DeserializedDeclsChecker(ASTContext &Ctx,
  94. const std::set<std::string> &NamesToCheck,
  95. ASTDeserializationListener *Previous,
  96. bool DeletePrevious)
  97. : DelegatingDeserializationListener(Previous, DeletePrevious), Ctx(Ctx),
  98. NamesToCheck(NamesToCheck) {}
  99. void DeclRead(serialization::DeclID ID, const Decl *D) override {
  100. if (const NamedDecl *ND = dyn_cast<NamedDecl>(D))
  101. if (NamesToCheck.find(ND->getNameAsString()) != NamesToCheck.end()) {
  102. unsigned DiagID
  103. = Ctx.getDiagnostics().getCustomDiagID(DiagnosticsEngine::Error,
  104. "%0 was deserialized");
  105. Ctx.getDiagnostics().Report(Ctx.getFullLoc(D->getLocation()), DiagID)
  106. << ND->getNameAsString();
  107. }
  108. DelegatingDeserializationListener::DeclRead(ID, D);
  109. }
  110. };
  111. } // end anonymous namespace
  112. FrontendAction::FrontendAction() : Instance(nullptr) {}
  113. FrontendAction::~FrontendAction() {}
  114. void FrontendAction::setCurrentInput(const FrontendInputFile &CurrentInput,
  115. ASTUnit *AST) {
  116. this->CurrentInput = CurrentInput;
  117. CurrentASTUnit.reset(AST);
  118. }
  119. ASTConsumer* FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI,
  120. StringRef InFile) {
  121. ASTConsumer* Consumer = CreateASTConsumer(CI, InFile);
  122. if (!Consumer)
  123. return nullptr;
  124. if (CI.getFrontendOpts().AddPluginActions.size() == 0)
  125. return Consumer;
  126. // Make sure the non-plugin consumer is first, so that plugins can't
  127. // modifiy the AST.
  128. std::vector<ASTConsumer*> Consumers(1, Consumer);
  129. for (size_t i = 0, e = CI.getFrontendOpts().AddPluginActions.size();
  130. i != e; ++i) {
  131. // This is O(|plugins| * |add_plugins|), but since both numbers are
  132. // way below 50 in practice, that's ok.
  133. for (FrontendPluginRegistry::iterator
  134. it = FrontendPluginRegistry::begin(),
  135. ie = FrontendPluginRegistry::end();
  136. it != ie; ++it) {
  137. if (it->getName() == CI.getFrontendOpts().AddPluginActions[i]) {
  138. std::unique_ptr<PluginASTAction> P(it->instantiate());
  139. FrontendAction* c = P.get();
  140. if (P->ParseArgs(CI, CI.getFrontendOpts().AddPluginArgs[i]))
  141. Consumers.push_back(c->CreateASTConsumer(CI, InFile));
  142. }
  143. }
  144. }
  145. return new MultiplexConsumer(Consumers);
  146. }
  147. bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
  148. const FrontendInputFile &Input) {
  149. assert(!Instance && "Already processing a source file!");
  150. assert(!Input.isEmpty() && "Unexpected empty filename!");
  151. setCurrentInput(Input);
  152. setCompilerInstance(&CI);
  153. StringRef InputFile = Input.getFile();
  154. bool HasBegunSourceFile = false;
  155. if (!BeginInvocation(CI))
  156. goto failure;
  157. // AST files follow a very different path, since they share objects via the
  158. // AST unit.
  159. if (Input.getKind() == IK_AST) {
  160. assert(!usesPreprocessorOnly() &&
  161. "Attempt to pass AST file to preprocessor only action!");
  162. assert(hasASTFileSupport() &&
  163. "This action does not have AST file support!");
  164. IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics());
  165. ASTUnit *AST = ASTUnit::LoadFromASTFile(InputFile, Diags,
  166. CI.getFileSystemOpts());
  167. if (!AST)
  168. goto failure;
  169. setCurrentInput(Input, AST);
  170. // Inform the diagnostic client we are processing a source file.
  171. CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), nullptr);
  172. HasBegunSourceFile = true;
  173. // Set the shared objects, these are reset when we finish processing the
  174. // file, otherwise the CompilerInstance will happily destroy them.
  175. CI.setFileManager(&AST->getFileManager());
  176. CI.setSourceManager(&AST->getSourceManager());
  177. CI.setPreprocessor(&AST->getPreprocessor());
  178. CI.setASTContext(&AST->getASTContext());
  179. // Initialize the action.
  180. if (!BeginSourceFileAction(CI, InputFile))
  181. goto failure;
  182. // Create the AST consumer.
  183. CI.setASTConsumer(CreateWrappedASTConsumer(CI, InputFile));
  184. if (!CI.hasASTConsumer())
  185. goto failure;
  186. return true;
  187. }
  188. if (!CI.hasVirtualFileSystem()) {
  189. if (IntrusiveRefCntPtr<vfs::FileSystem> VFS =
  190. createVFSFromCompilerInvocation(CI.getInvocation(),
  191. CI.getDiagnostics()))
  192. CI.setVirtualFileSystem(VFS);
  193. else
  194. goto failure;
  195. }
  196. // Set up the file and source managers, if needed.
  197. if (!CI.hasFileManager())
  198. CI.createFileManager();
  199. if (!CI.hasSourceManager())
  200. CI.createSourceManager(CI.getFileManager());
  201. // IR files bypass the rest of initialization.
  202. if (Input.getKind() == IK_LLVM_IR) {
  203. assert(hasIRSupport() &&
  204. "This action does not have IR file support!");
  205. // Inform the diagnostic client we are processing a source file.
  206. CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), nullptr);
  207. HasBegunSourceFile = true;
  208. // Initialize the action.
  209. if (!BeginSourceFileAction(CI, InputFile))
  210. goto failure;
  211. // Initialize the main file entry.
  212. if (!CI.InitializeSourceManager(CurrentInput))
  213. goto failure;
  214. return true;
  215. }
  216. // If the implicit PCH include is actually a directory, rather than
  217. // a single file, search for a suitable PCH file in that directory.
  218. if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) {
  219. FileManager &FileMgr = CI.getFileManager();
  220. PreprocessorOptions &PPOpts = CI.getPreprocessorOpts();
  221. StringRef PCHInclude = PPOpts.ImplicitPCHInclude;
  222. if (const DirectoryEntry *PCHDir = FileMgr.getDirectory(PCHInclude)) {
  223. llvm::error_code EC;
  224. SmallString<128> DirNative;
  225. llvm::sys::path::native(PCHDir->getName(), DirNative);
  226. bool Found = false;
  227. for (llvm::sys::fs::directory_iterator Dir(DirNative.str(), EC), DirEnd;
  228. Dir != DirEnd && !EC; Dir.increment(EC)) {
  229. // Check whether this is an acceptable AST file.
  230. if (ASTReader::isAcceptableASTFile(Dir->path(), FileMgr,
  231. CI.getLangOpts(),
  232. CI.getTargetOpts(),
  233. CI.getPreprocessorOpts())) {
  234. PPOpts.ImplicitPCHInclude = Dir->path();
  235. Found = true;
  236. break;
  237. }
  238. }
  239. if (!Found) {
  240. CI.getDiagnostics().Report(diag::err_fe_no_pch_in_dir) << PCHInclude;
  241. return true;
  242. }
  243. }
  244. }
  245. // Set up the preprocessor.
  246. CI.createPreprocessor(getTranslationUnitKind());
  247. // Inform the diagnostic client we are processing a source file.
  248. CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(),
  249. &CI.getPreprocessor());
  250. HasBegunSourceFile = true;
  251. // Initialize the action.
  252. if (!BeginSourceFileAction(CI, InputFile))
  253. goto failure;
  254. // Initialize the main file entry. It is important that this occurs after
  255. // BeginSourceFileAction, which may change CurrentInput during module builds.
  256. if (!CI.InitializeSourceManager(CurrentInput))
  257. goto failure;
  258. // Create the AST context and consumer unless this is a preprocessor only
  259. // action.
  260. if (!usesPreprocessorOnly()) {
  261. CI.createASTContext();
  262. std::unique_ptr<ASTConsumer> Consumer(
  263. CreateWrappedASTConsumer(CI, InputFile));
  264. if (!Consumer)
  265. goto failure;
  266. CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener());
  267. if (!CI.getPreprocessorOpts().ChainedIncludes.empty()) {
  268. // Convert headers to PCH and chain them.
  269. IntrusiveRefCntPtr<ChainedIncludesSource> source;
  270. source = ChainedIncludesSource::create(CI);
  271. if (!source)
  272. goto failure;
  273. CI.setModuleManager(static_cast<ASTReader*>(&source->getFinalReader()));
  274. CI.getASTContext().setExternalSource(source);
  275. } else if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) {
  276. // Use PCH.
  277. assert(hasPCHSupport() && "This action does not have PCH support!");
  278. ASTDeserializationListener *DeserialListener =
  279. Consumer->GetASTDeserializationListener();
  280. bool DeleteDeserialListener = false;
  281. if (CI.getPreprocessorOpts().DumpDeserializedPCHDecls) {
  282. DeserialListener = new DeserializedDeclsDumper(DeserialListener,
  283. DeleteDeserialListener);
  284. DeleteDeserialListener = true;
  285. }
  286. if (!CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn.empty()) {
  287. DeserialListener = new DeserializedDeclsChecker(
  288. CI.getASTContext(),
  289. CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn,
  290. DeserialListener, DeleteDeserialListener);
  291. DeleteDeserialListener = true;
  292. }
  293. CI.createPCHExternalASTSource(
  294. CI.getPreprocessorOpts().ImplicitPCHInclude,
  295. CI.getPreprocessorOpts().DisablePCHValidation,
  296. CI.getPreprocessorOpts().AllowPCHWithCompilerErrors, DeserialListener,
  297. DeleteDeserialListener);
  298. if (!CI.getASTContext().getExternalSource())
  299. goto failure;
  300. }
  301. CI.setASTConsumer(Consumer.release());
  302. if (!CI.hasASTConsumer())
  303. goto failure;
  304. }
  305. // Initialize built-in info as long as we aren't using an external AST
  306. // source.
  307. if (!CI.hasASTContext() || !CI.getASTContext().getExternalSource()) {
  308. Preprocessor &PP = CI.getPreprocessor();
  309. // If modules are enabled, create the module manager before creating
  310. // any builtins, so that all declarations know that they might be
  311. // extended by an external source.
  312. if (CI.getLangOpts().Modules)
  313. CI.createModuleManager();
  314. PP.getBuiltinInfo().InitializeBuiltins(PP.getIdentifierTable(),
  315. PP.getLangOpts());
  316. } else {
  317. // FIXME: If this is a problem, recover from it by creating a multiplex
  318. // source.
  319. assert((!CI.getLangOpts().Modules || CI.getModuleManager()) &&
  320. "modules enabled but created an external source that "
  321. "doesn't support modules");
  322. }
  323. // If there is a layout overrides file, attach an external AST source that
  324. // provides the layouts from that file.
  325. if (!CI.getFrontendOpts().OverrideRecordLayoutsFile.empty() &&
  326. CI.hasASTContext() && !CI.getASTContext().getExternalSource()) {
  327. IntrusiveRefCntPtr<ExternalASTSource>
  328. Override(new LayoutOverrideSource(
  329. CI.getFrontendOpts().OverrideRecordLayoutsFile));
  330. CI.getASTContext().setExternalSource(Override);
  331. }
  332. return true;
  333. // If we failed, reset state since the client will not end up calling the
  334. // matching EndSourceFile().
  335. failure:
  336. if (isCurrentFileAST()) {
  337. CI.setASTContext(nullptr);
  338. CI.setPreprocessor(nullptr);
  339. CI.setSourceManager(nullptr);
  340. CI.setFileManager(nullptr);
  341. }
  342. if (HasBegunSourceFile)
  343. CI.getDiagnosticClient().EndSourceFile();
  344. CI.clearOutputFiles(/*EraseFiles=*/true);
  345. setCurrentInput(FrontendInputFile());
  346. setCompilerInstance(nullptr);
  347. return false;
  348. }
  349. bool FrontendAction::Execute() {
  350. CompilerInstance &CI = getCompilerInstance();
  351. if (CI.hasFrontendTimer()) {
  352. llvm::TimeRegion Timer(CI.getFrontendTimer());
  353. ExecuteAction();
  354. }
  355. else ExecuteAction();
  356. // If we are supposed to rebuild the global module index, do so now unless
  357. // there were any module-build failures.
  358. if (CI.shouldBuildGlobalModuleIndex() && CI.hasFileManager() &&
  359. CI.hasPreprocessor()) {
  360. GlobalModuleIndex::writeIndex(
  361. CI.getFileManager(),
  362. CI.getPreprocessor().getHeaderSearchInfo().getModuleCachePath());
  363. }
  364. return true;
  365. }
  366. void FrontendAction::EndSourceFile() {
  367. CompilerInstance &CI = getCompilerInstance();
  368. // Inform the diagnostic client we are done with this source file.
  369. CI.getDiagnosticClient().EndSourceFile();
  370. // Finalize the action.
  371. EndSourceFileAction();
  372. // Sema references the ast consumer, so reset sema first.
  373. //
  374. // FIXME: There is more per-file stuff we could just drop here?
  375. bool DisableFree = CI.getFrontendOpts().DisableFree;
  376. if (DisableFree) {
  377. if (!isCurrentFileAST()) {
  378. CI.resetAndLeakSema();
  379. CI.resetAndLeakASTContext();
  380. }
  381. BuryPointer(CI.takeASTConsumer());
  382. } else {
  383. if (!isCurrentFileAST()) {
  384. CI.setSema(nullptr);
  385. CI.setASTContext(nullptr);
  386. }
  387. CI.setASTConsumer(nullptr);
  388. }
  389. // Inform the preprocessor we are done.
  390. if (CI.hasPreprocessor())
  391. CI.getPreprocessor().EndSourceFile();
  392. if (CI.getFrontendOpts().ShowStats) {
  393. llvm::errs() << "\nSTATISTICS FOR '" << getCurrentFile() << "':\n";
  394. CI.getPreprocessor().PrintStats();
  395. CI.getPreprocessor().getIdentifierTable().PrintStats();
  396. CI.getPreprocessor().getHeaderSearchInfo().PrintStats();
  397. CI.getSourceManager().PrintStats();
  398. llvm::errs() << "\n";
  399. }
  400. // Cleanup the output streams, and erase the output files if instructed by the
  401. // FrontendAction.
  402. CI.clearOutputFiles(/*EraseFiles=*/shouldEraseOutputFiles());
  403. // FIXME: Only do this if DisableFree is set.
  404. if (isCurrentFileAST()) {
  405. CI.resetAndLeakSema();
  406. CI.resetAndLeakASTContext();
  407. CI.resetAndLeakPreprocessor();
  408. CI.resetAndLeakSourceManager();
  409. CI.resetAndLeakFileManager();
  410. }
  411. setCompilerInstance(nullptr);
  412. setCurrentInput(FrontendInputFile());
  413. }
  414. bool FrontendAction::shouldEraseOutputFiles() {
  415. return getCompilerInstance().getDiagnostics().hasErrorOccurred();
  416. }
  417. //===----------------------------------------------------------------------===//
  418. // Utility Actions
  419. //===----------------------------------------------------------------------===//
  420. void ASTFrontendAction::ExecuteAction() {
  421. CompilerInstance &CI = getCompilerInstance();
  422. if (!CI.hasPreprocessor())
  423. return;
  424. // FIXME: Move the truncation aspect of this into Sema, we delayed this till
  425. // here so the source manager would be initialized.
  426. if (hasCodeCompletionSupport() &&
  427. !CI.getFrontendOpts().CodeCompletionAt.FileName.empty())
  428. CI.createCodeCompletionConsumer();
  429. // Use a code completion consumer?
  430. CodeCompleteConsumer *CompletionConsumer = nullptr;
  431. if (CI.hasCodeCompletionConsumer())
  432. CompletionConsumer = &CI.getCodeCompletionConsumer();
  433. if (!CI.hasSema())
  434. CI.createSema(getTranslationUnitKind(), CompletionConsumer);
  435. ParseAST(CI.getSema(), CI.getFrontendOpts().ShowStats,
  436. CI.getFrontendOpts().SkipFunctionBodies);
  437. }
  438. void PluginASTAction::anchor() { }
  439. ASTConsumer *
  440. PreprocessorFrontendAction::CreateASTConsumer(CompilerInstance &CI,
  441. StringRef InFile) {
  442. llvm_unreachable("Invalid CreateASTConsumer on preprocessor action!");
  443. }
  444. ASTConsumer *WrapperFrontendAction::CreateASTConsumer(CompilerInstance &CI,
  445. StringRef InFile) {
  446. return WrappedAction->CreateASTConsumer(CI, InFile);
  447. }
  448. bool WrapperFrontendAction::BeginInvocation(CompilerInstance &CI) {
  449. return WrappedAction->BeginInvocation(CI);
  450. }
  451. bool WrapperFrontendAction::BeginSourceFileAction(CompilerInstance &CI,
  452. StringRef Filename) {
  453. WrappedAction->setCurrentInput(getCurrentInput());
  454. WrappedAction->setCompilerInstance(&CI);
  455. return WrappedAction->BeginSourceFileAction(CI, Filename);
  456. }
  457. void WrapperFrontendAction::ExecuteAction() {
  458. WrappedAction->ExecuteAction();
  459. }
  460. void WrapperFrontendAction::EndSourceFileAction() {
  461. WrappedAction->EndSourceFileAction();
  462. }
  463. bool WrapperFrontendAction::usesPreprocessorOnly() const {
  464. return WrappedAction->usesPreprocessorOnly();
  465. }
  466. TranslationUnitKind WrapperFrontendAction::getTranslationUnitKind() {
  467. return WrappedAction->getTranslationUnitKind();
  468. }
  469. bool WrapperFrontendAction::hasPCHSupport() const {
  470. return WrappedAction->hasPCHSupport();
  471. }
  472. bool WrapperFrontendAction::hasASTFileSupport() const {
  473. return WrappedAction->hasASTFileSupport();
  474. }
  475. bool WrapperFrontendAction::hasIRSupport() const {
  476. return WrappedAction->hasIRSupport();
  477. }
  478. bool WrapperFrontendAction::hasCodeCompletionSupport() const {
  479. return WrappedAction->hasCodeCompletionSupport();
  480. }
  481. WrapperFrontendAction::WrapperFrontendAction(FrontendAction *WrappedAction)
  482. : WrappedAction(WrappedAction) {}