[llvm] r363814 - [DFSan] Add UnaryOperator visitor to DataFlowSanitizer

Cameron McInally via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 08:11:41 PDT 2019


Author: mcinally
Date: Wed Jun 19 08:11:41 2019
New Revision: 363814

URL: http://llvm.org/viewvc/llvm-project?rev=363814&view=rev
Log:
[DFSan] Add UnaryOperator visitor to DataFlowSanitizer

Differential Revision: https://reviews.llvm.org/D62815

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
    llvm/trunk/test/Instrumentation/DataFlowSanitizer/arith.ll

Modified: llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp?rev=363814&r1=363813&r2=363814&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp Wed Jun 19 08:11:41 2019
@@ -437,6 +437,7 @@ public:
   }
 
   void visitOperandShadowInst(Instruction &I);
+  void visitUnaryOperator(UnaryOperator &UO);
   void visitBinaryOperator(BinaryOperator &BO);
   void visitCastInst(CastInst &CI);
   void visitCmpInst(CmpInst &CI);
@@ -1398,6 +1399,10 @@ void DFSanVisitor::visitStoreInst(StoreI
   DFSF.storeShadow(SI.getPointerOperand(), Size, Align, Shadow, &SI);
 }
 
+void DFSanVisitor::visitUnaryOperator(UnaryOperator &UO) {
+  visitOperandShadowInst(UO);
+}
+
 void DFSanVisitor::visitBinaryOperator(BinaryOperator &BO) {
   visitOperandShadowInst(BO);
 }

Modified: llvm/trunk/test/Instrumentation/DataFlowSanitizer/arith.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Instrumentation/DataFlowSanitizer/arith.ll?rev=363814&r1=363813&r2=363814&view=diff
==============================================================================
--- llvm/trunk/test/Instrumentation/DataFlowSanitizer/arith.ll (original)
+++ llvm/trunk/test/Instrumentation/DataFlowSanitizer/arith.ll Wed Jun 19 08:11:41 2019
@@ -62,3 +62,13 @@ define i8 @udiv(i8 %a, i8 %b) {
   %c = udiv i8 %a, %b
   ret i8 %c
 }
+
+define double @fneg(double %a) {
+  ; CHECK: @"dfs$fneg"
+  ; CHECK: load{{.*}}__dfsan_arg_tls
+  ; CHECK: fneg double
+  ; CHECK: store{{.*}}__dfsan_retval_tls
+  ; CHECK: ret double
+  %c = fneg double %a
+  ret double %c
+}




More information about the llvm-commits mailing list