[PATCH] D80771: [MTE] Convert StackSafety into analysisThis lets us to remove !stack-safe metadata andbetter controll when to perform StackSafetyanalysis.

Evgenii Stepanov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 29 13:41:15 PDT 2020


eugenis added inline comments.


================
Comment at: clang/test/Driver/memtag_lto.c:126
+  // XUNSAFE: [4]: full-set
+  // XSAFE: [4]: [0,4)
   int x;
----------------
Alloca order can easily change in the future. Not sure how to make this better. Perhaps simply remove the numbers and test that the function has one alloca with [0, 4) and one with [0, 1)? This looks specific enough.


================
Comment at: llvm/lib/Analysis/StackSafetyAnalysis.cpp:692
+  size_t Pos = 0;
+  // FIXME: Find nicer way to match find requested alloca.
+  for (auto &I : instructions(F)) {
----------------
either match or find, not both :)


================
Comment at: llvm/lib/Analysis/StackSafetyAnalysis.cpp:697
+        const FunctionInfo &FI = Iter->second;
+        return getStaticAllocaSizeRange(AI).contains(FI.Allocas[Pos].Range);
+      }
----------------
we could cache the results in a hashmap 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80771/new/

https://reviews.llvm.org/D80771





More information about the cfe-commits mailing list