[PATCH] D104152: Remove numeric values from -asan-use-after-return flag.

Kevin Athey via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 11 13:40:59 PDT 2021


kda created this revision.
kda added a reviewer: vitalybuka.
Herald added a subscriber: hiraditya.
kda requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

for issue: https://github.com/google/sanitizers/issues/1394


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104152

Files:
  llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
  llvm/test/DebugInfo/X86/asan_debug_info.ll
  llvm/test/Instrumentation/AddressSanitizer/debug_info.ll
  llvm/test/Instrumentation/AddressSanitizer/fake-stack.ll
  llvm/test/Instrumentation/AddressSanitizer/lifetime-throw.ll
  llvm/test/Instrumentation/AddressSanitizer/lifetime.ll


Index: llvm/test/Instrumentation/AddressSanitizer/lifetime.ll
===================================================================
--- llvm/test/Instrumentation/AddressSanitizer/lifetime.ll
+++ llvm/test/Instrumentation/AddressSanitizer/lifetime.ll
@@ -1,8 +1,8 @@
 ; Test handling of llvm.lifetime intrinsics.
-; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-use-after-scope -asan-use-after-return=0 -S | FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT
-; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-scope -asan-use-after-return=0 -S | FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT
-; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-use-after-scope -asan-use-after-return=0 -asan-instrument-dynamic-allocas=0 -S | FileCheck %s --check-prefixes=CHECK,CHECK-NO-DYNAMIC
-; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-scope -asan-use-after-return=0 -asan-instrument-dynamic-allocas=0 -S | FileCheck %s --check-prefixes=CHECK,CHECK-NO-DYNAMIC
+; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-use-after-scope -asan-use-after-return=never -S | FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT
+; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-scope -asan-use-after-return=never -S | FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT
+; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-use-after-scope -asan-use-after-return=never -asan-instrument-dynamic-allocas=0 -S | FileCheck %s --check-prefixes=CHECK,CHECK-NO-DYNAMIC
+; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-scope -asan-use-after-return=never -asan-instrument-dynamic-allocas=0 -S | FileCheck %s --check-prefixes=CHECK,CHECK-NO-DYNAMIC
 
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
Index: llvm/test/Instrumentation/AddressSanitizer/lifetime-throw.ll
===================================================================
--- llvm/test/Instrumentation/AddressSanitizer/lifetime-throw.ll
+++ llvm/test/Instrumentation/AddressSanitizer/lifetime-throw.ll
@@ -1,6 +1,6 @@
 ; Test handling of llvm.lifetime intrinsics with C++ exceptions.
-; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-use-after-scope -asan-use-after-return=0 -S | FileCheck %s
-; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-scope -asan-use-after-return=0 -S | FileCheck %s
+; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-use-after-scope -asan-use-after-return=never -S | FileCheck %s
+; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-scope -asan-use-after-return=never -S | FileCheck %s
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
Index: llvm/test/Instrumentation/AddressSanitizer/fake-stack.ll
===================================================================
--- llvm/test/Instrumentation/AddressSanitizer/fake-stack.ll
+++ llvm/test/Instrumentation/AddressSanitizer/fake-stack.ll
@@ -1,7 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-return=0 -S | FileCheck %s --check-prefixes=CHECK,NEVER
-; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-return=1 -S | FileCheck %s --check-prefixes=CHECK,RUNTIME
-; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-return=2 -S | FileCheck %s --check-prefixes=CHECK,ALWAYS
+; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-return=never -S | FileCheck %s --check-prefixes=CHECK,NEVER
+; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-return=runtime -S | FileCheck %s --check-prefixes=CHECK,RUNTIME
+; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-return=always -S | FileCheck %s --check-prefixes=CHECK,ALWAYS
 target datalayout = "e-i64:64-f80:128-s:64-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
Index: llvm/test/Instrumentation/AddressSanitizer/debug_info.ll
===================================================================
--- llvm/test/Instrumentation/AddressSanitizer/debug_info.ll
+++ llvm/test/Instrumentation/AddressSanitizer/debug_info.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-use-after-return=0 -S | FileCheck %s
-; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-return=0 -S | FileCheck %s
+; RUN: opt < %s -asan -asan-module -enable-new-pm=0 -asan-use-after-return=never -S | FileCheck %s
+; RUN: opt < %s -passes='asan-pipeline' -asan-use-after-return=never -S | FileCheck %s
 
 ; Checks that llvm.dbg.declare instructions are updated
 ; accordingly as we merge allocas.
Index: llvm/test/DebugInfo/X86/asan_debug_info.ll
===================================================================
--- llvm/test/DebugInfo/X86/asan_debug_info.ll
+++ llvm/test/DebugInfo/X86/asan_debug_info.ll
@@ -1,7 +1,7 @@
-; RUN: opt < %s -asan -asan-module -asan-use-after-return=0 -S -enable-new-pm=0 | \
+; RUN: opt < %s -asan -asan-module -asan-use-after-return=never -S -enable-new-pm=0 | \
 ; RUN:   llc -O0 -filetype=obj - -o - | \
 ; RUN:   llvm-dwarfdump - | FileCheck %s
-; RUN: opt < %s -passes=asan-pipeline -asan-use-after-return=0 -S | \
+; RUN: opt < %s -passes=asan-pipeline -asan-use-after-return=never -S | \
 ; RUN:   llc -O0 -filetype=obj - -o - | \
 ; RUN:   llvm-dwarfdump - | FileCheck %s
 
Index: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -266,20 +266,11 @@
     cl::values(
         clEnumValN(AsanDetectStackUseAfterReturnMode::Never, "never",
                    "Never detect stack use after return."),
-        clEnumValN(AsanDetectStackUseAfterReturnMode::Never,
-                   "0", // only needed to keep unit tests passing
-                   "Redundant with 'never'."),
         clEnumValN(
             AsanDetectStackUseAfterReturnMode::Runtime, "runtime",
             "Detect stack use after return if "
             "binary flag 'ASAN_OPTIONS=detect_stack_use_after_return' is set."),
-        clEnumValN(AsanDetectStackUseAfterReturnMode::Runtime,
-                   "1", // only needed to keep unit tests passing
-                   "redundant with 'runtime'."),
         clEnumValN(AsanDetectStackUseAfterReturnMode::Always, "always",
-                   "Always detect stack use after return."),
-        clEnumValN(AsanDetectStackUseAfterReturnMode::Always,
-                   "2", // only needed to keep unit tests passing
                    "Always detect stack use after return.")),
     cl::Hidden, cl::init(AsanDetectStackUseAfterReturnMode::Runtime));
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104152.351552.patch
Type: text/x-patch
Size: 6806 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210611/b6d076d6/attachment.bin>


More information about the llvm-commits mailing list