[PATCH] D97493: [clang][NFC] Extract Target and AuxTarget creation in CompilerInstance to new function

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 25 14:25:36 PST 2021


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

Thanks, this looks pretty unintrusive and will save a bunch of duplication.



================
Comment at: clang/include/clang/Frontend/CompilerInstance.h:385
 
+  // Create Target and AuxTarget based on cuurent LangOpts.
+  bool createTargetAndAuxTarget();
----------------
cuurent -> current

LangOpts seems maybe too narrow, just options?


================
Comment at: clang/lib/Frontend/CompilerInstance.cpp:100
 
+bool CompilerInstance::createTargetAndAuxTarget() {
+  // Create the target instance.
----------------
I'd suggest just createTarget(), because the aux target is part of the target


================
Comment at: clang/lib/Frontend/CompilerInstance.cpp:135
+  // Inform the target of the language options.
+  / FIXME: We shouldn't need to do this, the target should be immutable once
+  // created. This complexity should be lifted elsewhere.
----------------
looks like this comment got mangled


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97493



More information about the cfe-commits mailing list