[PATCH] D66697: hwasan, codegen: Keep more lifetime markers used for hwasan

2019-08-26 Thread Vitaly Buka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL369980: hwasan, codegen: Keep more lifetime markers used for 
hwasan (authored by vitalybuka, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66697?vs=216995=217253#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66697

Files:
  cfe/trunk/lib/CodeGen/CGExpr.cpp
  cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
  cfe/trunk/test/CodeGen/lifetime-sanitizer.c
  cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp


Index: cfe/trunk/test/CodeGen/lifetime-sanitizer.c
===
--- cfe/trunk/test/CodeGen/lifetime-sanitizer.c
+++ cfe/trunk/test/CodeGen/lifetime-sanitizer.c
@@ -5,6 +5,9 @@
 // RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
 // RUN: -fsanitize=memory %s | \
 // RUN: FileCheck %s -check-prefix=LIFETIME
+// RUN: %clang -target aarch64-linux-gnu -S -emit-llvm -o - -O0 \
+// RUN: -fsanitize=hwaddress %s | \
+// RUN: FileCheck %s -check-prefix=LIFETIME
 
 extern int bar(char *A, int n);
 
Index: cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp
===
--- cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp
+++ cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp
@@ -6,6 +6,9 @@
 // RUN: %clang -w -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions 
-O0 \
 // RUN: -fsanitize=memory %s | \
 // RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
+// RUN: %clang -w -target aarch64-linux-gnu -S -emit-llvm -o - -fno-exceptions 
-O0 \
+// RUN: -fsanitize=hwaddress %s | \
+// RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
 
 extern int bar(char *A, int n);
 
Index: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
===
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
@@ -49,6 +49,7 @@
 
   // Sanitizers may use markers.
   if (CGOpts.SanitizeAddressUseAfterScope ||
+  LangOpts.Sanitize.has(SanitizerKind::HWAddress) ||
   LangOpts.Sanitize.has(SanitizerKind::Memory))
 return true;
 
Index: cfe/trunk/lib/CodeGen/CGExpr.cpp
===
--- cfe/trunk/lib/CodeGen/CGExpr.cpp
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp
@@ -521,6 +521,7 @@
   ConditionalEvaluation *OldConditional = nullptr;
   CGBuilderTy::InsertPoint OldIP;
   if (isInConditionalBranch() && !E->getType().isDestructedType() &&
+  !SanOpts.has(SanitizerKind::HWAddress) &&
   !SanOpts.has(SanitizerKind::Memory) &&
   !CGM.getCodeGenOpts().SanitizeAddressUseAfterScope) {
 OldConditional = OutermostConditional;


Index: cfe/trunk/test/CodeGen/lifetime-sanitizer.c
===
--- cfe/trunk/test/CodeGen/lifetime-sanitizer.c
+++ cfe/trunk/test/CodeGen/lifetime-sanitizer.c
@@ -5,6 +5,9 @@
 // RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
 // RUN: -fsanitize=memory %s | \
 // RUN: FileCheck %s -check-prefix=LIFETIME
+// RUN: %clang -target aarch64-linux-gnu -S -emit-llvm -o - -O0 \
+// RUN: -fsanitize=hwaddress %s | \
+// RUN: FileCheck %s -check-prefix=LIFETIME
 
 extern int bar(char *A, int n);
 
Index: cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp
===
--- cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp
+++ cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp
@@ -6,6 +6,9 @@
 // RUN: %clang -w -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
 // RUN: -fsanitize=memory %s | \
 // RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
+// RUN: %clang -w -target aarch64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
+// RUN: -fsanitize=hwaddress %s | \
+// RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
 
 extern int bar(char *A, int n);
 
Index: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
===
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
@@ -49,6 +49,7 @@
 
   // Sanitizers may use markers.
   if (CGOpts.SanitizeAddressUseAfterScope ||
+  LangOpts.Sanitize.has(SanitizerKind::HWAddress) ||
   LangOpts.Sanitize.has(SanitizerKind::Memory))
 return true;
 
Index: cfe/trunk/lib/CodeGen/CGExpr.cpp
===
--- cfe/trunk/lib/CodeGen/CGExpr.cpp
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp
@@ -521,6 +521,7 @@
   ConditionalEvaluation *OldConditional = nullptr;
   CGBuilderTy::InsertPoint OldIP;
   if (isInConditionalBranch() && !E->getType().isDestructedType() &&
+  

[PATCH] D66697: hwasan, codegen: Keep more lifetime markers used for hwasan

2019-08-26 Thread Evgenii Stepanov via Phabricator via cfe-commits
eugenis accepted this revision.
eugenis added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66697



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D66697: hwasan, codegen: Keep more lifetime markers used for hwasan

2019-08-23 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka created this revision.
vitalybuka added a reviewer: eugenis.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
vitalybuka added a parent revision: D66695: msan, codegen, instcombine: Keep 
more lifetime markers used for msan.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66697

Files:
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/test/CodeGen/lifetime-sanitizer.c
  clang/test/CodeGenCXX/lifetime-sanitizer.cpp


Index: clang/test/CodeGenCXX/lifetime-sanitizer.cpp
===
--- clang/test/CodeGenCXX/lifetime-sanitizer.cpp
+++ clang/test/CodeGenCXX/lifetime-sanitizer.cpp
@@ -6,6 +6,9 @@
 // RUN: %clang -w -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions 
-O0 \
 // RUN: -fsanitize=memory %s | \
 // RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
+// RUN: %clang -w -target aarch64-linux-gnu -S -emit-llvm -o - -fno-exceptions 
-O0 \
+// RUN: -fsanitize=hwaddress %s | \
+// RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
 
 extern int bar(char *A, int n);
 
Index: clang/test/CodeGen/lifetime-sanitizer.c
===
--- clang/test/CodeGen/lifetime-sanitizer.c
+++ clang/test/CodeGen/lifetime-sanitizer.c
@@ -5,6 +5,9 @@
 // RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
 // RUN: -fsanitize=memory %s | \
 // RUN: FileCheck %s -check-prefix=LIFETIME
+// RUN: %clang -target aarch64-linux-gnu -S -emit-llvm -o - -O0 \
+// RUN: -fsanitize=hwaddress %s | \
+// RUN: FileCheck %s -check-prefix=LIFETIME
 
 extern int bar(char *A, int n);
 
Index: clang/lib/CodeGen/CodeGenFunction.cpp
===
--- clang/lib/CodeGen/CodeGenFunction.cpp
+++ clang/lib/CodeGen/CodeGenFunction.cpp
@@ -49,6 +49,7 @@
 
   // Sanitizers may use markers.
   if (CGOpts.SanitizeAddressUseAfterScope ||
+  LangOpts.Sanitize.has(SanitizerKind::HWAddress) ||
   LangOpts.Sanitize.has(SanitizerKind::Memory))
 return true;
 
Index: clang/lib/CodeGen/CGExpr.cpp
===
--- clang/lib/CodeGen/CGExpr.cpp
+++ clang/lib/CodeGen/CGExpr.cpp
@@ -521,6 +521,7 @@
   ConditionalEvaluation *OldConditional = nullptr;
   CGBuilderTy::InsertPoint OldIP;
   if (isInConditionalBranch() && !E->getType().isDestructedType() &&
+  !SanOpts.has(SanitizerKind::HWAddress) &&
   !SanOpts.has(SanitizerKind::Memory) &&
   !CGM.getCodeGenOpts().SanitizeAddressUseAfterScope) {
 OldConditional = OutermostConditional;


Index: clang/test/CodeGenCXX/lifetime-sanitizer.cpp
===
--- clang/test/CodeGenCXX/lifetime-sanitizer.cpp
+++ clang/test/CodeGenCXX/lifetime-sanitizer.cpp
@@ -6,6 +6,9 @@
 // RUN: %clang -w -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
 // RUN: -fsanitize=memory %s | \
 // RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
+// RUN: %clang -w -target aarch64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
+// RUN: -fsanitize=hwaddress %s | \
+// RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
 
 extern int bar(char *A, int n);
 
Index: clang/test/CodeGen/lifetime-sanitizer.c
===
--- clang/test/CodeGen/lifetime-sanitizer.c
+++ clang/test/CodeGen/lifetime-sanitizer.c
@@ -5,6 +5,9 @@
 // RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
 // RUN: -fsanitize=memory %s | \
 // RUN: FileCheck %s -check-prefix=LIFETIME
+// RUN: %clang -target aarch64-linux-gnu -S -emit-llvm -o - -O0 \
+// RUN: -fsanitize=hwaddress %s | \
+// RUN: FileCheck %s -check-prefix=LIFETIME
 
 extern int bar(char *A, int n);
 
Index: clang/lib/CodeGen/CodeGenFunction.cpp
===
--- clang/lib/CodeGen/CodeGenFunction.cpp
+++ clang/lib/CodeGen/CodeGenFunction.cpp
@@ -49,6 +49,7 @@
 
   // Sanitizers may use markers.
   if (CGOpts.SanitizeAddressUseAfterScope ||
+  LangOpts.Sanitize.has(SanitizerKind::HWAddress) ||
   LangOpts.Sanitize.has(SanitizerKind::Memory))
 return true;
 
Index: clang/lib/CodeGen/CGExpr.cpp
===
--- clang/lib/CodeGen/CGExpr.cpp
+++ clang/lib/CodeGen/CGExpr.cpp
@@ -521,6 +521,7 @@
   ConditionalEvaluation *OldConditional = nullptr;
   CGBuilderTy::InsertPoint OldIP;
   if (isInConditionalBranch() && !E->getType().isDestructedType() &&
+  !SanOpts.has(SanitizerKind::HWAddress) &&
   !SanOpts.has(SanitizerKind::Memory) &&
   !CGM.getCodeGenOpts().SanitizeAddressUseAfterScope) {
 OldConditional = OutermostConditional;
___
cfe-commits mailing list