Skip to content

Commit dad5d95

Browse files
[dfsan] Rename CachedCombinedShadow to be CachedShadow
At D92261, this type will be used to cache both combined shadow and converted shadow values. Reviewed-by: morehouse Differential Revision: https://reviews.llvm.org/D92458
1 parent 838ecf2 commit dad5d95

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,12 @@ struct DFSanFunction {
428428
std::vector<Value *> NonZeroChecks;
429429
bool AvoidNewBlocks;
430430

431-
struct CachedCombinedShadow {
432-
BasicBlock *Block;
431+
struct CachedShadow {
432+
BasicBlock *Block; // The block where Shadow is defined.
433433
Value *Shadow;
434434
};
435-
DenseMap<std::pair<Value *, Value *>, CachedCombinedShadow>
436-
CachedCombinedShadows;
435+
/// Maps a value to its latest shadow value in terms of domination tree.
436+
DenseMap<std::pair<Value *, Value *>, CachedShadow> CachedShadows;
437437
DenseMap<Value *, std::set<Value *>> ShadowElements;
438438

439439
DFSanFunction(DataFlowSanitizer &DFS, Function *F, bool IsNativeABI)
@@ -1145,7 +1145,7 @@ Value *DFSanFunction::combineShadows(Value *V1, Value *V2, Instruction *Pos) {
11451145
auto Key = std::make_pair(V1, V2);
11461146
if (V1 > V2)
11471147
std::swap(Key.first, Key.second);
1148-
CachedCombinedShadow &CCS = CachedCombinedShadows[Key];
1148+
CachedShadow &CCS = CachedShadows[Key];
11491149
if (CCS.Block && DT.dominates(CCS.Block, Pos->getParent()))
11501150
return CCS.Shadow;
11511151

0 commit comments

Comments
 (0)