Skip to content

Commit

Permalink
[dfsan] Rename CachedCombinedShadow to be CachedShadow
Browse files Browse the repository at this point in the history
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
  • Loading branch information
stephan-yichao-zhao committed Dec 2, 2020
1 parent 838ecf2 commit dad5d95
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
Expand Up @@ -428,12 +428,12 @@ struct DFSanFunction {
std::vector<Value *> NonZeroChecks;
bool AvoidNewBlocks;

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

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

Expand Down

0 comments on commit dad5d95

Please sign in to comment.