[PATCH] D39673: Toolchain: Normalize dwarf, sjlj and seh eh

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 28 12:10:02 PST 2017


rnk requested changes to this revision.
rnk added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/Driver/ToolChain.cpp:450-458
+  const llvm::Target *TT = llvm::TargetRegistry::lookupTarget(TS, Error);
+  if (!TT)
+    return llvm::ExceptionHandling::None;
+  std::unique_ptr<llvm::MCRegisterInfo> MRI(TT->createMCRegInfo(TS));
+  if (!MRI)
+    return llvm::ExceptionHandling::None;
+  std::unique_ptr<llvm::MCAsmInfo> MAI(TT->createMCAsmInfo(*MRI, TS));
----------------
I think this is problematic because Clang is supposed to be able to generate LLVM IR for targets that are not registered. With this change, we have silent behavior difference between clang with LLVM backend and clang without LLVM backends.

Building clang without a single backend is pretty silly, but our test suite frequently generates IR for targets that are not compiled in. Some of the tests you've written will probably fail on buildbots configured this way.


Repository:
  rL LLVM

https://reviews.llvm.org/D39673





More information about the cfe-commits mailing list