[llvm] [IR] Don't allow values of opaque type (PR #137625)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 28 05:48:45 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 cpp,h -- llvm/include/llvm/IR/Type.h llvm/lib/IR/Type.cpp llvm/lib/Linker/IRMover.cpp llvm/unittests/FuzzMutate/OperationsTest.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/IR/Type.cpp b/llvm/lib/IR/Type.cpp
index 3763980e9..a447baea3 100644
--- a/llvm/lib/IR/Type.cpp
+++ b/llvm/lib/IR/Type.cpp
@@ -249,15 +249,15 @@ int Type::getFPMantissaWidth() const {
 
 bool Type::isFirstClassType() const {
   switch (getTypeID()) {
-    default:
-      return true;
-    case FunctionTyID:
-    case VoidTyID:
-      return false;
-    case StructTyID: {
-      auto *ST = cast<StructType>(this);
-      return !ST->isOpaque();
-    }
+  default:
+    return true;
+  case FunctionTyID:
+  case VoidTyID:
+    return false;
+  case StructTyID: {
+    auto *ST = cast<StructType>(this);
+    return !ST->isOpaque();
+  }
   }
 }
 

``````````

</details>


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


More information about the llvm-commits mailing list