[llvm] TargetMachine: Remove DataLayout field (PR #226407)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 23:26:38 PDT 2026


================
@@ -246,15 +245,6 @@ void MachineFunction::init() {
     WinEHInfo = new (Allocator) WinEHFuncInfo();
   }
 
-  if (!Target.isCompatibleDataLayout(getDataLayout())) {
-    report_fatal_error(
-        formatv("Can't create a MachineFunction using a Module with a "
-                "Target-incompatible DataLayout attached\n  Target "
-                "DataLayout: {0}\n  Module DataLayout: {1}\n",
-                Target.createDataLayout().getStringRepresentation(),
-                getDataLayout().getStringRepresentation()));
----------------
aengelke wrote:

I'd be -1 to an assert inside a .cpp file. This is a somewhat common problem that users encounter, and distributions don't ship assert builds of LLVM. (This causes very curious bugs where users use wrong or intentionally wrong(!) data layouts and find that everything "works" with LLVM release builds only to discover that assert builds of LLVM are broken.)

https://github.com/llvm/llvm-project/pull/226407


More information about the llvm-commits mailing list