LLVM 22.0.0git
|
Class used to determine the live ranges of debug variables in IR using SSA construction (via the SSAUpdaterImpl class), used for analysis purposes. More...
#include "llvm/Transforms/Utils/DebugSSAUpdater.h"
Public Member Functions | |
DebugSSAUpdater (SmallVectorImpl< DbgSSAPhi * > *InsertedPHIs=nullptr) | |
If InsertedPHIs is specified, it will be filled in with all PHI Nodes created by rewriting. | |
DebugSSAUpdater (const DebugSSAUpdater &)=delete | |
DebugSSAUpdater & | operator= (const DebugSSAUpdater &)=delete |
~DebugSSAUpdater () | |
void | reset () |
void | initialize () |
DbgSSABlock * | getDbgSSABlock (BasicBlock *BB) |
For a given BB, create a wrapper block for it. | |
void | addAvailableValue (DbgSSABlock *BB, DbgValueDef DV) |
Indicate that a rewritten value is available in the specified block with the specified value. | |
bool | hasValueForBlock (DbgSSABlock *BB) const |
Return true if the DebugSSAUpdater already has a value for the specified block. | |
DbgValueDef | findValueForBlock (DbgSSABlock *BB) const |
Return the value for the specified block if the DebugSSAUpdater has one, otherwise return nullptr. | |
DbgValueDef | getValueAtEndOfBlock (DbgSSABlock *BB) |
Construct SSA form, materializing a value that is live at the end of the specified block. | |
DbgValueDef | getValueInMiddleOfBlock (DbgSSABlock *BB) |
Construct SSA form, materializing a value that is live in the middle of the specified block. |
Friends | |
class | SSAUpdaterTraits< DebugSSAUpdater > |
Class used to determine the live ranges of debug variables in IR using SSA construction (via the SSAUpdaterImpl class), used for analysis purposes.
Definition at line 215 of file DebugSSAUpdater.h.
|
explicit |
If InsertedPHIs is specified, it will be filled in with all PHI Nodes created by rewriting.
Definition at line 45 of file DebugSSAUpdater.cpp.
Referenced by DebugSSAUpdater(), and operator=().
|
delete |
References DebugSSAUpdater().
|
inline |
Definition at line 238 of file DebugSSAUpdater.h.
References llvm::Block.
void DebugSSAUpdater::addAvailableValue | ( | DbgSSABlock * | BB, |
DbgValueDef | DV ) |
Indicate that a rewritten value is available in the specified block with the specified value.
Definition at line 58 of file DebugSSAUpdater.cpp.
DbgValueDef DebugSSAUpdater::findValueForBlock | ( | DbgSSABlock * | BB | ) | const |
Return the value for the specified block if the DebugSSAUpdater has one, otherwise return nullptr.
Definition at line 54 of file DebugSSAUpdater.cpp.
|
inline |
For a given BB, create a wrapper block for it.
Stores it in the DebugSSAUpdater block map.
Definition at line 256 of file DebugSSAUpdater.h.
DbgValueDef DebugSSAUpdater::getValueAtEndOfBlock | ( | DbgSSABlock * | BB | ) |
Construct SSA form, materializing a value that is live at the end of the specified block.
Definition at line 62 of file DebugSSAUpdater.cpp.
Referenced by getValueInMiddleOfBlock().
DbgValueDef DebugSSAUpdater::getValueInMiddleOfBlock | ( | DbgSSABlock * | BB | ) |
Construct SSA form, materializing a value that is live in the middle of the specified block.
getValueInMiddleOfBlock
is the same as GetValueAtEndOfBlock
except in one important case: if there is a definition of the rewritten value after the 'use' in BB. Consider code like this:
In this case, there are two values (X1 and X2) added to the AvailableVals set by the client of the rewriter, and those values are both live out of their respective blocks. However, the use of X happens in the middle of a block. Because of this, we need to insert a new PHI node in SomeBB to merge the appropriate values, and this value isn't live out of the block.
Definition at line 67 of file DebugSSAUpdater.cpp.
References llvm::DbgSSAPhi::addIncoming(), llvm::DbgValueDef::agreesWith(), llvm::dbgs(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), getValueAtEndOfBlock(), hasValueForBlock(), llvm::DbgValueDef::IsUndef, LLVM_DEBUG, llvm::DbgSSABlock::newPHI(), llvm::DbgSSABlock::predecessors(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
bool DebugSSAUpdater::hasValueForBlock | ( | DbgSSABlock * | BB | ) | const |
Return true if the DebugSSAUpdater already has a value for the specified block.
Definition at line 50 of file DebugSSAUpdater.cpp.
Referenced by getValueInMiddleOfBlock().
void DebugSSAUpdater::initialize | ( | ) |
Definition at line 48 of file DebugSSAUpdater.cpp.
|
delete |
References DebugSSAUpdater().
|
inline |
Definition at line 243 of file DebugSSAUpdater.h.
References llvm::Block.
|
friend |
Definition at line 210 of file DebugSSAUpdater.h.