[llvm] [CFI] Fix Direct Call Issues in CFI Dispatch Table (PR #69663)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 17:41:46 PDT 2023


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 bce3b505931cee9dc79d1c56c021983b4a8fb819 fe7e0e8e02b1c87bfc1f08288a6fede1369f696b -- llvm/lib/Transforms/IPO/LowerTypeTests.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
index ad6495a5669c..82ff8f9e012e 100644
--- a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+++ b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
@@ -500,7 +500,8 @@ class LowerTypeTestsModule {
   Type *getJumpTableEntryType();
   void createJumpTableEntry(raw_ostream &AsmOS, raw_ostream &ConstraintOS,
                             Triple::ArchType JumpTableArch,
-                            SmallVectorImpl<Value *> &AsmArgs, Function *Dest, bool& doesEntryHaveNoUnwind);
+                            SmallVectorImpl<Value *> &AsmArgs, Function *Dest,
+                            bool &doesEntryHaveNoUnwind);
   void verifyTypeMDNode(GlobalObject *GO, MDNode *Type);
   void buildBitSetsFromFunctions(ArrayRef<Metadata *> TypeIds,
                                  ArrayRef<GlobalTypeMember *> Functions);
@@ -1254,7 +1255,7 @@ unsigned LowerTypeTestsModule::getJumpTableEntrySize() {
 void LowerTypeTestsModule::createJumpTableEntry(
     raw_ostream &AsmOS, raw_ostream &ConstraintOS,
     Triple::ArchType JumpTableArch, SmallVectorImpl<Value *> &AsmArgs,
-    Function *Dest, bool& doesEntryHaveNoUnwind) {
+    Function *Dest, bool &doesEntryHaveNoUnwind) {
   if (Dest->hasFnAttribute(llvm::Attribute::NoUnwind))
     doesEntryHaveNoUnwind = true;
 
@@ -1477,7 +1478,8 @@ void LowerTypeTestsModule::createJumpTable(
 
   for (GlobalTypeMember *GTM : Functions)
     createJumpTableEntry(AsmOS, ConstraintOS, JumpTableArch, AsmArgs,
-                         cast<Function>(GTM->getGlobal()), doesEntryHaveNoUnwind);
+                         cast<Function>(GTM->getGlobal()),
+                         doesEntryHaveNoUnwind);
 
   // Align the whole table by entry size.
   F->setAlignment(Align(getJumpTableEntrySize()));
@@ -1522,7 +1524,7 @@ void LowerTypeTestsModule::createJumpTable(
     F->addFnAttr(Attribute::NoCfCheck);
 
   // Make sure we don't emit .eh_frame for this function if it isn't needed.
-  if(doesEntryHaveNoUnwind)
+  if (doesEntryHaveNoUnwind)
     F->addFnAttr(Attribute::NoUnwind);
 
   // Make sure we do not inline any calls to the cfi.jumptable.

``````````

</details>


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


More information about the llvm-commits mailing list