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

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Sep 25 02:44:07 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()));
----------------
arsenm wrote:

No. I'm not sure how you would be able to reach this if the TargetMachine doesn't have its own datalayout. You could still use a wrong datalayout for the triple, but nothing tries to catch that today (I don't think this error would?). I'm not sure why this is where this is where this diagnostic was, I would hope this would be handled where the module is first seen 

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


More information about the llvm-branch-commits mailing list