[PATCH] D58374: [Clang][NewPM] Don't bail out if the target machine is empty

Chandler Carruth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 26 14:42:56 PST 2019


chandlerc requested changes to this revision.
chandlerc added a comment.
This revision now requires changes to proceed.

Maybe update at least some of the tests using these targets to additionally run with the new pass manager explicitly enabled via flag?



================
Comment at: clang/lib/CodeGen/BackendUtil.cpp:950
 
-  // The new pass manager always makes a target machine available to passes
-  // during construction.
-  CreateTargetMachine(/*MustCreateTM*/ true);
-  if (!TM)
-    // This will already be diagnosed, just bail.
+  bool UsesCodeGen = (Action != Backend_EmitNothing &&
+                      Action != Backend_EmitBC &&
----------------
I would say `RequiresCodeGen` instead of `UsesCodeGen` as we will still *use* the target manager even if it isn't required when emitting a `.ll` file.


Repository:
  rC Clang

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

https://reviews.llvm.org/D58374





More information about the cfe-commits mailing list