================
@@ -620,13 +649,23 @@ CrossTranslationUnitContext::ASTLoader::loadFromSource(
       CI.getDiagnostics().getDiagnosticIDs()};
   auto Diags = llvm::makeIntrusiveRefCnt<DiagnosticsEngine>(DiagID, *DiagOpts,
                                                             DiagClient);
+  std::unique_ptr<MacroExpansionContext> MacroExpansions;
 
   // This runs the driver which isn't expected to be free of sandbox 
violations.
   auto BypassSandbox = llvm::sys::sandbox::scopedDisable();
-  return CreateASTUnitFromCommandLine(
+  auto Unit = CreateASTUnitFromCommandLine(
       CommandLineArgs.begin(), (CommandLineArgs.end()),
       CI.getPCHContainerOperations(), DiagOpts, Diags,
-      CI.getHeaderSearchOpts().ResourceDir);
+      CI.getHeaderSearchOpts().ResourceDir, false, StringRef(), false,
+      CaptureDiagsKind::None, {}, true, 0, TU_Complete, false, false, false,
+      SkipFunctionBodiesScope::None, false, false, false, false, std::nullopt,
+      nullptr, nullptr, [&MacroExpansions](CompilerInstance &CI) {
+        MacroExpansions.reset(new MacroExpansionContext(CI.getLangOpts()));
----------------
steakhal wrote:

I think this is also a `make_unique` candidate.

https://github.com/llvm/llvm-project/pull/176126
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to