[llvm] [llubi] Add support for common library function calls (PR #185645)

via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 07:13:13 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- llvm/tools/llubi/lib/Interpreter.h llvm/tools/llubi/lib/Library.cpp llvm/tools/llubi/lib/Library.h llvm/tools/llubi/lib/Context.h llvm/tools/llubi/lib/Interpreter.cpp llvm/tools/llubi/llubi.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/tools/llubi/lib/Context.h b/llvm/tools/llubi/lib/Context.h
index 735fd4dc3..fa23b4af1 100644
--- a/llvm/tools/llubi/lib/Context.h
+++ b/llvm/tools/llubi/lib/Context.h
@@ -262,10 +262,10 @@ public:
   /// value in \p RetVal if the function is not void.
   /// Returns how execution ended. If it ended via a library-triggered program
   /// termination (e.g., exit/abort/terminate), \p ExitInfo is populated.
-  ExecutionStatus runFunction(Function &F, ArrayRef<AnyValue> Args,
-                              AnyValue &RetVal, EventHandler &Handler,
-                              std::optional<ProgramExitInfo> *ExitInfo =
-                                  nullptr);
+  ExecutionStatus
+  runFunction(Function &F, ArrayRef<AnyValue> Args, AnyValue &RetVal,
+              EventHandler &Handler,
+              std::optional<ProgramExitInfo> *ExitInfo = nullptr);
 };
 
 } // namespace llvm::ubi
diff --git a/llvm/tools/llubi/lib/Interpreter.cpp b/llvm/tools/llubi/lib/Interpreter.cpp
index b0d680d8a..bc9f12fa1 100644
--- a/llvm/tools/llubi/lib/Interpreter.cpp
+++ b/llvm/tools/llubi/lib/Interpreter.cpp
@@ -1106,8 +1106,8 @@ ExecutionStatus InstExecutor::runMainLoop() {
 }
 
 ExecutionStatus Context::runFunction(Function &F, ArrayRef<AnyValue> Args,
-                                    AnyValue &RetVal, EventHandler &Handler,
-                                    std::optional<ProgramExitInfo> *ExitInfo) {
+                                     AnyValue &RetVal, EventHandler &Handler,
+                                     std::optional<ProgramExitInfo> *ExitInfo) {
   InstExecutor Executor(*this, Handler, F, Args, RetVal);
   ExecutionStatus Status = Executor.runMainLoop();
   if (ExitInfo)
@@ -1116,4 +1116,3 @@ ExecutionStatus Context::runFunction(Function &F, ArrayRef<AnyValue> Args,
 }
 
 } // namespace llvm::ubi
-
diff --git a/llvm/tools/llubi/lib/Library.cpp b/llvm/tools/llubi/lib/Library.cpp
index 0faca1940..be584cb85 100644
--- a/llvm/tools/llubi/lib/Library.cpp
+++ b/llvm/tools/llubi/lib/Library.cpp
@@ -324,4 +324,3 @@ std::optional<AnyValue> LibraryEnvironment::call(LibFunc LF, CallBase &CB) {
   }
 }
 } // namespace llvm::ubi
-

``````````

</details>


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


More information about the llvm-commits mailing list