[llvm-branch-commits] [llvm] dad5d95 - [dfsan] Rename CachedCombinedShadow to be CachedShadow

Jianzhou Zhao via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 2 13:45:19 PST 2020


Author: Jianzhou Zhao
Date: 2020-12-02T21:39:16Z
New Revision: dad5d9588335d6e4232b7c263da24ae2676673da

URL: https://github.com/llvm/llvm-project/commit/dad5d9588335d6e4232b7c263da24ae2676673da
DIFF: https://github.com/llvm/llvm-project/commit/dad5d9588335d6e4232b7c263da24ae2676673da.diff

LOG: [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

Added: 
    

Modified: 
    llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
index 4fd6308fcc49..46f4becb511f 100644
--- a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
@@ -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)
@@ -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;
 


        


More information about the llvm-branch-commits mailing list