[llvm] b21909c - Revert "[lli] Honor -mtriple option in -jit-kind=orc mode."

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 08:59:23 PDT 2023


Author: Nico Weber
Date: 2023-05-10T17:59:02+02:00
New Revision: b21909c0fc6adc62c2077037fcc8eec5f7cdbdd7

URL: https://github.com/llvm/llvm-project/commit/b21909c0fc6adc62c2077037fcc8eec5f7cdbdd7
DIFF: https://github.com/llvm/llvm-project/commit/b21909c0fc6adc62c2077037fcc8eec5f7cdbdd7.diff

LOG: Revert "[lli] Honor -mtriple option in -jit-kind=orc mode."

This reverts commit 624dcd8d53c1ffe10fbc936b186a98ec7fa1c865.
Breaks check-llvm on Windows, see https://reviews.llvm.org/D149996#4332381

Added: 
    

Modified: 
    llvm/tools/lli/lli.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 390b9989a838..33b2bf869893 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -845,24 +845,17 @@ int runOrcJIT(const char *ProgName) {
   orc::ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
   auto MainModule = ExitOnErr(loadModule(InputFile, TSCtx));
 
-  // If -mtriple option is given then use it, otherwise take the triple from
-  // the main module if it's present.
+  // Get TargetTriple and DataLayout from the main module if they're explicitly
+  // set.
   std::optional<Triple> TT;
-  if (!TargetTriple.empty())
-    TT = Triple(TargetTriple);
-  else
-    MainModule.withModuleDo([&](Module &M) {
+  std::optional<DataLayout> DL;
+  MainModule.withModuleDo([&](Module &M) {
       if (!M.getTargetTriple().empty())
         TT = Triple(M.getTargetTriple());
+      if (!M.getDataLayout().isDefault())
+        DL = M.getDataLayout();
     });
 
-  // Get the DataLayout from the main module if it's explicitly set.
-  std::optional<DataLayout> DL;
-  MainModule.withModuleDo([&](Module &M) {
-    if (!M.getDataLayout().isDefault())
-      DL = M.getDataLayout();
-  });
-
   orc::LLLazyJITBuilder Builder;
 
   Builder.setJITTargetMachineBuilder(


        


More information about the llvm-commits mailing list