[clang] [clang][RelativeVTables] Make the rtti_proxy LinkOnceODR instead of External linkage (PR #67755)

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 3 16:06:49 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 40c1f5b2fb88b17c6ed6911466002824d1880871 0e798f3fdd7dc8816a71e3e147ca14616ad4a123 -- clang/lib/CodeGen/CGVTables.cpp clang/test/CodeGenCXX/RelativeVTablesABI/child-vtable-in-comdat.cpp clang/test/CodeGenCXX/RelativeVTablesABI/parent-vtable-in-comdat.cpp clang/test/CodeGenCXX/RelativeVTablesABI/relative-vtables-hwasan.cpp clang/test/CodeGenCXX/RelativeVTablesABI/simple-vtable-definition.cpp clang/test/CodeGenCXX/RelativeVTablesABI/type-info.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp
index 1eec9ab29133..b093edbd84af 100644
--- a/clang/lib/CodeGen/CGVTables.cpp
+++ b/clang/lib/CodeGen/CGVTables.cpp
@@ -200,9 +200,8 @@ CodeGenFunction::GenerateVarArgsThunk(llvm::Function *Fn,
 
   // Find the first store of "this", which will be to the alloca associated
   // with "this".
-  Address ThisPtr =
-      Address(&*AI, ConvertTypeForMem(MD->getThisObjectType()),
-              CGM.getClassPointerAlignment(MD->getParent()));
+  Address ThisPtr = Address(&*AI, ConvertTypeForMem(MD->getThisObjectType()),
+                            CGM.getClassPointerAlignment(MD->getParent()));
   llvm::BasicBlock *EntryBB = &Fn->front();
   llvm::BasicBlock::iterator ThisStore =
       llvm::find_if(*EntryBB, [&](llvm::Instruction &I) {
@@ -1324,30 +1323,30 @@ void CodeGenModule::EmitVTableTypeMetadata(const CXXRecordDecl *RD,
                                 AP.second.AddressPointIndex));
 
   // Sort the address points for determinism.
-  llvm::sort(AddressPoints, [this](const AddressPoint &AP1,
-                                   const AddressPoint &AP2) {
-    if (&AP1 == &AP2)
-      return false;
-
-    std::string S1;
-    llvm::raw_string_ostream O1(S1);
-    getCXXABI().getMangleContext().mangleTypeName(
-        QualType(AP1.first->getTypeForDecl(), 0), O1);
-    O1.flush();
-
-    std::string S2;
-    llvm::raw_string_ostream O2(S2);
-    getCXXABI().getMangleContext().mangleTypeName(
-        QualType(AP2.first->getTypeForDecl(), 0), O2);
-    O2.flush();
-
-    if (S1 < S2)
-      return true;
-    if (S1 != S2)
-      return false;
-
-    return AP1.second < AP2.second;
-  });
+  llvm::sort(AddressPoints,
+             [this](const AddressPoint &AP1, const AddressPoint &AP2) {
+               if (&AP1 == &AP2)
+                 return false;
+
+               std::string S1;
+               llvm::raw_string_ostream O1(S1);
+               getCXXABI().getMangleContext().mangleTypeName(
+                   QualType(AP1.first->getTypeForDecl(), 0), O1);
+               O1.flush();
+
+               std::string S2;
+               llvm::raw_string_ostream O2(S2);
+               getCXXABI().getMangleContext().mangleTypeName(
+                   QualType(AP2.first->getTypeForDecl(), 0), O2);
+               O2.flush();
+
+               if (S1 < S2)
+                 return true;
+               if (S1 != S2)
+                 return false;
+
+               return AP1.second < AP2.second;
+             });
 
   ArrayRef<VTableComponent> Comps = VTLayout.vtable_components();
   for (auto AP : AddressPoints) {

``````````

</details>


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


More information about the cfe-commits mailing list