[PATCH] D55156: [asan] Rename -asan-use-private-alias to -asan-use-odr-indicator

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 30 17:22:24 PST 2018


vitalybuka created this revision.
vitalybuka added reviewers: eugenis, m.ostapenko, ygribov.
Herald added subscribers: llvm-commits, dexonsmith, steven_wu, hiraditya, kubamracek, mehdi_amini.

Repository:
  rL LLVM

https://reviews.llvm.org/D55156

Files:
  compiler-rt/test/asan/TestCases/Darwin/odr-lto.cc
  compiler-rt/test/asan/TestCases/Linux/local_alias.cc
  compiler-rt/test/asan/TestCases/Linux/odr-violation.cc
  llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
  llvm/test/Instrumentation/AddressSanitizer/local_alias.ll


Index: llvm/test/Instrumentation/AddressSanitizer/local_alias.ll
===================================================================
--- llvm/test/Instrumentation/AddressSanitizer/local_alias.ll
+++ llvm/test/Instrumentation/AddressSanitizer/local_alias.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -asan -asan-module -asan-use-private-alias=1 -S | FileCheck %s
+; RUN: opt < %s -asan -asan-module -asan-use-odr-indicator=1 -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/lib/Transforms/Instrumentation/AddressSanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -343,11 +343,10 @@
     cl::desc("Force optimization experiment (for testing)"), cl::Hidden,
     cl::init(0));
 
-static cl::opt<bool>
-    ClUsePrivateAliasForGlobals("asan-use-private-alias",
-                                cl::desc("Use private aliases for global"
-                                         " variables"),
-                                cl::Hidden, cl::init(false));
+static cl::opt<bool> ClUseOdrIndicator("asan-use-odr-indicator",
+                                       cl::desc("Use private aliases for global"
+                                                " variables"),
+                                       cl::Hidden, cl::init(false));
 
 static cl::opt<bool>
     ClUseGlobalsGC("asan-globals-live-support",
@@ -2173,7 +2172,7 @@
     bool CanUsePrivateAliases =
         TargetTriple.isOSBinFormatELF() || TargetTriple.isOSBinFormatMachO() ||
         TargetTriple.isOSBinFormatWasm();
-    if (CanUsePrivateAliases && ClUsePrivateAliasForGlobals) {
+    if (CanUsePrivateAliases && ClUseOdrIndicator) {
       // Create local alias for NewGlobal to avoid crash on ODR between
       // instrumented and non-instrumented libraries.
       auto *GA =
Index: compiler-rt/test/asan/TestCases/Linux/odr-violation.cc
===================================================================
--- compiler-rt/test/asan/TestCases/Linux/odr-violation.cc
+++ compiler-rt/test/asan/TestCases/Linux/odr-violation.cc
@@ -24,8 +24,8 @@
 // RUN: rm -f %t.supp
 //
 // Use private aliases for global variables: use indicator symbol to detect ODR violation.
-// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %t-ODR-SO.so -DSZ=100
-// RUN: %clangxx_asan -mllvm -asan-use-private-alias %s %t-ODR-SO.so -Wl,-R. -o %t-ODR-EXE
+// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared -mllvm -asan-use-odr-indicator %s -o %t-ODR-SO.so -DSZ=100
+// RUN: %clangxx_asan -mllvm -asan-use-odr-indicator %s %t-ODR-SO.so -Wl,-R. -o %t-ODR-EXE
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0                              %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0:use_odr_indicator=false      %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0:use_odr_indicator=true   not %run %t-ODR-EXE 2>&1 | FileCheck %s
Index: compiler-rt/test/asan/TestCases/Linux/local_alias.cc
===================================================================
--- compiler-rt/test/asan/TestCases/Linux/local_alias.cc
+++ compiler-rt/test/asan/TestCases/Linux/local_alias.cc
@@ -7,9 +7,9 @@
 // FIXME: https://github.com/google/sanitizers/issues/316
 // XFAIL: android
 //
-// RUN: %clangxx_asan -DBUILD_INSTRUMENTED_DSO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %t-INSTRUMENTED-SO.so
+// RUN: %clangxx_asan -DBUILD_INSTRUMENTED_DSO=1 -fPIC -shared -mllvm -asan-use-odr-indicator %s -o %t-INSTRUMENTED-SO.so
 // RUN: %clangxx -DBUILD_UNINSTRUMENTED_DSO=1 -fPIC -shared %s -o %t-UNINSTRUMENTED-SO.so
-// RUN: %clangxx %s -c -mllvm -asan-use-private-alias -o %t.o
+// RUN: %clangxx %s -c -mllvm -asan-use-odr-indicator -o %t.o
 // RUN: %clangxx_asan %t.o %t-UNINSTRUMENTED-SO.so %t-INSTRUMENTED-SO.so -o %t-EXE
 // RUN: %env_asan_opts=use_odr_indicator=true %run %t-EXE
 
Index: compiler-rt/test/asan/TestCases/Darwin/odr-lto.cc
===================================================================
--- compiler-rt/test/asan/TestCases/Darwin/odr-lto.cc
+++ compiler-rt/test/asan/TestCases/Darwin/odr-lto.cc
@@ -1,10 +1,10 @@
-// Check that -asan-use-private-alias and use_odr_indicator=1 silence the false
+// Check that -asan-use-odr-indicator and use_odr_indicator=1 silence the false
 // positive ODR violation on Darwin with LTO.
 
 // REQUIRES: lto
 
-// RUN: %clangxx_asan -DPART=0 -c %s -o %t-1.o -flto -mllvm -asan-use-private-alias
-// RUN: %clangxx_asan -DPART=1 -c %s -o %t-2.o -flto -mllvm -asan-use-private-alias
+// RUN: %clangxx_asan -DPART=0 -c %s -o %t-1.o -flto -mllvm -asan-use-odr-indicator
+// RUN: %clangxx_asan -DPART=1 -c %s -o %t-2.o -flto -mllvm -asan-use-odr-indicator
 // RUN: %clangxx_asan %t-1.o %t-2.o -o %t -flto
 // RUN: %env_asan_opts=use_odr_indicator=1 %run %t 2>&1 | FileCheck %s
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55156.176231.patch
Type: text/x-patch
Size: 5052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181201/373eb7b0/attachment.bin>


More information about the llvm-commits mailing list