[PATCH] D92458: [dfsan] Rename CachedCombinedShadow to be CachedShadow

stephan.yichao.zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 1 21:56:20 PST 2020


stephan.yichao.zhao created this revision.
stephan.yichao.zhao added reviewers: morehouse, pcc.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
stephan.yichao.zhao requested review of this revision.

At D92261 <https://reviews.llvm.org/D92261>, this type will be used to cache both combined shadow and
converted shadow values


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92458

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


Index: llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
@@ -428,12 +428,13 @@
   std::vector<Value *> NonZeroChecks;
   bool AvoidNewBlocks;
 
-  struct CachedCombinedShadow {
+  struct CachedShadow {
+    // The block where Shadow is defined.
     BasicBlock *Block;
     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 +1146,7 @@
   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;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92458.308870.patch
Type: text/x-patch
Size: 1170 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201202/30cd9e52/attachment.bin>


More information about the llvm-commits mailing list