[llvm] 4bfd8a2 - [NFC] [MTE] [HWASan] fixed orphaned comments.

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 8 16:42:47 PST 2022


Author: Florian Mayer
Date: 2022-03-08T16:42:31-08:00
New Revision: 4bfd8a2c5f3526c62940000aeea6d4c53c31cfc7

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

LOG: [NFC] [MTE] [HWASan] fixed orphaned comments.

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64StackTagging.cpp
    llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
index 854300853de71..c7a84c154cee8 100644
--- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
+++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
@@ -549,15 +549,15 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) {
     Info.AI->replaceAllUsesWith(TagPCall);
     TagPCall->setOperand(0, Info.AI);
 
+    // Calls to functions that may return twice (e.g. setjmp) confuse the
+    // postdominator analysis, and will leave us to keep memory tagged after
+    // function return. Work around this by always untagging at every return
+    // statement if return_twice functions are called.
     bool StandardLifetime =
         SInfo.UnrecognizedLifetimes.empty() &&
         memtag::isStandardLifetime(Info.LifetimeStart, Info.LifetimeEnd, DT,
                                    ClMaxLifetimes) &&
         !SInfo.CallsReturnTwice;
-    // Calls to functions that may return twice (e.g. setjmp) confuse the
-    // postdominator analysis, and will leave us to keep memory tagged after
-    // function return. Work around this by always untagging at every return
-    // statement if return_twice functions are called.
     if (StandardLifetime) {
       IntrinsicInst *Start = Info.LifetimeStart[0];
       uint64_t Size =

diff  --git a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
index 26167e0ba8c58..798d8ff2920f9 100644
--- a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
@@ -1352,6 +1352,10 @@ bool HWAddressSanitizer::instrumentStack(
       Value *UARTag = getUARTag(IRB, StackTag);
       tagAlloca(IRB, AI, UARTag, AlignedSize);
     };
+    // Calls to functions that may return twice (e.g. setjmp) confuse the
+    // postdominator analysis, and will leave us to keep memory tagged after
+    // function return. Work around this by always untagging at every return
+    // statement if return_twice functions are called.
     bool StandardLifetime =
         SInfo.UnrecognizedLifetimes.empty() &&
         memtag::isStandardLifetime(Info.LifetimeStart, Info.LifetimeEnd,
@@ -1468,10 +1472,6 @@ bool HWAddressSanitizer::sanitizeFunction(
   if (!SInfo.AllocasToInstrument.empty()) {
     Value *StackTag =
         ClGenerateTagsWithCalls ? nullptr : getStackBaseTag(EntryIRB);
-    // Calls to functions that may return twice (e.g. setjmp) confuse the
-    // postdominator analysis, and will leave us to keep memory tagged after
-    // function return. Work around this by always untagging at every return
-    // statement if return_twice functions are called.
     instrumentStack(SInfo, StackTag, GetDT, GetPDT);
   }
 


        


More information about the llvm-commits mailing list