From 1d22596b2f6aef587af785744d8951668559113e Mon Sep 17 00:00:00 2001 From: Kevin Athey Date: Fri, 11 Jun 2021 13:39:35 -0700 Subject: [PATCH] [sanitizer] Remove numeric values from -asan-use-after-return flag. (NFC) for issue: https://github.com/google/sanitizers/issues/1394 Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D104152 --- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 9 --------- llvm/test/DebugInfo/X86/asan_debug_info.ll | 4 ++-- llvm/test/Instrumentation/AddressSanitizer/debug_info.ll | 4 ++-- llvm/test/Instrumentation/AddressSanitizer/fake-stack.ll | 6 +++--- llvm/test/Instrumentation/AddressSanitizer/lifetime-throw.ll | 4 ++-- llvm/test/Instrumentation/AddressSanitizer/lifetime.ll | 8 ++++---- 6 files changed, 13 insertions(+), 22 deletions(-) diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index dd26d34..1601c5d 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -266,20 +266,11 @@ static cl::opt ClUseAfterReturn( 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)); diff --git a/llvm/test/DebugInfo/X86/asan_debug_info.ll b/llvm/test/DebugInfo/X86/asan_debug_info.ll index 3f2ecc2..25e403e 100644 --- a/llvm/test/DebugInfo/X86/asan_debug_info.ll +++ b/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 diff --git a/llvm/test/Instrumentation/AddressSanitizer/debug_info.ll b/llvm/test/Instrumentation/AddressSanitizer/debug_info.ll index 1064ce5..7b21c7b 100644 --- a/llvm/test/Instrumentation/AddressSanitizer/debug_info.ll +++ b/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. diff --git a/llvm/test/Instrumentation/AddressSanitizer/fake-stack.ll b/llvm/test/Instrumentation/AddressSanitizer/fake-stack.ll index 682b667..b64d67b 100644 --- a/llvm/test/Instrumentation/AddressSanitizer/fake-stack.ll +++ b/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" diff --git a/llvm/test/Instrumentation/AddressSanitizer/lifetime-throw.ll b/llvm/test/Instrumentation/AddressSanitizer/lifetime-throw.ll index 64473fb..62253be 100644 --- a/llvm/test/Instrumentation/AddressSanitizer/lifetime-throw.ll +++ b/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" diff --git a/llvm/test/Instrumentation/AddressSanitizer/lifetime.ll b/llvm/test/Instrumentation/AddressSanitizer/lifetime.ll index 26aa657..d7ef711 100644 --- a/llvm/test/Instrumentation/AddressSanitizer/lifetime.ll +++ b/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" -- 2.7.4