[PATCH] Add helper functions in Statepoint.h to handle invoke statepoints.
Philip Reames
listmail at philipreames.com
Tue Feb 3 08:59:09 PST 2015
Some style cleanup needed. Comments inline.
REPOSITORY
rL LLVM
================
Comment at: include/llvm/IR/Statepoint.h:32
@@ -28,2 +31,3 @@
bool isStatepoint(const Instruction *inst);
bool isStatepoint(const Instruction &inst);
+bool isStatepoint(const Value *inst);
----------------
If we have the versions that take Value's, why do we need versions which take Instructions? Shouldn't the later match the former?
================
Comment at: include/llvm/IR/Statepoint.h:202
@@ -189,1 +201,3 @@
+ bool isTiedToInvoke() const {
+ const Value *Token = RelocateCS.getArgument(0);
----------------
Doxygen comment please
================
Comment at: include/llvm/IR/Statepoint.h:218
@@ +217,3 @@
+
+ if (!isa<ExtractValueInst>(token)) {
+ return cast<Instruction>(token);
----------------
Add a comment here. This combines both call statepoints and the normal path of invokes right?
================
Comment at: include/llvm/IR/Statepoint.h:272
@@ +271,3 @@
+ // Scan thorough exceptional relocations if it is invoke statepoint
+ if (StatepointCS.isInvoke()) {
+ LandingPadInst *landingpad =
----------------
Make this an early return to reduce indentation.
================
Comment at: include/llvm/IR/Statepoint.h:273
@@ +272,3 @@
+ if (StatepointCS.isInvoke()) {
+ LandingPadInst *landingpad =
+ cast<InvokeInst>(StatepointCS.getInstruction())->getLandingPadInst();
----------------
LandingPad please
http://reviews.llvm.org/D7364
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list