[llvm] IR: Make Module::getOrInsertGlobal() return a GlobalVariable. (PR #141323)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 23 20:17:15 PDT 2025


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 HEAD~1 HEAD --extensions h,cpp -- llvm/include/llvm/IR/Module.h llvm/lib/CodeGen/LowerEmuTLS.cpp llvm/lib/CodeGen/TargetLoweringBase.cpp llvm/lib/CodeGen/WasmEHPrepare.cpp llvm/lib/IR/Module.cpp llvm/lib/Transforms/IPO/LowerTypeTests.cpp llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp llvm/unittests/Analysis/BasicAliasAnalysisTest.cpp llvm/unittests/IR/ConstantsTest.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/include/llvm/IR/Module.h b/llvm/include/llvm/IR/Module.h
index 0dc8164b9..31320507a 100644
--- a/llvm/include/llvm/IR/Module.h
+++ b/llvm/include/llvm/IR/Module.h
@@ -480,9 +480,9 @@ public:
   /// overload constructs the global variable using its constructor's defaults.
   GlobalVariable *getOrInsertGlobal(StringRef Name, Type *Ty);
 
-/// @}
-/// @name Global Alias Accessors
-/// @{
+  /// @}
+  /// @name Global Alias Accessors
+  /// @{
 
   /// Return the global alias in the module with the specified name, of
   /// arbitrary type. This method returns null if a global with the specified

``````````

</details>


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


More information about the llvm-commits mailing list