aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorLeonard Chan <leonardchan@google.com>2022-09-29 21:53:30 +0000
committerLeonard Chan <leonardchan@google.com>2022-12-08 00:42:48 +0000
commit003b6033e1b254dd96ddb341f375b73ee5bed2af (patch)
tree82f19df9718e8a980a85bf49be570be08f618873 /clang/lib/CodeGen/CodeGenModule.h
parent2a1100cd656b1e65eba7a4a875d0be62191342b0 (diff)
downloadllvm-003b6033e1b254dd96ddb341f375b73ee5bed2af.zip
llvm-003b6033e1b254dd96ddb341f375b73ee5bed2af.tar.gz
llvm-003b6033e1b254dd96ddb341f375b73ee5bed2af.tar.bz2
[clang] Ensure correct metadata for relative vtables
Prior to this, metadata pertaining to the size or address point offsets into a relative vtable were twice the value they should be (treating component widths as pointer width rather than 4 bytes). This prevented some vtables from being devirtualized with D134320. This ensures the correct metadata is written so whole program devirtualization can catch these remaining devirt targets. Differential Revision: https://reviews.llvm.org/D134687
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 5289f0c..4595dd5 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -760,6 +760,10 @@ public:
return VTables.getItaniumVTableContext();
}
+ const ItaniumVTableContext &getItaniumVTableContext() const {
+ return VTables.getItaniumVTableContext();
+ }
+
MicrosoftVTableContext &getMicrosoftVTableContext() {
return VTables.getMicrosoftVTableContext();
}
@@ -1444,6 +1448,8 @@ public:
llvm::GlobalVariable *VTable,
const VTableLayout &VTLayout);
+ llvm::Type *getVTableComponentType() const;
+
/// Generate a cross-DSO type identifier for MD.
llvm::ConstantInt *CreateCrossDsoCfiTypeId(llvm::Metadata *MD);