[llvm] 5ca94f9 - [llvm-jitlink] Use std::optional::value_or (NFC) (#140173)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 15 23:29:18 PDT 2025


Author: Kazu Hirata
Date: 2025-05-15T23:29:15-07:00
New Revision: 5ca94f92fbeb2cb3c59e33169bee950b7f521400

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

LOG: [llvm-jitlink] Use std::optional::value_or (NFC) (#140173)

Added: 
    

Modified: 
    llvm/tools/llvm-jitlink/llvm-jitlink.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index 54b90cd7c7506..ab2f685b4fc1d 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -1243,7 +1243,7 @@ Session::Session(std::unique_ptr<ExecutorProcessControl> EPC, Error &Err)
       if ((Err = ES.getBootstrapMapValue<bool, bool>("darwin-use-ehframes-only",
                                                      ForceEHFrames)))
         return;
-      bool UseEHFrames = ForceEHFrames ? *ForceEHFrames : false;
+      bool UseEHFrames = ForceEHFrames.value_or(false);
       if (!UseEHFrames)
         ObjLayer.addPlugin(ExitOnErr(UnwindInfoRegistrationPlugin::Create(ES)));
       else


        


More information about the llvm-commits mailing list