[PATCH] D97561: [clang] Use CompilerInstance::createTarget to createTarget

Tommy Chiang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 6 13:11:53 PST 2021


oToToT abandoned this revision.
oToToT added a comment.

Since, originally, I think it is OK to submit patch just by project, but I agree that it's better to make patch as minimal as possible.
Thus, I will abandon this and resubmit another patch.
(I think reuploading patch and changing the whole patch logic here might not be great?)



================
Comment at: clang/lib/Frontend/PrecompiledPreamble.cpp:368
   // Create the target instance.
-  Clang->setTarget(TargetInfo::CreateTargetInfo(
-      Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
-  if (!Clang->hasTarget())
+  if (!Clang->createTarget())
     return BuildPreambleError::CouldntCreateTargetInfo;
----------------
sammccall wrote:
> oToToT wrote:
> > Changing this without other further patch might cause `clangd` results in Runtime Error while handling files like CUDA.
> > Should I also include the patch of `clangd` or other related projects into this patch?
> What kind of runtime error can this result in and why? What's the current behavior?
> 
> My guess is if this has to be consistent between preamble + main AST, then you should change PrecompiledPreamble, ASTUnit, and clangd together in one patch and leave others.
Yes, this is because the inconsistency between preamble and main AST. I will reorder my patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97561/new/

https://reviews.llvm.org/D97561



More information about the cfe-commits mailing list