[ThinLTO] Summarize vcall_visibility metadata
Summary: Second patch in series to support Safe Whole Program Devirtualization Enablement, see RFC here: http://lists.llvm.org/pipermail/llvm-dev/2019-December/137543.html Summarize vcall_visibility metadata in ThinLTO global variable summary. Depends on D71907. Reviewers: pcc, evgeny777, steven_wu Subscribers: mehdi_amini, Prazek, inglorion, hiraditya, dexonsmith, arphaman, ostannard, llvm-commits, cfe-commits, davidxl Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71911
This commit is contained in:
@@ -985,9 +985,10 @@ static GlobalValueSummary::GVFlags getDecodedGVSummaryFlags(uint64_t RawFlags,
|
||||
|
||||
// Decode the flags for GlobalVariable in the summary
|
||||
static GlobalVarSummary::GVarFlags getDecodedGVarFlags(uint64_t RawFlags) {
|
||||
return GlobalVarSummary::GVarFlags((RawFlags & 0x1) ? true : false,
|
||||
(RawFlags & 0x2) ? true : false,
|
||||
(RawFlags & 0x4) ? true : false);
|
||||
return GlobalVarSummary::GVarFlags(
|
||||
(RawFlags & 0x1) ? true : false, (RawFlags & 0x2) ? true : false,
|
||||
(RawFlags & 0x4) ? true : false,
|
||||
(GlobalObject::VCallVisibility)(RawFlags >> 3));
|
||||
}
|
||||
|
||||
static GlobalValue::VisibilityTypes getDecodedVisibility(unsigned Val) {
|
||||
@@ -5969,7 +5970,8 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
|
||||
unsigned RefArrayStart = 2;
|
||||
GlobalVarSummary::GVarFlags GVF(/* ReadOnly */ false,
|
||||
/* WriteOnly */ false,
|
||||
/* Constant */ false);
|
||||
/* Constant */ false,
|
||||
GlobalObject::VCallVisibilityPublic);
|
||||
auto Flags = getDecodedGVSummaryFlags(RawFlags, Version);
|
||||
if (Version >= 5) {
|
||||
GVF = getDecodedGVarFlags(Record[2]);
|
||||
@@ -6106,7 +6108,8 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
|
||||
unsigned RefArrayStart = 3;
|
||||
GlobalVarSummary::GVarFlags GVF(/* ReadOnly */ false,
|
||||
/* WriteOnly */ false,
|
||||
/* Constant */ false);
|
||||
/* Constant */ false,
|
||||
GlobalObject::VCallVisibilityPublic);
|
||||
auto Flags = getDecodedGVSummaryFlags(RawFlags, Version);
|
||||
if (Version >= 5) {
|
||||
GVF = getDecodedGVarFlags(Record[3]);
|
||||
|
||||
Reference in New Issue
Block a user