diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index f647c8a23705..3f07b880f795 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -240,12 +240,13 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(const CompilerInvocation &CI, Act.Execute(); - // Steal the created context and preprocessor, and take back the source and - // file managers. + // Steal the created target, context, and preprocessor, and take back the + // source and file managers. AST->Ctx.reset(Clang.takeASTContext()); AST->PP.reset(Clang.takePreprocessor()); Clang.takeSourceManager(); Clang.takeFileManager(); + AST->Target.reset(Clang.takeTarget()); Act.EndSourceFile();