[llvm] r343724 - Make meanings of variables clearer in action table generation (NFC)
Heejin Ahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 3 14:30:16 PDT 2018
Author: aheejin
Date: Wed Oct 3 14:30:15 2018
New Revision: 343724
URL: http://llvm.org/viewvc/llvm-project?rev=343724&view=rev
Log:
Make meanings of variables clearer in action table generation (NFC)
Summary:
Reviewers: kristina, zhmu, dschuff, rnk
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D52680
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/EHStreamer.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/EHStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/EHStreamer.cpp?rev=343724&r1=343723&r2=343724&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/EHStreamer.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/EHStreamer.cpp Wed Oct 3 14:30:15 2018
@@ -99,7 +99,7 @@ void EHStreamer::computeActionsTable(
FirstActions.reserve(LandingPads.size());
int FirstAction = 0;
- unsigned SizeActions = 0;
+ unsigned SizeActions = 0; // Total size of all action entries for a function
const LandingPadInfo *PrevLPI = nullptr;
for (SmallVectorImpl<const LandingPadInfo *>::const_iterator
@@ -107,23 +107,24 @@ void EHStreamer::computeActionsTable(
const LandingPadInfo *LPI = *I;
const std::vector<int> &TypeIds = LPI->TypeIds;
unsigned NumShared = PrevLPI ? sharedTypeIDs(LPI, PrevLPI) : 0;
- unsigned SizeSiteActions = 0;
+ unsigned SizeSiteActions = 0; // Total size of all entries for a landingpad
if (NumShared < TypeIds.size()) {
- unsigned SizeAction = 0;
+ // Size of one action entry (typeid + next action)
+ unsigned SizeActionEntry = 0;
unsigned PrevAction = (unsigned)-1;
if (NumShared) {
unsigned SizePrevIds = PrevLPI->TypeIds.size();
assert(Actions.size());
PrevAction = Actions.size() - 1;
- SizeAction = getSLEB128Size(Actions[PrevAction].NextAction) +
- getSLEB128Size(Actions[PrevAction].ValueForTypeID);
+ SizeActionEntry = getSLEB128Size(Actions[PrevAction].NextAction) +
+ getSLEB128Size(Actions[PrevAction].ValueForTypeID);
for (unsigned j = NumShared; j != SizePrevIds; ++j) {
assert(PrevAction != (unsigned)-1 && "PrevAction is invalid!");
- SizeAction -= getSLEB128Size(Actions[PrevAction].ValueForTypeID);
- SizeAction += -Actions[PrevAction].NextAction;
+ SizeActionEntry -= getSLEB128Size(Actions[PrevAction].ValueForTypeID);
+ SizeActionEntry += -Actions[PrevAction].NextAction;
PrevAction = Actions[PrevAction].Previous;
}
}
@@ -136,9 +137,9 @@ void EHStreamer::computeActionsTable(
isFilterEHSelector(TypeID) ? FilterOffsets[-1 - TypeID] : TypeID;
unsigned SizeTypeID = getSLEB128Size(ValueForTypeID);
- int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0;
- SizeAction = SizeTypeID + getSLEB128Size(NextAction);
- SizeSiteActions += SizeAction;
+ int NextAction = SizeActionEntry ? -(SizeActionEntry + SizeTypeID) : 0;
+ SizeActionEntry = SizeTypeID + getSLEB128Size(NextAction);
+ SizeSiteActions += SizeActionEntry;
ActionEntry Action = { ValueForTypeID, NextAction, PrevAction };
Actions.push_back(Action);
@@ -146,7 +147,7 @@ void EHStreamer::computeActionsTable(
}
// Record the first action of the landing pad site.
- FirstAction = SizeActions + SizeSiteActions - SizeAction + 1;
+ FirstAction = SizeActions + SizeSiteActions - SizeActionEntry + 1;
} // else identical - re-use previous FirstAction
// Information used when creating the call-site table. The action record
More information about the llvm-commits
mailing list