[PATCH] D82213: [Remarks] Add callsite locations to inline remarks

2020-06-20 Thread David Li via Phabricator via cfe-commits
davidxl accepted this revision.
davidxl added a comment.
This revision is now accepted and ready to land.

lgtm




Comment at: llvm/lib/Analysis/InlineAdvisor.cpp:383
+   const Function , const InlineCost ,
+   bool ProfileGuidedInline, const char *PassName) {
   ORE.emit([&]() {

ProfileGuidedInline --> ForProfileContext 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82213



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


[PATCH] D81707: [PowerPC][Power10] Implement Vector Clear Left/Rightmost Bytes Builtins in LLVM/Clang

2020-06-20 Thread Amy Kwan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcc95635b1bf2: [PowerPC][Power10] Implement Vector Clear 
Left/Rightmost Bytes Builtins in… (authored by amyk).

Changed prior to commit:
  https://reviews.llvm.org/D81707?vs=270283=272281#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81707

Files:
  clang/include/clang/Basic/BuiltinsPPC.def
  clang/lib/Headers/altivec.h
  clang/test/CodeGen/builtins-ppc-p10vector.c
  llvm/include/llvm/IR/IntrinsicsPowerPC.td
  llvm/lib/Target/PowerPC/PPCInstrPrefix.td
  llvm/test/CodeGen/PowerPC/p10-string-ops.ll
  llvm/test/MC/Disassembler/PowerPC/p10insts.txt
  llvm/test/MC/PowerPC/p10.s

Index: llvm/test/MC/PowerPC/p10.s
===
--- llvm/test/MC/PowerPC/p10.s
+++ llvm/test/MC/PowerPC/p10.s
@@ -15,3 +15,9 @@
 # CHECK-BE: pextd 1, 2, 4 # encoding: [0x7c,0x41,0x21,0x78]
 # CHECK-LE: pextd 1, 2, 4 # encoding: [0x78,0x21,0x41,0x7c]
 pextd 1, 2, 4
+# CHECK-BE: vclrlb 1, 4, 3# encoding: [0x10,0x24,0x19,0x8d]
+# CHECK-LE: vclrlb 1, 4, 3# encoding: [0x8d,0x19,0x24,0x10]
+vclrlb 1, 4, 3
+# CHECK-BE: vclrrb 1, 4, 3# encoding: [0x10,0x24,0x19,0xcd]
+# CHECK-LE: vclrrb 1, 4, 3# encoding: [0xcd,0x19,0x24,0x10]
+vclrrb 1, 4, 3
Index: llvm/test/MC/Disassembler/PowerPC/p10insts.txt
===
--- llvm/test/MC/Disassembler/PowerPC/p10insts.txt
+++ llvm/test/MC/Disassembler/PowerPC/p10insts.txt
@@ -12,3 +12,9 @@
 
 # CHECK: pextd 1, 2, 4
 0x7c 0x41 0x21 0x78
+
+# CHECK: vclrlb 1, 4, 3
+0x10 0x24 0x19 0x8d
+
+# CHECK: vclrrb 1, 4, 3
+0x10 0x24 0x19 0xcd
Index: llvm/test/CodeGen/PowerPC/p10-string-ops.ll
===
--- /dev/null
+++ llvm/test/CodeGen/PowerPC/p10-string-ops.ll
@@ -0,0 +1,29 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
+; RUN:   -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
+; RUN:   FileCheck %s
+
+; These test cases aim to test the vector string isolate builtins on Power10.
+
+declare <16 x i8> @llvm.ppc.altivec.vclrlb(<16 x i8>, i32)
+declare <16 x i8> @llvm.ppc.altivec.vclrrb(<16 x i8>, i32)
+
+define <16 x i8> @test_vclrlb(<16 x i8> %a, i32 %n) {
+; CHECK-LABEL: test_vclrlb:
+; CHECK:   # %bb.0: # %entry
+; CHECK-NEXT:vclrlb v2, v2, r5
+; CHECK-NEXT:blr
+entry:
+  %tmp = tail call <16 x i8> @llvm.ppc.altivec.vclrlb(<16 x i8> %a, i32 %n)
+  ret <16 x i8> %tmp
+}
+
+define <16 x i8> @test_vclrrb(<16 x i8> %a, i32 %n) {
+; CHECK-LABEL: test_vclrrb:
+; CHECK:   # %bb.0: # %entry
+; CHECK-NEXT:vclrrb v2, v2, r5
+; CHECK-NEXT:blr
+entry:
+  %tmp = tail call <16 x i8> @llvm.ppc.altivec.vclrrb(<16 x i8> %a, i32 %n)
+  ret <16 x i8> %tmp
+}
Index: llvm/lib/Target/PowerPC/PPCInstrPrefix.td
===
--- llvm/lib/Target/PowerPC/PPCInstrPrefix.td
+++ llvm/lib/Target/PowerPC/PPCInstrPrefix.td
@@ -516,4 +516,12 @@
def PEXTD : XForm_6<31, 188, (outs g8rc:$rA), (ins g8rc:$rS, g8rc:$rB),
"pextd $rA, $rS, $rB", IIC_IntGeneral,
[(set i64:$rA, (int_ppc_pextd i64:$rS, i64:$rB))]>;
+   def VCLRLB : VXForm_1<397, (outs vrrc:$vD), (ins vrrc:$vA, gprc:$rB),
+ "vclrlb $vD, $vA, $rB", IIC_VecGeneral,
+ [(set v16i8:$vD,
+   (int_ppc_altivec_vclrlb v16i8:$vA, i32:$rB))]>;
+   def VCLRRB : VXForm_1<461, (outs vrrc:$vD), (ins vrrc:$vA, gprc:$rB),
+ "vclrrb $vD, $vA, $rB", IIC_VecGeneral,
+ [(set v16i8:$vD,
+   (int_ppc_altivec_vclrrb v16i8:$vA, i32:$rB))]>;
 }
Index: llvm/include/llvm/IR/IntrinsicsPowerPC.td
===
--- llvm/include/llvm/IR/IntrinsicsPowerPC.td
+++ llvm/include/llvm/IR/IntrinsicsPowerPC.td
@@ -417,6 +417,14 @@
   def int_ppc_altivec_vpextd : GCCBuiltin<"__builtin_altivec_vpextd">,
   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
 [IntrNoMem]>;
+
+   // P10 Vector Clear Bytes
+   def int_ppc_altivec_vclrlb :  GCCBuiltin<"__builtin_altivec_vclrlb">,
+   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty],
+ [IntrNoMem]>;
+   def int_ppc_altivec_vclrrb :  GCCBuiltin<"__builtin_altivec_vclrrb">,
+   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty],
+ [IntrNoMem]>;
 }
 
 // Vector average.
Index: 

[clang] cc95635 - [PowerPC][Power10] Implement Vector Clear Left/Rightmost Bytes Builtins in LLVM/Clang

2020-06-20 Thread Amy Kwan via cfe-commits

Author: Amy Kwan
Date: 2020-06-20T18:29:16-05:00
New Revision: cc95635b1bf28e626b4c2ac296b0a0ca22ab3c91

URL: 
https://github.com/llvm/llvm-project/commit/cc95635b1bf28e626b4c2ac296b0a0ca22ab3c91
DIFF: 
https://github.com/llvm/llvm-project/commit/cc95635b1bf28e626b4c2ac296b0a0ca22ab3c91.diff

LOG: [PowerPC][Power10] Implement Vector Clear Left/Rightmost Bytes Builtins in 
LLVM/Clang

This patch implements builtins for the following prototypes:
```
vector signed char vec_clrl (vector signed char a, unsigned int n);
vector unsigned char vec_clrl (vector unsigned char a, unsigned int n);
vector signed char vec_clrr (vector signed char a, unsigned int n);
vector signed char vec_clrr (vector unsigned char a, unsigned int n);
```

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

Added: 
llvm/test/CodeGen/PowerPC/p10-string-ops.ll

Modified: 
clang/include/clang/Basic/BuiltinsPPC.def
clang/lib/Headers/altivec.h
clang/test/CodeGen/builtins-ppc-p10vector.c
llvm/include/llvm/IR/IntrinsicsPowerPC.td
llvm/lib/Target/PowerPC/PPCInstrPrefix.td
llvm/test/MC/Disassembler/PowerPC/p10insts.txt
llvm/test/MC/PowerPC/p10.s

Removed: 




diff  --git a/clang/include/clang/Basic/BuiltinsPPC.def 
b/clang/include/clang/Basic/BuiltinsPPC.def
index 30077e2e8d03..238e56b6dfce 100644
--- a/clang/include/clang/Basic/BuiltinsPPC.def
+++ b/clang/include/clang/Basic/BuiltinsPPC.def
@@ -302,6 +302,10 @@ BUILTIN(__builtin_altivec_vrldnm, "V2ULLiV2ULLiV2ULLi", "")
 BUILTIN(__builtin_altivec_vpdepd, "V2ULLiV2ULLiV2ULLi", "")
 BUILTIN(__builtin_altivec_vpextd, "V2ULLiV2ULLiV2ULLi", "")
 
+// P10 Vector Clear Bytes built-ins.
+BUILTIN(__builtin_altivec_vclrlb, "V16cV16cUi", "")
+BUILTIN(__builtin_altivec_vclrrb, "V16cV16cUi", "")
+
 // VSX built-ins.
 
 BUILTIN(__builtin_vsx_lxvd2x, "V2divC*", "")

diff  --git a/clang/lib/Headers/altivec.h b/clang/lib/Headers/altivec.h
index 1e1e57cd1ffc..385828aceced 100644
--- a/clang/lib/Headers/altivec.h
+++ b/clang/lib/Headers/altivec.h
@@ -16776,6 +16776,46 @@ static __inline__ vector unsigned long long 
__ATTRS_o_ai
 vec_pext(vector unsigned long long __a, vector unsigned long long __b) {
   return __builtin_altivec_vpextd(__a, __b);
 }
+
+/* vec_clrl */
+
+static __inline__ vector signed char __ATTRS_o_ai
+vec_clrl(vector signed char __a, unsigned int __n) {
+#ifdef __LITTLE_ENDIAN__
+  return __builtin_altivec_vclrrb(__a, __n);
+#else
+  return __builtin_altivec_vclrlb( __a, __n);
+#endif
+}
+
+static __inline__ vector unsigned char __ATTRS_o_ai
+vec_clrl(vector unsigned char __a, unsigned int __n) {
+#ifdef __LITTLE_ENDIAN__
+  return __builtin_altivec_vclrrb((vector signed char)__a, __n);
+#else
+  return __builtin_altivec_vclrlb((vector signed char)__a, __n);
+#endif
+}
+
+/* vec_clrr */
+
+static __inline__ vector signed char __ATTRS_o_ai
+vec_clrr(vector signed char __a, unsigned int __n) {
+#ifdef __LITTLE_ENDIAN__
+  return __builtin_altivec_vclrlb(__a, __n);
+#else
+  return __builtin_altivec_vclrrb( __a, __n);
+#endif
+}
+
+static __inline__ vector unsigned char __ATTRS_o_ai
+vec_clrr(vector unsigned char __a, unsigned int __n) {
+#ifdef __LITTLE_ENDIAN__
+  return __builtin_altivec_vclrlb((vector signed char)__a, __n);
+#else
+  return __builtin_altivec_vclrrb((vector signed char)__a, __n);
+#endif
+}
 #endif /* __POWER10_VECTOR__ */
 
 #undef __ATTRS_o_ai

diff  --git a/clang/test/CodeGen/builtins-ppc-p10vector.c 
b/clang/test/CodeGen/builtins-ppc-p10vector.c
index 31c24f382f1e..829ef97435eb 100644
--- a/clang/test/CodeGen/builtins-ppc-p10vector.c
+++ b/clang/test/CodeGen/builtins-ppc-p10vector.c
@@ -5,7 +5,10 @@
 
 #include 
 
+vector signed char vsca;
+vector unsigned char vuca;
 vector unsigned long long vulla, vullb;
+unsigned int uia;
 
 vector unsigned long long test_vpdepd(void) {
   // CHECK: @llvm.ppc.altivec.vpdepd(<2 x i64>
@@ -18,3 +21,35 @@ vector unsigned long long test_vpextd(void) {
   // CHECK-NEXT: ret <2 x i64>
   return vec_pext(vulla, vullb);
 }
+
+vector signed char test_vec_vclrl_sc(void) {
+  // CHECK-BE: @llvm.ppc.altivec.vclrlb(<16 x i8>
+  // CHECK-BE-NEXT: ret <16 x i8>
+  // CHECK-LE: @llvm.ppc.altivec.vclrrb(<16 x i8>
+  // CHECK-LE-NEXT: ret <16 x i8>
+  return vec_clrl(vsca, uia);
+}
+
+vector unsigned char test_vec_clrl_uc(void) {
+  // CHECK-BE: @llvm.ppc.altivec.vclrlb(<16 x i8>
+  // CHECK-BE-NEXT: ret <16 x i8>
+  // CHECK-LE: @llvm.ppc.altivec.vclrrb(<16 x i8>
+  // CHECK-LE-NEXT: ret <16 x i8>
+  return vec_clrl(vuca, uia);
+}
+
+vector signed char test_vec_vclrr_sc(void) {
+  // CHECK-BE: @llvm.ppc.altivec.vclrrb(<16 x i8>
+  // CHECK-BE-NEXT: ret <16 x i8>
+  // CHECK-LE: @llvm.ppc.altivec.vclrlb(<16 x i8>
+  // CHECK-LE-NEXT: ret <16 x i8>
+  return vec_clrr(vsca, uia);
+}
+
+vector unsigned char test_vec_clrr_uc(void) {
+  // CHECK-BE: @llvm.ppc.altivec.vclrrb(<16 x i8>
+  // CHECK-BE-NEXT: ret <16 x i8>
+  // CHECK-LE: 

[PATCH] D82256: [analyzer] Enabling ctr in evalCall event

2020-06-20 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 272275.
vrnithinkumar marked an inline comment as done.
vrnithinkumar added a comment.

Addressing review comment adding miised new line


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82256

Files:
  clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp


Index: clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp
===
--- clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp
+++ clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp
@@ -30,4 +30,4 @@
 // CHECK-NEXT:  PostCall (operator new) [CXXAllocatorCall]
 // CHECK-NEXT:  PreCall (C::C) [CXXConstructorCall]
 // CHECK-NEXT:  EvalCall (C::C) {2} [CXXConstructorCall]
-// CHECK-NEXT:  PostCall (C::C) [CXXConstructorCall]
\ No newline at end of file
+// CHECK-NEXT:  PostCall (C::C) [CXXConstructorCall]


Index: clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp
===
--- clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp
+++ clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp
@@ -30,4 +30,4 @@
 // CHECK-NEXT:  PostCall (operator new) [CXXAllocatorCall]
 // CHECK-NEXT:  PreCall (C::C) [CXXConstructorCall]
 // CHECK-NEXT:  EvalCall (C::C) {2} [CXXConstructorCall]
-// CHECK-NEXT:  PostCall (C::C) [CXXConstructorCall]
\ No newline at end of file
+// CHECK-NEXT:  PostCall (C::C) [CXXConstructorCall]
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82256: [analyzer] Enabling ctr in evalCall event

2020-06-20 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 272276.
vrnithinkumar marked an inline comment as done.
vrnithinkumar added a comment.

Fixing wrongly deleted the old commit via arc


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82256

Files:
  clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
  clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
  clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
  clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp
  clang/lib/StaticAnalyzer/Core/CallEvent.cpp
  clang/lib/StaticAnalyzer/Core/CheckerManager.cpp
  clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
  clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
  clang/test/Analysis/analyzer-config.c
  clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp
  clang/test/Analysis/new-ctor-conservative.cpp

Index: clang/test/Analysis/new-ctor-conservative.cpp
===
--- clang/test/Analysis/new-ctor-conservative.cpp
+++ clang/test/Analysis/new-ctor-conservative.cpp
@@ -27,6 +27,7 @@
   S *s = new S[10];
   // FIXME: Should be true once we inline array constructors.
   clang_analyzer_eval(s[0].x == 1); // expected-warning{{UNKNOWN}}
+  clang_analyzer_eval(s[1].x == 1); // expected-warning{{UNKNOWN}}
 }
 
 struct NullS {
Index: clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp
===
--- /dev/null
+++ clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp
@@ -0,0 +1,33 @@
+// RUN: %clang_analyze_cc1 %s \
+// RUN:  -analyzer-checker=debug.AnalysisOrder \
+// RUN:  -analyzer-config debug.AnalysisOrder:EvalCall=true \
+// RUN:  -analyzer-config debug.AnalysisOrder:PreCall=true \
+// RUN:  -analyzer-config debug.AnalysisOrder:PostCall=true \
+// RUN:  2>&1 | FileCheck %s
+
+// This test ensures that eval::Call event will be triggered for constructors.
+
+class C {
+public:
+  C(){};
+  C(int x){};
+  C(int x, int y){};
+};
+
+void foo() {
+  C C0;
+  C C1(42);
+  C *C2 = new C{2, 3};
+}
+
+// CHECK:  PreCall (C::C) [CXXConstructorCall]
+// CHECK-NEXT:  EvalCall (C::C) {0} [CXXConstructorCall]
+// CHECK-NEXT:  PostCall (C::C) [CXXConstructorCall]
+// CHECK-NEXT:  PreCall (C::C) [CXXConstructorCall]
+// CHECK-NEXT:  EvalCall (C::C) {1} [CXXConstructorCall]
+// CHECK-NEXT:  PostCall (C::C) [CXXConstructorCall]
+// CHECK-NEXT:  PreCall (operator new) [CXXAllocatorCall]
+// CHECK-NEXT:  PostCall (operator new) [CXXAllocatorCall]
+// CHECK-NEXT:  PreCall (C::C) [CXXConstructorCall]
+// CHECK-NEXT:  EvalCall (C::C) {2} [CXXConstructorCall]
+// CHECK-NEXT:  PostCall (C::C) [CXXConstructorCall]
Index: clang/test/Analysis/analyzer-config.c
===
--- clang/test/Analysis/analyzer-config.c
+++ clang/test/Analysis/analyzer-config.c
@@ -50,6 +50,7 @@
 // CHECK-NEXT: debug.AnalysisOrder:Bind = false
 // CHECK-NEXT: debug.AnalysisOrder:EndAnalysis = false
 // CHECK-NEXT: debug.AnalysisOrder:EndFunction = false
+// CHECK-NEXT: debug.AnalysisOrder:EvalCall = false
 // CHECK-NEXT: debug.AnalysisOrder:LiveSymbols = false
 // CHECK-NEXT: debug.AnalysisOrder:NewAllocator = false
 // CHECK-NEXT: debug.AnalysisOrder:PointerEscape = false
Index: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
===
--- clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
+++ clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
@@ -583,8 +583,9 @@
   // to see if the can evaluate the function call, and get a callback at
   // defaultEvalCall if all of them fail.
   ExplodedNodeSet dstCallEvaluated;
+  EvalCallOptions CallOpts;
   getCheckerManager().runCheckersForEvalCall(dstCallEvaluated, dstPreVisit,
- Call, *this);
+ Call, *this, CallOpts);
 
   // If there were other constructors called for object-type arguments
   // of this call, clean them up.
@@ -717,7 +718,7 @@
 ExprEngine::CallInlinePolicy
 ExprEngine::mayInlineCallKind(const CallEvent , const ExplodedNode *Pred,
   AnalyzerOptions ,
-  const ExprEngine::EvalCallOptions ) {
+  const EvalCallOptions ) {
   const LocationContext *CurLC = Pred->getLocationContext();
   const StackFrameContext *CallerSFC = CurLC->getStackFrame();
   switch (Call.getKind()) {
Index: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
===
--- clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
+++ clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
@@ -615,7 +615,8 @@
   } else {
 for (ExplodedNodeSet::iterator I = DstPreCall.begin(), E = DstPreCall.end();
  I != E; ++I)
-  defaultEvalCall(Bldr, *I, *Call, 

[PATCH] D82256: [analyzer] Enabling ctr in evalCall event

2020-06-20 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 2 inline comments as done.
vrnithinkumar added inline comments.



Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:586
   ExplodedNodeSet dstCallEvaluated;
+  EvalCallOptions CallOpts;
   getCheckerManager().runCheckersForEvalCall(dstCallEvaluated, dstPreVisit,

NoQ wrote:
> If you want you can make it an optional argument of 
> `runCheckersForEvalCall()`, like it's done in `defaultEvalCall()`.
I tried to make it as default argument for `runCheckersForEvalCall()` but 
`struct EvalCallOptions` is forward declared in `CheckerManager.h`.



Comment at: clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp:34
+// CHECK-NEXT:  PostCall (C::C) [CXXConstructorCall]
\ No newline at end of file


NoQ wrote:
> No NEwLiNE aT EnD Of FiLE
added new line


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82256



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


[clang] 0861889 - [clang/llvm] As part of using inclusive language within

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-20T16:03:58-07:00
New Revision: 0861889be103bf7bcf013768e913695ed94b50bf

URL: 
https://github.com/llvm/llvm-project/commit/0861889be103bf7bcf013768e913695ed94b50bf
DIFF: 
https://github.com/llvm/llvm-project/commit/0861889be103bf7bcf013768e913695ed94b50bf.diff

LOG: [clang/llvm] As part of using inclusive language within
the llvm project, migrate away from the use of blacklist and whitelist.

Added: 


Modified: 
clang/lib/AST/Decl.cpp
clang/lib/CodeGen/CGClass.cpp
clang/lib/Format/UnwrappedLineParser.cpp
llvm/unittests/Support/SpecialCaseListTest.cpp
llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h

Removed: 




diff  --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 23547933b88b..1676f319394d 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -4522,11 +4522,11 @@ bool RecordDecl::mayInsertExtraPadding(bool EmitRemark) 
const {
 ReasonToReject = 5;  // is standard layout.
   else if (Blacklist.isBlacklistedLocation(EnabledAsanMask, getLocation(),
"field-padding"))
-ReasonToReject = 6;  // is in a blacklisted file.
+ReasonToReject = 6;  // is in an excluded file.
   else if (Blacklist.isBlacklistedType(EnabledAsanMask,
getQualifiedNameAsString(),
"field-padding"))
-ReasonToReject = 7;  // is blacklisted.
+ReasonToReject = 7;  // The type is excluded.
 
   if (EmitRemark) {
 if (ReasonToReject >= 0)

diff  --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp
index 1d78b3fccb13..4d143e3e1bdf 100644
--- a/clang/lib/CodeGen/CGClass.cpp
+++ b/clang/lib/CodeGen/CGClass.cpp
@@ -752,7 +752,7 @@ bool CodeGenFunction::IsConstructorDelegationValid(
 //parameters
 //  - etc.
 // If we ever add any of the above cases, remember that:
-//  - function-try-blocks will always blacklist this optimization
+//  - function-try-blocks will always exclude this optimization
 //  - we need to perform the constructor prologue and cleanup in
 //EmitConstructorBody.
 

diff  --git a/clang/lib/Format/UnwrappedLineParser.cpp 
b/clang/lib/Format/UnwrappedLineParser.cpp
index cf9673d51617..577b60bc51e2 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -900,7 +900,7 @@ void UnwrappedLineParser::parsePPUnknown() {
   addUnwrappedLine();
 }
 
-// Here we blacklist certain tokens that are not usually the first token in an
+// Here we exclude certain tokens that are not usually the first token in an
 // unwrapped line. This is used in attempt to distinguish macro calls without
 // trailing semicolons from other constructs split to several lines.
 static bool tokenCanStartNewLine(const FormatToken ) {

diff  --git a/llvm/unittests/Support/SpecialCaseListTest.cpp 
b/llvm/unittests/Support/SpecialCaseListTest.cpp
index 4be143d8f41f..bee639df6a66 100644
--- a/llvm/unittests/Support/SpecialCaseListTest.cpp
+++ b/llvm/unittests/Support/SpecialCaseListTest.cpp
@@ -172,7 +172,7 @@ TEST_F(SpecialCaseListTest, EmptySpecialCaseList) {
   EXPECT_FALSE(SCL->inSection("", "foo", "bar"));
 }
 
-TEST_F(SpecialCaseListTest, MultipleBlacklists) {
+TEST_F(SpecialCaseListTest, MultipleExclusions) {
   std::vector Files;
   Files.push_back(makeSpecialCaseListFile("src:bar\n"
   "src:*foo*\n"

diff  --git 
a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h 
b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
index 86e75a32ef4e..17410d37f9ce 100644
--- a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
+++ b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
@@ -345,7 +345,7 @@
 #if GTEST_LANG_CXX11 && \
 (!defined(__GLIBCXX__) || ( \
 __GLIBCXX__ >= 20110325ul &&  /* GCC >= 4.6.0 */ \
-/* Blacklist of patch releases of older branches: */ \
+/* Exclude patch releases of older branches: */ \
 __GLIBCXX__ != 20110416ul &&  /* GCC 4.4.6 */ \
 __GLIBCXX__ != 20120313ul &&  /* GCC 4.4.7 */ \
 __GLIBCXX__ != 20110428ul &&  /* GCC 4.5.3 */ \



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


[clang-tools-extra] da6332f - [clang-tidy] As part of using inclusive language within

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-20T15:20:11-07:00
New Revision: da6332f5f9f15f7b182f27bc9b8edbf709b48093

URL: 
https://github.com/llvm/llvm-project/commit/da6332f5f9f15f7b182f27bc9b8edbf709b48093
DIFF: 
https://github.com/llvm/llvm-project/commit/da6332f5f9f15f7b182f27bc9b8edbf709b48093.diff

LOG: [clang-tidy] As part of using inclusive language within
the llvm project, migrate away from the use of blacklist and whitelist.

Added: 


Modified: 
clang-tools-extra/clang-tidy/google/NonConstReferences.cpp
clang-tools-extra/clang-tidy/google/NonConstReferences.h
clang-tools-extra/docs/clang-tidy/checks/google-runtime-references.rst
clang-tools-extra/test/clang-tidy/checkers/google-runtime-references.cpp

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/google/NonConstReferences.cpp 
b/clang-tools-extra/clang-tidy/google/NonConstReferences.cpp
index b7da1c5940c5..e0fb614dfe8b 100644
--- a/clang-tools-extra/clang-tidy/google/NonConstReferences.cpp
+++ b/clang-tools-extra/clang-tidy/google/NonConstReferences.cpp
@@ -22,12 +22,12 @@ namespace runtime {
 NonConstReferences::NonConstReferences(StringRef Name,
ClangTidyContext *Context)
 : ClangTidyCheck(Name, Context),
-  WhiteListTypes(
-  utils::options::parseStringList(Options.get("WhiteListTypes", ""))) 
{}
+  IncludedTypes(
+  utils::options::parseStringList(Options.get("IncludedTypes", ""))) {}
 
 void NonConstReferences::storeOptions(ClangTidyOptions::OptionMap ) {
-  Options.store(Opts, "WhiteListTypes",
-utils::options::serializeStringList(WhiteListTypes));
+  Options.store(Opts, "IncludedTypes",
+utils::options::serializeStringList(IncludedTypes));
 }
 
 void NonConstReferences::registerMatchers(MatchFinder *Finder) {
@@ -67,12 +67,12 @@ void NonConstReferences::check(const 
MatchFinder::MatchResult ) {
 
   auto ReferencedType = *Result.Nodes.getNodeAs("referenced_type");
 
-  if (std::find_if(WhiteListTypes.begin(), WhiteListTypes.end(),
-   [&](llvm::StringRef WhiteListType) {
+  if (std::find_if(IncludedTypes.begin(), IncludedTypes.end(),
+   [&](llvm::StringRef ExplicitType) {
  return ReferencedType.getCanonicalType().getAsString(
 Result.Context->getPrintingPolicy()) ==
-WhiteListType;
-   }) != WhiteListTypes.end())
+ExplicitType;
+   }) != IncludedTypes.end())
 return;
 
   // Don't warn on function references, they shouldn't be constant.

diff  --git a/clang-tools-extra/clang-tidy/google/NonConstReferences.h 
b/clang-tools-extra/clang-tidy/google/NonConstReferences.h
index a8499a1982b1..ad7d4e4b1bca 100644
--- a/clang-tools-extra/clang-tidy/google/NonConstReferences.h
+++ b/clang-tools-extra/clang-tidy/google/NonConstReferences.h
@@ -30,7 +30,7 @@ class NonConstReferences : public ClangTidyCheck {
   void storeOptions(ClangTidyOptions::OptionMap ) override;
 
 private:
-  const std::vector WhiteListTypes;
+  const std::vector IncludedTypes;
 };
 
 } // namespace runtime

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/google-runtime-references.rst 
b/clang-tools-extra/docs/clang-tidy/checks/google-runtime-references.rst
index a210ccc1fb0b..52de1f108738 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/google-runtime-references.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/google-runtime-references.rst
@@ -12,6 +12,6 @@ 
https://google.github.io/styleguide/cppguide.html#Reference_Arguments
 Options
 ---
 
-.. option:: WhiteListTypes
+.. option:: IncludedTypes
 
-   A semicolon-separated list of names of whitelist types. Default is empty.
+   A semicolon-separated list of names of types to explicitly include. Default 
is empty.

diff  --git 
a/clang-tools-extra/test/clang-tidy/checkers/google-runtime-references.cpp 
b/clang-tools-extra/test/clang-tidy/checkers/google-runtime-references.cpp
index 1ebbbe3fc86c..e70ec3aeddf0 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/google-runtime-references.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/google-runtime-references.cpp
@@ -1,7 +1,7 @@
 // RUN: %check_clang_tidy %s google-runtime-references %t -- \
 // RUN:   -config="{CheckOptions: \
-// RUN: [{key: google-runtime-references.WhiteListTypes, \
-// RUN:   value: 'whitelist::A; whitelist::B'}]}"
+// RUN: [{key: google-runtime-references.IncludedTypes, \
+// RUN:   value: 'included::A; included::B'}]}"
 
 int a;
 int  = a;
@@ -141,14 +141,14 @@ A& operator|=(A& a, const A& b) { return a; }
 A& operator^=(A& a, const A& b) { return a; }
 A& operator&=(A& a, const A& b) { return a; }
 
-namespace whitelist {
+namespace included {
 class A {};
 class B {};
 void f7(A &);
 void f8(B 

[clang-tools-extra] ef455a5 - Update comment to be more clear.

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-20T14:44:41-07:00
New Revision: ef455a55bcf2cfea04a99c361b182ad18b7f03f1

URL: 
https://github.com/llvm/llvm-project/commit/ef455a55bcf2cfea04a99c361b182ad18b7f03f1
DIFF: 
https://github.com/llvm/llvm-project/commit/ef455a55bcf2cfea04a99c361b182ad18b7f03f1.diff

LOG: Update comment to be more clear.

Added: 


Modified: 
clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp 
b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
index 0a3861e79a3d..67f281b3ed1f 100644
--- a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
@@ -712,7 +712,7 @@ bool 
ForLoopIndexUseVisitor::TraverseArraySubscriptExpr(ArraySubscriptExpr *E) {
 /// If we encounter a reference to IndexVar in an unpruned branch of the
 /// traversal, mark this loop as unconvertible.
 ///
-/// This implements inclusions for convertible loops: any usages of IndexVar
+/// This determines the set of convertible loops: any usages of IndexVar
 /// not explicitly considered convertible by this traversal will be caught by
 /// this function.
 ///



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


[PATCH] D82259: Deprecate error prone temporary directory APIs

2020-06-20 Thread Chris Lattner via Phabricator via cfe-commits
lattner added a comment.

Hi Dave,

This is doing two things - changing the behavior of clang (where it stores its 
module cache) and deprecating an API.  I'd recommend we start by focusing on 
whether the first part is the right thing to do, and just remove the API if 
this is the only client of it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82259



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


[PATCH] D82213: [Remarks] Add callsite locations to inline remarks

2020-06-20 Thread Wenlei He via Phabricator via cfe-commits
wenlei marked an inline comment as done.
wenlei added inline comments.



Comment at: llvm/lib/Analysis/InlineAdvisor.cpp:392
+if (ProfileGuidedInline)
+  Remark << " by profile guided inliner";
+Remark << " with " << IC;

davidxl wrote:
> Perhaps reword it to " to match profiling context" ..
Sounds good, updated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82213



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


[PATCH] D82213: [Remarks] Add callsite locations to inline remarks

2020-06-20 Thread Wenlei He via Phabricator via cfe-commits
wenlei updated this revision to Diff 272263.
wenlei added a comment.

Update remark message.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82213

Files:
  clang/test/Frontend/optimization-remark-with-hotness-new-pm.c
  clang/test/Frontend/optimization-remark-with-hotness.c
  llvm/include/llvm/Analysis/InlineAdvisor.h
  llvm/lib/Analysis/InlineAdvisor.cpp
  llvm/lib/Transforms/IPO/SampleProfile.cpp
  llvm/test/Transforms/Inline/optimization-remarks-passed-yaml.ll
  llvm/test/Transforms/SampleProfile/Inputs/remarks.prof
  llvm/test/Transforms/SampleProfile/remarks.ll

Index: llvm/test/Transforms/SampleProfile/remarks.ll
===
--- llvm/test/Transforms/SampleProfile/remarks.ll
+++ llvm/test/Transforms/SampleProfile/remarks.ll
@@ -21,7 +21,8 @@
 
 ; We are expecting foo() to be inlined in main() (almost all the cycles are
 ; spent inside foo).
-; CHECK: remark: remarks.cc:13:21: inlined callee '_Z3foov' into 'main'
+; CHECK: remark: remarks.cc:13:21: _Z3foov inlined into main to match profiling context with (cost=130, threshold=225) at callsite main:0
+; CHECK: remark: remarks.cc:9:19: rand inlined into main to match profiling context with (cost=always): always inline attribute at callsite _Z3foov:6 @ main:0
 
 ; The back edge for the loop is the hottest edge in the loop subgraph.
 ; CHECK: remark: remarks.cc:6:9: most popular destination for conditional branches at remarks.cc:5:3
@@ -32,18 +33,51 @@
 ; Checking to see if YAML file is generated and contains remarks
 ;YAML:   --- !Passed
 ;YAML-NEXT:  Pass:sample-profile-inline
-;YAML-NEXT:  Name:InlineSuccess
+;YAML-NEXT:  Name:Inlined
 ;YAML-NEXT:  DebugLoc:{ File: remarks.cc, Line: 13, Column: 21 }
 ;YAML-NEXT:  Function:main
 ;YAML-NEXT:  Args:
-;YAML-NEXT:- String:  'inlined callee '''
 ;YAML-NEXT:- Callee:  _Z3foov
 ;YAML-NEXT:  DebugLoc:{ File: remarks.cc, Line: 3, Column: 0 }
-;YAML-NEXT:- String:  ''' into '''
+;YAML-NEXT:- String:  ' inlined into '
 ;YAML-NEXT:- Caller:  main
 ;YAML-NEXT:DebugLoc:{ File: remarks.cc, Line: 13, Column: 0 }
-;YAML-NEXT:- String:  
+;YAML-NEXT:- String:  ' to match profiling context'
+;YAML-NEXT:- String:  ' with '
+;YAML-NEXT:- String:  '(cost='
+;YAML-NEXT:- Cost:'130'
+;YAML-NEXT:- String:  ', threshold='
+;YAML-NEXT:- Threshold:   '225'
+;YAML-NEXT:- String:  ')'
+;YAML-NEXT:- String:  ' at callsite '
+;YAML-NEXT:- String:  main
+;YAML-NEXT:- String:  ':'
+;YAML-NEXT:- Line:'0'
 ;YAML-NEXT:  ...
+;YAML:   --- !Passed
+;YAML-NEXT:  Pass:sample-profile-inline
+;YAML-NEXT:  Name:AlwaysInline
+;YAML-NEXT:  DebugLoc:{ File: remarks.cc, Line: 9, Column: 19 }
+;YAML-NEXT:  Function:main
+;YAML-NEXT:  Args:
+;YAML-NEXT:- Callee:  rand
+;YAML-NEXT:  DebugLoc:{ File: remarks.cc, Line: 90, Column: 0 }
+;YAML-NEXT:- String:  ' inlined into '
+;YAML-NEXT:- Caller:  main
+;YAML-NEXT:  DebugLoc:{ File: remarks.cc, Line: 13, Column: 0 }
+;YAML-NEXT:- String:  ' to match profiling context'
+;YAML-NEXT:- String:  ' with '
+;YAML-NEXT:- String:  '(cost=always)'
+;YAML-NEXT:- String:  ': '
+;YAML-NEXT:- Reason:  always inline attribute
+;YAML-NEXT:- String:  ' at callsite '
+;YAML-NEXT:- String:  _Z3foov
+;YAML-NEXT:- String:  ':'
+;YAML-NEXT:- Line:'6'
+;YAML-NEXT:- String:  ' @ '
+;YAML-NEXT:- String:  main
+;YAML-NEXT:- String:  ':'
+;YAML-NEXT:- Line:'0'
 ;YAML:  --- !Analysis
 ;YAML-NEXT:  Pass:sample-profile
 ;YAML-NEXT:  Name:AppliedSamples
@@ -139,7 +173,9 @@
 declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
 
 ; Function Attrs: nounwind
-declare i32 @rand() #3
+define i32 @rand() #3 !dbg !59 {
+  ret i32 1
+}
 
 ; Function Attrs: nounwind argmemonly
 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
@@ -158,7 +194,7 @@
 attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" "use-sample-profile" }
 attributes #1 = { nounwind argmemonly }
 attributes #2 = { nounwind readnone }
-attributes #3 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" 

[PATCH] D82256: [analyzer] Enabling ctr in evalCall event

2020-06-20 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

Fantastic, thank you!




Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:586
   ExplodedNodeSet dstCallEvaluated;
+  EvalCallOptions CallOpts;
   getCheckerManager().runCheckersForEvalCall(dstCallEvaluated, dstPreVisit,

If you want you can make it an optional argument of `runCheckersForEvalCall()`, 
like it's done in `defaultEvalCall()`.



Comment at: clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp:34
+// CHECK-NEXT:  PostCall (C::C) [CXXConstructorCall]
\ No newline at end of file


No NEwLiNE aT EnD Of FiLE



Comment at: clang/test/Analysis/new-ctor-conservative.cpp:30
   clang_analyzer_eval(s[0].x == 1); // expected-warning{{UNKNOWN}}
+  clang_analyzer_eval(s[1].x == 1); // expected-warning{{UNKNOWN}}
 }

Thx!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82256



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


[PATCH] D82213: [Remarks] Add callsite locations to inline remarks

2020-06-20 Thread David Li via Phabricator via cfe-commits
davidxl added inline comments.



Comment at: llvm/lib/Analysis/InlineAdvisor.cpp:392
+if (ProfileGuidedInline)
+  Remark << " by profile guided inliner";
+Remark << " with " << IC;

Perhaps reword it to " to match profiling context" ..


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82213



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


[PATCH] D82259: Deprecate error prone temporary directory APIs

2020-06-20 Thread David Zarzycki via Phabricator via cfe-commits
davezarzycki created this revision.
davezarzycki added reviewers: compnerd, aprantl, jakehehrlich, espindola, 
respindola, ilya-biryukov, pcc, sammccall.
davezarzycki added a project: LLVM.
Herald added subscribers: cfe-commits, hiraditya.
Herald added a project: clang.

Naive usage of shared temporary directories in Unix is a classic security 
problem. Let's deprecate two APIs that enable unsafe code and encourage people 
to use `createUniqueFile` or `createUniqueDirectory` instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82259

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  llvm/include/llvm/Support/FileSystem.h
  llvm/include/llvm/Support/Path.h
  llvm/lib/Support/Path.cpp

Index: llvm/lib/Support/Path.cpp
===
--- llvm/lib/Support/Path.cpp
+++ llvm/lib/Support/Path.cpp
@@ -164,6 +164,41 @@
   FS_Name
 };
 
+// Avoid a deprecation warning by moving the createUniquePath body here.
+static void _createUniquePath(const Twine , SmallVectorImpl ,
+  bool MakeAbsolute) {
+  SmallString<128> ModelStorage;
+  Model.toVector(ModelStorage);
+
+  if (MakeAbsolute) {
+// Make model absolute by prepending a temp directory if it's not already.
+if (!sys::path::is_absolute(Twine(ModelStorage))) {
+  SmallString<128> TDir;
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+  sys::path::system_temp_directory(true, TDir);
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+  sys::path::append(TDir, Twine(ModelStorage));
+  ModelStorage.swap(TDir);
+}
+  }
+
+  ResultPath = ModelStorage;
+  ResultPath.push_back(0);
+  ResultPath.pop_back();
+
+  // Replace '%' with random chars.
+  for (unsigned i = 0, e = ModelStorage.size(); i != e; ++i) {
+if (ModelStorage[i] == '%')
+  ResultPath[i] = "0123456789abcdef"[sys::Process::GetRandomNumber() & 15];
+  }
+}
+
+
 static std::error_code
 createUniqueEntity(const Twine , int ,
SmallVectorImpl , bool MakeAbsolute,
@@ -176,7 +211,7 @@
   // Checking which is racy, so we try a number of times, then give up.
   std::error_code EC;
   for (int Retries = 128; Retries > 0; --Retries) {
-sys::fs::createUniquePath(Model, ResultPath, MakeAbsolute);
+_createUniquePath(Model, ResultPath, MakeAbsolute);
 // Try to open + create the file.
 switch (Type) {
 case FS_File: {
@@ -777,29 +812,8 @@
 }
 
 void createUniquePath(const Twine , SmallVectorImpl ,
-  bool MakeAbsolute) {
-  SmallString<128> ModelStorage;
-  Model.toVector(ModelStorage);
-
-  if (MakeAbsolute) {
-// Make model absolute by prepending a temp directory if it's not already.
-if (!sys::path::is_absolute(Twine(ModelStorage))) {
-  SmallString<128> TDir;
-  sys::path::system_temp_directory(true, TDir);
-  sys::path::append(TDir, Twine(ModelStorage));
-  ModelStorage.swap(TDir);
-}
-  }
-
-  ResultPath = ModelStorage;
-  ResultPath.push_back(0);
-  ResultPath.pop_back();
-
-  // Replace '%' with random chars.
-  for (unsigned i = 0, e = ModelStorage.size(); i != e; ++i) {
-if (ModelStorage[i] == '%')
-  ResultPath[i] = "0123456789abcdef"[sys::Process::GetRandomNumber() & 15];
-  }
+  bool MakeAbsolute) {
+  return _createUniquePath(Model, ResultPath, MakeAbsolute);
 }
 
 std::error_code createUniqueFile(const Twine , int ,
Index: llvm/include/llvm/Support/Path.h
===
--- llvm/include/llvm/Support/Path.h
+++ llvm/include/llvm/Support/Path.h
@@ -363,7 +363,10 @@
 /// (e.g., TEMP on Windows, TMPDIR on *nix) to specify a temporary directory.
 ///
 /// @param result Holds the resulting path name.
-void system_temp_directory(bool erasedOnReboot, SmallVectorImpl );
+LLVM_ATTRIBUTE_DEPRECATED(
+void system_temp_directory(bool erasedOnReboot, SmallVectorImpl ),
+  "Only meant for debugging due to trivial security problems"
+);
 
 /// Get the user's home directory.
 ///
Index: llvm/include/llvm/Support/FileSystem.h
===
--- llvm/include/llvm/Support/FileSystem.h
+++ llvm/include/llvm/Support/FileSystem.h
@@ -800,8 +800,11 @@
 /// @param Model Name to base unique path off of.
 /// @param ResultPath Set to the file's path.
 /// @param MakeAbsolute Whether to use the system temp directory.
-void createUniquePath(const Twine , SmallVectorImpl ,
-  bool MakeAbsolute);
+LLVM_ATTRIBUTE_DEPRECATED(
+  void createUniquePath(const Twine , SmallVectorImpl ,
+bool MakeAbsolute),
+  "Use createUniqueFile() or createUniqueDirectory()"
+);
 
 /// Create a uniquely named file.
 ///
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ 

[clang] 10563e1 - [Analysis/Transforms/Sanitizers] As part of using inclusive language

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-20T00:42:26-07:00
New Revision: 10563e16aa2c432a883695ddd714da68751bbd77

URL: 
https://github.com/llvm/llvm-project/commit/10563e16aa2c432a883695ddd714da68751bbd77
DIFF: 
https://github.com/llvm/llvm-project/commit/10563e16aa2c432a883695ddd714da68751bbd77.diff

LOG: [Analysis/Transforms/Sanitizers] As part of using inclusive language
within the llvm project, migrate away from the use of blacklist and
whitelist.

Added: 


Modified: 
clang/lib/CodeGen/SanitizerMetadata.cpp
clang/lib/CodeGen/SanitizerMetadata.h
llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
llvm/lib/Analysis/InlineCost.cpp
llvm/lib/Analysis/ObjCARCInstKind.cpp
llvm/lib/Transforms/IPO/GlobalOpt.cpp
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/lib/Transforms/Scalar/LoopRerollPass.cpp
llvm/lib/Transforms/Scalar/NaryReassociate.cpp
llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/SanitizerMetadata.cpp 
b/clang/lib/CodeGen/SanitizerMetadata.cpp
index 86269b5513f3..cdf83370c41f 100644
--- a/clang/lib/CodeGen/SanitizerMetadata.cpp
+++ b/clang/lib/CodeGen/SanitizerMetadata.cpp
@@ -31,16 +31,16 @@ static bool isAsanHwasanOrMemTag(const SanitizerSet& SS) {
 void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
SourceLocation Loc, StringRef Name,
QualType Ty, bool IsDynInit,
-   bool IsBlacklisted) {
+   bool IsExcluded) {
   if (!isAsanHwasanOrMemTag(CGM.getLangOpts().Sanitize))
 return;
   IsDynInit &= !CGM.isInSanitizerBlacklist(GV, Loc, Ty, "init");
-  IsBlacklisted |= CGM.isInSanitizerBlacklist(GV, Loc, Ty);
+  IsExcluded |= CGM.isInSanitizerBlacklist(GV, Loc, Ty);
 
   llvm::Metadata *LocDescr = nullptr;
   llvm::Metadata *GlobalName = nullptr;
   llvm::LLVMContext  = CGM.getLLVMContext();
-  if (!IsBlacklisted) {
+  if (!IsExcluded) {
 // Don't generate source location and global name if it is blacklisted -
 // it won't be instrumented anyway.
 LocDescr = getLocationMetadata(Loc);
@@ -53,7 +53,7 @@ void 
SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
   llvm::ConstantAsMetadata::get(
   llvm::ConstantInt::get(llvm::Type::getInt1Ty(VMContext), IsDynInit)),
   llvm::ConstantAsMetadata::get(llvm::ConstantInt::get(
-  llvm::Type::getInt1Ty(VMContext), IsBlacklisted))};
+  llvm::Type::getInt1Ty(VMContext), IsExcluded))};
 
   llvm::MDNode *ThisGlobal = llvm::MDNode::get(VMContext, GlobalMetadata);
   llvm::NamedMDNode *AsanGlobals =
@@ -69,12 +69,12 @@ void 
SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
   llvm::raw_string_ostream OS(QualName);
   D.printQualifiedName(OS);
 
-  bool IsBlacklisted = false;
+  bool IsExcluded = false;
   for (auto Attr : D.specific_attrs())
 if (Attr->getMask() & SanitizerKind::Address)
-  IsBlacklisted = true;
+  IsExcluded = true;
   reportGlobalToASan(GV, D.getLocation(), OS.str(), D.getType(), IsDynInit,
- IsBlacklisted);
+ IsExcluded);
 }
 
 void SanitizerMetadata::disableSanitizerForGlobal(llvm::GlobalVariable *GV) {

diff  --git a/clang/lib/CodeGen/SanitizerMetadata.h 
b/clang/lib/CodeGen/SanitizerMetadata.h
index 7ffac4360d9c..440a54590acc 100644
--- a/clang/lib/CodeGen/SanitizerMetadata.h
+++ b/clang/lib/CodeGen/SanitizerMetadata.h
@@ -40,7 +40,7 @@ class SanitizerMetadata {
   bool IsDynInit = false);
   void reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc,
   StringRef Name, QualType Ty, bool IsDynInit = false,
-  bool IsBlacklisted = false);
+  bool IsExcluded = false);
   void disableSanitizerForGlobal(llvm::GlobalVariable *GV);
   void disableSanitizerForInstruction(llvm::Instruction *I);
 private:

diff  --git a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h 
b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
index 40007a9b8c53..fea6064042ae 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
@@ -39,7 +39,7 @@ class GlobalsMetadata {
 LocationMetadata SourceLoc;
 StringRef Name;
 bool IsDynInit = false;
-bool IsBlacklisted = false;
+bool IsExcluded = false;
 
 Entry() = default;
   };

diff  --git a/llvm/lib/Analysis/InlineCost.cpp 
b/llvm/lib/Analysis/InlineCost.cpp
index ba327ca6ce2d..66e8184e7ec2 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -1113,7 +1113,8 @@ bool CallAnalyzer::visitCastInst(CastInst ) {
   }))
 return true;
 
-  // 

[clang-tools-extra] 16897e4 - Update test file.

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-19T23:13:28-07:00
New Revision: 16897e47baa2b7cd1f63f40f8355c372b841f83d

URL: 
https://github.com/llvm/llvm-project/commit/16897e47baa2b7cd1f63f40f8355c372b841f83d
DIFF: 
https://github.com/llvm/llvm-project/commit/16897e47baa2b7cd1f63f40f8355c372b841f83d.diff

LOG: Update test file.

Added: 


Modified: 
clang-tools-extra/test/clang-change-namespace/allow-list.cpp

Removed: 




diff  --git a/clang-tools-extra/test/clang-change-namespace/allow-list.cpp 
b/clang-tools-extra/test/clang-change-namespace/allow-list.cpp
index 07abd8b247d1..3f93cb7c9892 100644
--- a/clang-tools-extra/test/clang-change-namespace/allow-list.cpp
+++ b/clang-tools-extra/test/clang-change-namespace/allow-list.cpp
@@ -1,5 +1,5 @@
 // RUN: echo "^std::.*$" > %T/allowed-list.txt
-// RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" 
--file_pattern ".*" --allowed_file %T/white-list.txt %s -- | sed 's,// 
CHECK.*,,' | FileCheck %s
+// RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" 
--file_pattern ".*" --allowed_file %T/allow-list.txt %s -- | sed 's,// 
CHECK.*,,' | FileCheck %s
 
 #include "Inputs/fake-std.h"
 



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


[clang-tools-extra] 25ed42f - [clang-change-namespace] As part of using inclusive language

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-19T23:01:42-07:00
New Revision: 25ed42f05d07d3ad85c58ee001752338211c911c

URL: 
https://github.com/llvm/llvm-project/commit/25ed42f05d07d3ad85c58ee001752338211c911c
DIFF: 
https://github.com/llvm/llvm-project/commit/25ed42f05d07d3ad85c58ee001752338211c911c.diff

LOG: [clang-change-namespace] As part of using inclusive language
within the llvm project, migrate away from the use of blacklist
and whitelist.

Added: 
clang-tools-extra/test/clang-change-namespace/allow-list.cpp

Modified: 
clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp
clang-tools-extra/clang-change-namespace/ChangeNamespace.h
clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
clang-tools-extra/unittests/clang-change-namespace/ChangeNamespaceTests.cpp

Removed: 
clang-tools-extra/test/clang-change-namespace/white-list.cpp



diff  --git a/clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp 
b/clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp
index 5f4a889cab9e..e2a70db4102b 100644
--- a/clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp
+++ b/clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp
@@ -347,7 +347,7 @@ bool isTemplateParameter(TypeLoc Type) {
 
 ChangeNamespaceTool::ChangeNamespaceTool(
 llvm::StringRef OldNs, llvm::StringRef NewNs, llvm::StringRef FilePattern,
-llvm::ArrayRef WhiteListedSymbolPatterns,
+llvm::ArrayRef AllowedSymbolPatterns,
 std::map *FileToReplacements,
 llvm::StringRef FallbackStyle)
 : FallbackStyle(FallbackStyle), FileToReplacements(*FileToReplacements),
@@ -365,8 +365,8 @@ ChangeNamespaceTool::ChangeNamespaceTool(
   DiffOldNamespace = joinNamespaces(OldNsSplitted);
   DiffNewNamespace = joinNamespaces(NewNsSplitted);
 
-  for (const auto  : WhiteListedSymbolPatterns)
-WhiteListedSymbolRegexes.emplace_back(Pattern);
+  for (const auto  : AllowedSymbolPatterns)
+AllowedSymbolRegexes.emplace_back(Pattern);
 }
 
 void ChangeNamespaceTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
@@ -800,7 +800,7 @@ void 
ChangeNamespaceTool::replaceQualifiedSymbolInDeclContext(
   Result.SourceManager->getSpellingLoc(End)),
   *Result.SourceManager, Result.Context->getLangOpts());
   std::string FromDeclName = FromDecl->getQualifiedNameAsString();
-  for (llvm::Regex  : WhiteListedSymbolRegexes)
+  for (llvm::Regex  : AllowedSymbolRegexes)
 if (RE.match(FromDeclName))
   return;
   std::string ReplaceName =

diff  --git a/clang-tools-extra/clang-change-namespace/ChangeNamespace.h 
b/clang-tools-extra/clang-change-namespace/ChangeNamespace.h
index 147675911941..d35119b70a69 100644
--- a/clang-tools-extra/clang-change-namespace/ChangeNamespace.h
+++ b/clang-tools-extra/clang-change-namespace/ChangeNamespace.h
@@ -49,7 +49,7 @@ class ChangeNamespaceTool : public 
ast_matchers::MatchFinder::MatchCallback {
   // files matching `FilePattern`.
   ChangeNamespaceTool(
   llvm::StringRef OldNs, llvm::StringRef NewNs, llvm::StringRef 
FilePattern,
-  llvm::ArrayRef WhiteListedSymbolPatterns,
+  llvm::ArrayRef AllowedSymbolPatterns,
   std::map *FileToReplacements,
   llvm::StringRef FallbackStyle = "LLVM");
 
@@ -166,7 +166,7 @@ class ChangeNamespaceTool : public 
ast_matchers::MatchFinder::MatchCallback {
   llvm::SmallPtrSet ProcessedFuncRefs;
   // Patterns of symbol names whose references are not expected to be updated
   // when changing namespaces around them.
-  std::vector WhiteListedSymbolRegexes;
+  std::vector AllowedSymbolRegexes;
 };
 
 } // namespace change_namespace

diff  --git 
a/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp 
b/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
index d54fe7347cf3..61754fe41bc1 100644
--- a/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
+++ b/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
@@ -72,20 +72,20 @@ cl::opt Style("style",
cl::desc("The style name used for reformatting."),
cl::init("LLVM"), cl::cat(ChangeNamespaceCategory));
 
-cl::opt WhiteListFile(
-"whitelist_file",
+cl::opt AllowedFile(
+"allowed_file",
 cl::desc("A file containing regexes of symbol names that are not expected "
  "to be updated when changing namespaces around them."),
 cl::init(""), cl::cat(ChangeNamespaceCategory));
 
-llvm::ErrorOr> GetWhiteListedSymbolPatterns() {
+llvm::ErrorOr> GetAllowedSymbolPatterns() {
   std::vector Patterns;
-  if (WhiteListFile.empty())
+  if (AllowedFile.empty())
 return Patterns;
 
   llvm::SmallVector Lines;
   llvm::ErrorOr> File =
-  llvm::MemoryBuffer::getFile(WhiteListFile);
+  llvm::MemoryBuffer::getFile(AllowedFile);
   if (!File)
 return File.getError();
   llvm::StringRef Content = 

Re: [PATCH] D82244: [SanitizeCoverage] Rename -fsanitize-coverage-{white, black}list to -fsanitize-coverage-{allow,block}list

2020-06-20 Thread Eric Christopher via cfe-commits
On Fri, Jun 19, 2020 at 10:43 PM Fangrui Song via Phabricator <
revi...@reviews.llvm.org> wrote:

> MaskRay added inline comments.
>
>
> 
> Comment at: clang/docs/ClangCommandLineReference.rst:891
>
>  Restrict sanitizer coverage instrumentation exclusively to modules and
> functions that match the provided special case list, except the blacklisted
> ones
>
> 
> echristo wrote:
> > MaskRay wrote:
> > > echristo wrote:
> > > > MaskRay wrote:
> > > > > echristo wrote:
> > > > > > I'd remove the uses of blacklist and whitelist here and below.
> Just have the language and the documentation be for the new option.
> > > > > `clang-tblgen -gen-opt-docs` does not seem to provide a feature to
> hide an option. HelpHidden does not hide the option.
> > > > Please remove blacklist and whitelist from the option description.
> > > I can do that but the next person updating the documentation will add
> them back.
> > >
> > > I believe `clang-tblgen -gen-opt-docs` just doesn't have the feature.
> Maybe we can delete the old options earlier so that we don't need to worry
> about the documentation.
> > Ugh. Yes, I hope so too. Can you raise it on cfe-dev?
> I can but I need to understand more about `clang-tblgen -gen-opt-docs`
> first...
>
>
I meant deleting the old options :)

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


[PATCH] D81408: [builtins] Improve compatibility with 16 bit targets

2020-06-20 Thread Anatoly Trosinenko via Phabricator via cfe-commits
atrosinenko added a subscriber: goncharov.
atrosinenko added a comment.

In D81408#2104572 , @efriedma wrote:

> > Those flaky test failures seems to be due to ld.lld being not built from 
> > source as part of testing compiler-rt/-only patches.
>
> That should be something we can fix in the build system.  
> compiler-rt/test/CMakeLists.txt has a list of executables which the tests 
> depend on. If that list isn't complete, it should be updated.


@efriedma

Agree, but another question: is it acceptable to have them disabled when 
retesting compiler-rt? So, maybe lld subproject have to be explicitly enabled 
as well for `compiler-rt`-only tests...

@goncharov

Meanwhile, looking at the latest Buildkite build 
 for this 
review, we have:

name=artifacts/CMakeCache.txt (Linux)
  ...
  LLVM_ENABLE_PROJECTS:STRING=clang;compiler-rt;llvm
  ...

and

name=artifacts/CMakeCache.txt (Windows)
  ...
  LLVM_ENABLE_PROJECTS:STRING=clang;llvm
  ...

So, isn't Windows build here just wasting CPU time?

Another my concern here is that the build plan pre-merge checks (buildkite) 
 is expressed with just a single 
"Make HTTP request" step with "When Complete: Wait For Message" (unlike the 
pre-merge checks  used for the 
initial upload). So, this build 
 failed like this (see the 
message tab):

  216557merge_guards_botfailConsumedThu, Jun 18, 
16:13
  216556merge_guards_botworking Thu, Jun 18, 16:13
  216538merge_guards_botworking Thu, Jun 18, 15:51

In D81282: [builtins] Move more float128-related helpers to GENERIC_TF_SOURCES 
list , on the other hand, there is seemingly 
passed build . Its messages 
are

  216370merge_guards_botfailThu, Jun 18, 13:28
  216365merge_guards_botworking Thu, Jun 18, 13:25
  216343merge_guards_botpassConsumedThu, Jun 18, 
12:53
  216342merge_guards_botworking Thu, Jun 18, 12:52

So, it looks like now the `compiler-rt`-only pre-merge check cannot pass at 
all, but can be **marked** Passed **on re-upload only** based on what builder 
(Linux or Windows) will send its reply first.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81408



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


[PATCH] D82256: [analyzer] Enabling ctr in evalCall event

2020-06-20 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked an inline comment as done.
vrnithinkumar added inline comments.



Comment at: 
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:100
+/// Hints for figuring out of a call should be inlined during evalCall().
+struct EvalCallOptions {
+  /// This call is a constructor or a destructor for which we do not currently

Moved the  `struct EvalCallOptions` outside `ExprEngine` class.
Since CheckerManager.h using forward declaration of `ExprEngine` and inner type 
`EvalCallOptions` is needed for the `runCheckersForEvalCall` function 
declaration.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82256



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


[clang] f5bbe39 - [clang] SequenceChecker: C++17 sequencing rule for overloaded operators.

2020-06-20 Thread Bruno Ricci via cfe-commits

Author: Bruno Ricci
Date: 2020-06-20T10:51:46+01:00
New Revision: f5bbe390d23d7da0ffb110cdb24b583c2dc87eba

URL: 
https://github.com/llvm/llvm-project/commit/f5bbe390d23d7da0ffb110cdb24b583c2dc87eba
DIFF: 
https://github.com/llvm/llvm-project/commit/f5bbe390d23d7da0ffb110cdb24b583c2dc87eba.diff

LOG: [clang] SequenceChecker: C++17 sequencing rule for overloaded operators.

In C++17 the operand(s) of an overloaded operator are sequenced as for
the corresponding built-in operator when the overloaded operator is
called with the operator notation ([over.match.oper]p2).

Reported in PR35340.

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

Reviewed By: rsmith

Added: 


Modified: 
clang/lib/Sema/SemaChecking.cpp
clang/test/SemaCXX/warn-unsequenced.cpp

Removed: 




diff  --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index f5f6b7bfb0f0..883ff17eb279 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -13031,6 +13031,130 @@ class SequenceChecker : public 
ConstEvaluatedExprVisitor {
 });
   }
 
+  void VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *CXXOCE) {
+// C++17 [over.match.oper]p2:
+//   [...] the operator notation is first transformed to the equivalent
+//   function-call notation as summarized in Table 12 (where @ denotes one
+//   of the operators covered in the specified subclause). However, the
+//   operands are sequenced in the order prescribed for the built-in
+//   operator (Clause 8).
+//
+// From the above only overloaded binary operators and overloaded call
+// operators have sequencing rules in C++17 that we need to handle
+// separately.
+if (!SemaRef.getLangOpts().CPlusPlus17 ||
+(CXXOCE->getNumArgs() != 2 && CXXOCE->getOperator() != OO_Call))
+  return VisitCallExpr(CXXOCE);
+
+enum {
+  NoSequencing,
+  LHSBeforeRHS,
+  RHSBeforeLHS,
+  LHSBeforeRest
+} SequencingKind;
+switch (CXXOCE->getOperator()) {
+case OO_Equal:
+case OO_PlusEqual:
+case OO_MinusEqual:
+case OO_StarEqual:
+case OO_SlashEqual:
+case OO_PercentEqual:
+case OO_CaretEqual:
+case OO_AmpEqual:
+case OO_PipeEqual:
+case OO_LessLessEqual:
+case OO_GreaterGreaterEqual:
+  SequencingKind = RHSBeforeLHS;
+  break;
+
+case OO_LessLess:
+case OO_GreaterGreater:
+case OO_AmpAmp:
+case OO_PipePipe:
+case OO_Comma:
+case OO_ArrowStar:
+case OO_Subscript:
+  SequencingKind = LHSBeforeRHS;
+  break;
+
+case OO_Call:
+  SequencingKind = LHSBeforeRest;
+  break;
+
+default:
+  SequencingKind = NoSequencing;
+  break;
+}
+
+if (SequencingKind == NoSequencing)
+  return VisitCallExpr(CXXOCE);
+
+// This is a call, so all subexpressions are sequenced before the result.
+SequencedSubexpression Sequenced(*this);
+
+SemaRef.runWithSufficientStackSpace(CXXOCE->getExprLoc(), [&] {
+  assert(SemaRef.getLangOpts().CPlusPlus17 &&
+ "Should only get there with C++17 and above!");
+  assert((CXXOCE->getNumArgs() == 2 || CXXOCE->getOperator() == OO_Call) &&
+ "Should only get there with an overloaded binary operator"
+ " or an overloaded call operator!");
+
+  if (SequencingKind == LHSBeforeRest) {
+assert(CXXOCE->getOperator() == OO_Call &&
+   "We should only have an overloaded call operator here!");
+
+// This is very similar to VisitCallExpr, except that we only have the
+// C++17 case. The postfix-expression is the first argument of the
+// CXXOperatorCallExpr. The expressions in the expression-list, if any,
+// are in the following arguments.
+//
+// Note that we intentionally do not visit the callee expression since
+// it is just a decayed reference to a function.
+SequenceTree::Seq PostfixExprRegion = Tree.allocate(Region);
+SequenceTree::Seq ArgsRegion = Tree.allocate(Region);
+SequenceTree::Seq OldRegion = Region;
+
+assert(CXXOCE->getNumArgs() >= 1 &&
+   "An overloaded call operator must have at least one argument"
+   " for the postfix-expression!");
+const Expr *PostfixExpr = CXXOCE->getArgs()[0];
+llvm::ArrayRef Args(CXXOCE->getArgs() + 1,
+  CXXOCE->getNumArgs() - 1);
+
+// Visit the postfix-expression first.
+{
+  Region = PostfixExprRegion;
+  SequencedSubexpression Sequenced(*this);
+  Visit(PostfixExpr);
+}
+
+// Then visit the argument expressions.
+Region = ArgsRegion;
+for (const Expr *Arg : Args)
+  Visit(Arg);
+
+Region = OldRegion;
+Tree.merge(PostfixExprRegion);
+Tree.merge(ArgsRegion);
+  } 

[clang-tools-extra] d313cb6 - Update redirected output file.

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-19T23:30:16-07:00
New Revision: d313cb6e956de9448e4b979763ee8d12ce4103cb

URL: 
https://github.com/llvm/llvm-project/commit/d313cb6e956de9448e4b979763ee8d12ce4103cb
DIFF: 
https://github.com/llvm/llvm-project/commit/d313cb6e956de9448e4b979763ee8d12ce4103cb.diff

LOG: Update redirected output file.

Added: 


Modified: 
clang-tools-extra/test/clang-change-namespace/allow-list.cpp

Removed: 




diff  --git a/clang-tools-extra/test/clang-change-namespace/allow-list.cpp 
b/clang-tools-extra/test/clang-change-namespace/allow-list.cpp
index 3f93cb7c9892..7a941dcb2aa3 100644
--- a/clang-tools-extra/test/clang-change-namespace/allow-list.cpp
+++ b/clang-tools-extra/test/clang-change-namespace/allow-list.cpp
@@ -1,4 +1,4 @@
-// RUN: echo "^std::.*$" > %T/allowed-list.txt
+// RUN: echo "^std::.*$" > %T/allow-list.txt
 // RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" 
--file_pattern ".*" --allowed_file %T/allow-list.txt %s -- | sed 's,// 
CHECK.*,,' | FileCheck %s
 
 #include "Inputs/fake-std.h"



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


[clang] 1f593f4 - [AST/Lex/Parse/Sema] As part of using inclusive language within

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-20T01:15:32-07:00
New Revision: 1f593f46f35b3afb1ba6e4700285cf8fd1b81bc7

URL: 
https://github.com/llvm/llvm-project/commit/1f593f46f35b3afb1ba6e4700285cf8fd1b81bc7
DIFF: 
https://github.com/llvm/llvm-project/commit/1f593f46f35b3afb1ba6e4700285cf8fd1b81bc7.diff

LOG: [AST/Lex/Parse/Sema] As part of using inclusive language within
the llvm project, migrate away from the use of blacklist and whitelist.

Added: 


Modified: 
clang/lib/AST/ExprConstant.cpp
clang/lib/Basic/Targets/OSTargets.h
clang/lib/Lex/Lexer.cpp
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Parse/ParsePragma.cpp
clang/lib/Sema/SemaChecking.cpp
clang/lib/Sema/SemaDeclObjC.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaStmt.cpp

Removed: 




diff  --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 870bf7696093..640bdd0d45e5 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -9749,7 +9749,7 @@ static bool EvaluateArrayNewConstructExpr(EvalInfo , 
LValue ,
 
 // Return true iff the given array filler may depend on the element index.
 static bool MaybeElementDependentArrayFiller(const Expr *FillerExpr) {
-  // For now, just whitelist non-class value-initialization and initialization
+  // For now, just allow non-class value-initialization and initialization
   // lists comprised of them.
   if (isa(FillerExpr))
 return false;
@@ -10615,9 +10615,9 @@ static bool isUserWritingOffTheEnd(const ASTContext 
, const LValue ) {
   //   the array at the end was flexible, or if it had 0 or 1 elements. This
   //   broke some common standard library extensions (PR30346), but was
   //   otherwise seemingly fine. It may be useful to reintroduce this behavior
-  //   with some sort of whitelist. OTOH, it seems that GCC is always
+  //   with some sort of list. OTOH, it seems that GCC is always
   //   conservative with the last element in structs (if it's an array), so our
-  //   current behavior is more compatible than a whitelisting approach would
+  //   current behavior is more compatible than an explicit list approach would
   //   be.
   return LVal.InvalidBase &&
  Designator.Entries.size() == Designator.MostDerivedPathLength &&

diff  --git a/clang/lib/Basic/Targets/OSTargets.h 
b/clang/lib/Basic/Targets/OSTargets.h
index e57ad7b9eeaf..af04b75392f5 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -87,7 +87,7 @@ class LLVM_LIBRARY_VISIBILITY DarwinTargetInfo : public 
OSTargetInfo {
 public:
   DarwinTargetInfo(const llvm::Triple , const TargetOptions )
   : OSTargetInfo(Triple, Opts) {
-// By default, no TLS, and we whitelist permitted architecture/OS
+// By default, no TLS, and we list permitted architecture/OS
 // combinations.
 this->TLSSupported = false;
 

diff  --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp
index 016263108602..a559ca3eac2b 100644
--- a/clang/lib/Lex/Lexer.cpp
+++ b/clang/lib/Lex/Lexer.cpp
@@ -1862,7 +1862,7 @@ const char *Lexer::LexUDSuffix(Token , const char 
*CurPtr,
 char Next = getCharAndSizeNoWarn(CurPtr + Consumed, NextSize,
  getLangOpts());
 if (!isIdentifierBody(Next)) {
-  // End of suffix. Check whether this is on the whitelist.
+  // End of suffix. Check whether this is on the allowed list.
   const StringRef CompleteSuffix(Buffer, Chars);
   IsUDSuffix = StringLiteralParser::isValidUDSuffix(getLangOpts(),
 CompleteSuffix);

diff  --git a/clang/lib/Parse/ParseDeclCXX.cpp 
b/clang/lib/Parse/ParseDeclCXX.cpp
index 7a8a94203190..a236a82213fb 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -4387,7 +4387,7 @@ void Parser::ParseMicrosoftAttributes(ParsedAttributes 
,
 BalancedDelimiterTracker T(*this, tok::l_square);
 T.consumeOpen();
 
-// Skip most ms attributes except for a whitelist.
+// Skip most ms attributes except for a specific list.
 while (true) {
   SkipUntil(tok::r_square, tok::identifier, StopAtSemi | StopBeforeMatch);
   if (Tok.isNot(tok::identifier)) // ']', but also eof

diff  --git a/clang/lib/Parse/ParsePragma.cpp b/clang/lib/Parse/ParsePragma.cpp
index 2631c3556273..eacb54e81ae6 100644
--- a/clang/lib/Parse/ParsePragma.cpp
+++ b/clang/lib/Parse/ParsePragma.cpp
@@ -2725,7 +2725,7 @@ void PragmaCommentHandler::HandlePragma(Preprocessor ,
 return;
   }
 
-  // Verify that this is one of the 5 whitelisted options.
+  // Verify that this is one of the 5 explicitly listed options.
   IdentifierInfo *II = Tok.getIdentifierInfo();
   PragmaMSCommentKind Kind =
 llvm::StringSwitch(II->getName())
@@ -2766,7 +2766,7 @@ void PragmaCommentHandler::HandlePragma(Preprocessor ,
   // 

[PATCH] D82103: [analyzer] Remove forbidden characters from a SourceLocation filename for a graph dump on Windows

2020-06-20 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

Great, thanks!


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

https://reviews.llvm.org/D82103



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


[PATCH] D82256: Enabling ctr in evalCall event

2020-06-20 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision.
Herald added subscribers: cfe-commits, martong.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82256

Files:
  clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
  clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
  clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
  clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp
  clang/lib/StaticAnalyzer/Core/CallEvent.cpp
  clang/lib/StaticAnalyzer/Core/CheckerManager.cpp
  clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
  clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
  clang/test/Analysis/analyzer-config.c
  clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp
  clang/test/Analysis/new-ctor-conservative.cpp

Index: clang/test/Analysis/new-ctor-conservative.cpp
===
--- clang/test/Analysis/new-ctor-conservative.cpp
+++ clang/test/Analysis/new-ctor-conservative.cpp
@@ -27,6 +27,7 @@
   S *s = new S[10];
   // FIXME: Should be true once we inline array constructors.
   clang_analyzer_eval(s[0].x == 1); // expected-warning{{UNKNOWN}}
+  clang_analyzer_eval(s[1].x == 1); // expected-warning{{UNKNOWN}}
 }
 
 struct NullS {
Index: clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp
===
--- /dev/null
+++ clang/test/Analysis/cxxctr-evalcall-analysis-order.cpp
@@ -0,0 +1,33 @@
+// RUN: %clang_analyze_cc1 %s \
+// RUN:  -analyzer-checker=debug.AnalysisOrder \
+// RUN:  -analyzer-config debug.AnalysisOrder:EvalCall=true \
+// RUN:  -analyzer-config debug.AnalysisOrder:PreCall=true \
+// RUN:  -analyzer-config debug.AnalysisOrder:PostCall=true \
+// RUN:  2>&1 | FileCheck %s
+
+// This test ensures that eval::Call event will be triggered for constructors.
+
+class C {
+public:
+  C(){};
+  C(int x){};
+  C(int x, int y){};
+};
+
+void foo() {
+  C C0;
+  C C1(42);
+  C *C2 = new C{2, 3};
+}
+
+// CHECK:  PreCall (C::C) [CXXConstructorCall]
+// CHECK-NEXT:  EvalCall (C::C) {0} [CXXConstructorCall]
+// CHECK-NEXT:  PostCall (C::C) [CXXConstructorCall]
+// CHECK-NEXT:  PreCall (C::C) [CXXConstructorCall]
+// CHECK-NEXT:  EvalCall (C::C) {1} [CXXConstructorCall]
+// CHECK-NEXT:  PostCall (C::C) [CXXConstructorCall]
+// CHECK-NEXT:  PreCall (operator new) [CXXAllocatorCall]
+// CHECK-NEXT:  PostCall (operator new) [CXXAllocatorCall]
+// CHECK-NEXT:  PreCall (C::C) [CXXConstructorCall]
+// CHECK-NEXT:  EvalCall (C::C) {2} [CXXConstructorCall]
+// CHECK-NEXT:  PostCall (C::C) [CXXConstructorCall]
\ No newline at end of file
Index: clang/test/Analysis/analyzer-config.c
===
--- clang/test/Analysis/analyzer-config.c
+++ clang/test/Analysis/analyzer-config.c
@@ -50,6 +50,7 @@
 // CHECK-NEXT: debug.AnalysisOrder:Bind = false
 // CHECK-NEXT: debug.AnalysisOrder:EndAnalysis = false
 // CHECK-NEXT: debug.AnalysisOrder:EndFunction = false
+// CHECK-NEXT: debug.AnalysisOrder:EvalCall = false
 // CHECK-NEXT: debug.AnalysisOrder:LiveSymbols = false
 // CHECK-NEXT: debug.AnalysisOrder:NewAllocator = false
 // CHECK-NEXT: debug.AnalysisOrder:PointerEscape = false
Index: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
===
--- clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
+++ clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
@@ -583,8 +583,9 @@
   // to see if the can evaluate the function call, and get a callback at
   // defaultEvalCall if all of them fail.
   ExplodedNodeSet dstCallEvaluated;
+  EvalCallOptions CallOpts;
   getCheckerManager().runCheckersForEvalCall(dstCallEvaluated, dstPreVisit,
- Call, *this);
+ Call, *this, CallOpts);
 
   // If there were other constructors called for object-type arguments
   // of this call, clean them up.
@@ -717,7 +718,7 @@
 ExprEngine::CallInlinePolicy
 ExprEngine::mayInlineCallKind(const CallEvent , const ExplodedNode *Pred,
   AnalyzerOptions ,
-  const ExprEngine::EvalCallOptions ) {
+  const EvalCallOptions ) {
   const LocationContext *CurLC = Pred->getLocationContext();
   const StackFrameContext *CallerSFC = CurLC->getStackFrame();
   switch (Call.getKind()) {
Index: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
===
--- clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
+++ clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
@@ -615,7 +615,8 @@
   } else {
 for (ExplodedNodeSet::iterator I = DstPreCall.begin(), E = DstPreCall.end();
  I != E; ++I)
-  defaultEvalCall(Bldr, *I, *Call, CallOpts);
+  getCheckerManager().runCheckersForEvalCall(DstEvaluated, *I, *Call, *this,
+  

[PATCH] D82122: [analyzer][Liveness][RFC][NFC] Propose to turn statement liveness into expression liveness

2020-06-20 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment.

Cheers! I'll leave this here for conversation's sake, and start working on 
refactoring LivenessAnalysis.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82122



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


[PATCH] D81330: [clang] SequenceChecker: C++17 sequencing rule for overloaded operators.

2020-06-20 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf5bbe390d23d: [clang] SequenceChecker: C++17 sequencing rule 
for overloaded operators. (authored by riccibruno).

Changed prior to commit:
  https://reviews.llvm.org/D81330?vs=269012=272249#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81330

Files:
  clang/lib/Sema/SemaChecking.cpp
  clang/test/SemaCXX/warn-unsequenced.cpp

Index: clang/test/SemaCXX/warn-unsequenced.cpp
===
--- clang/test/SemaCXX/warn-unsequenced.cpp
+++ clang/test/SemaCXX/warn-unsequenced.cpp
@@ -278,6 +278,174 @@
   }
 }
 
+namespace overloaded_operators {
+  struct E {
+E =(E &);
+E operator()(E);
+E operator()(E, E);
+E operator[](E);
+  } e;
+  // Binary operators with unsequenced operands.
+  E operator+(E,E);
+  E operator-(E,E);
+  E operator*(E,E);
+  E operator/(E,E);
+  E operator%(E,E);
+  E operator^(E,E);
+  E operator&(E,E);
+  E operator|(E,E);
+
+  E operator<(E,E);
+  E operator>(E,E);
+  E operator==(E,E);
+  E operator!=(E,E);
+  E operator>=(E,E);
+  E operator<=(E,E);
+
+  // Binary operators where the RHS is sequenced before the LHS in C++17.
+  E operator+=(E,E);
+  E operator-=(E,E);
+  E operator*=(E,E);
+  E operator/=(E,E);
+  E operator%=(E,E);
+  E operator^=(E,E);
+  E operator&=(E,E);
+  E operator|=(E,E);
+  E operator<<=(E,E);
+  E operator>>=(E,E);
+
+  // Binary operators where the LHS is sequenced before the RHS in C++17.
+  E operator<<(E,E);
+  E operator>>(E,E);
+  E operator&&(E,E);
+  E operator||(E,E);
+  E operator,(E,E);
+  E operator->*(E,E);
+
+  void test() {
+int i = 0;
+// Binary operators with unsequenced operands.
+((void)i++,e) + ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) - ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) * ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) / ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) % ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) ^ ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) & ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) | ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+
+((void)i++,e) < ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) > ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) == ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) != ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) <= ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) >= ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+// cxx17-warning@-2 {{multiple unsequenced modifications to 'i'}}
+
+// Binary operators where the RHS is sequenced before the LHS in C++17.
+((void)i++,e) = ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) += ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) -= ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) *= ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) /= ((void)i++,e);
+// cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
+((void)i++,e) %= ((void)i++,e);
+// 

[PATCH] D82122: [analyzer][Liveness][RFC][NFC] Propose to turn statement liveness into expression liveness

2020-06-20 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked an inline comment as done.
Szelethus added inline comments.



Comment at: clang/lib/StaticAnalyzer/Core/Environment.cpp:193
+
+assert((isa(BlkExpr.getStmt()) || !IsBlkExprLive) &&
+   "Only Exprs can be live, LivenessAnalysis argues about the liveness 
"

>>! In D82122#2103638, @NoQ wrote:
> I think you're right, this entire thing only makes sense for expressions. I 
> think `Environment` occasionally carries values of `ReturnStmt`s (by which it 
> means values of their sub-expressions) but even then liveness analysis 
> doesn't need to be aware of that flex.
> 
>> no lit tests crashed on the added asserts
> 
>> the only non-expression statement it queries are `ObjCForCollectionStmt`s
> 
> Wait, how did you figure that out if not through crashing tests?

```lang=c++
if (IsBlkExprLive && !isa(BlkExpr.getStmt()) {
  BlkExpr.getStmt()->dump();
  llvm_unreachable("Gotcha!");
}



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82122



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


[PATCH] D81678: Introduce frozen attribute at call sites for stricter poison analysis

2020-06-20 Thread Juneyoung Lee via Phabricator via cfe-commits
aqjune accepted this revision.
aqjune added a comment.
This revision is now accepted and ready to land.

For the LangRef part, LGTM modulo the suggested change. Could anyone review 
clang and LLVM's updated part?




Comment at: llvm/docs/LangRef.rst:1644
+and return values. When ``"frozen"`` is present, every bit of the
+tagged type is fully initialized and never poison.
 ``"probe-stack"``

Could you explicitly state that if it is aggregate or vector type all elements 
and paddings should be frozen too?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81678



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


[PATCH] D81678: Introduce frozen attribute at call sites for stricter poison analysis

2020-06-20 Thread Gui Andrade via Phabricator via cfe-commits
guiand updated this revision to Diff 272213.
guiand retitled this revision from "Introduce partialinit attribute at call 
sites for stricter poison analysis" to "Introduce frozen attribute at call 
sites for stricter poison analysis".
guiand edited the summary of this revision.
guiand added a comment.
Herald added subscribers: sstefan1, phosek, dmgreen, mstorsjo, arphaman, 
dylanmckay, dschuff, emaste.
Herald added a reviewer: jdoerfert.

Reversing the meaning of the attribute to `frozen` and having the code not 
apply it to records removed pretty much all the logical changes in the code.

I took Juneyoung's suggestion and added a new cc1 flag, -disable-frozen-args 
(doesn't apply to return position, only argument position `frozen` attributes), 
and applied that to some 150 particularly problematic tests. Thousands of other 
tests were programatically and manually changed to include the new attribute.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81678

Files:
  clang/include/clang/AST/Type.h
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/CC1Options.td
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/ARCMT/objcmt-instancetype.m
  clang/test/ARCMT/objcmt-instancetype.m.result
  clang/test/ARCMT/objcmt-numeric-literals.m
  clang/test/ARCMT/objcmt-numeric-literals.m.result
  clang/test/AST/ast-dump-openmp-begin-declare-variant_6.c
  clang/test/ASTMerge/unnamed_fields/test.cpp
  clang/test/Analysis/casts.c
  clang/test/Analysis/inlining/DynDispatchBifurcate.m
  clang/test/Analysis/inlining/InlineObjCClassMethod.m
  clang/test/Analysis/misc-ps-region-store.m
  clang/test/Analysis/missing-bind-temporary.cpp
  clang/test/Analysis/silence-checkers-and-packages-core-all.cpp
  clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
  clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p11.cpp
  clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/dtor.cpp
  clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
  clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p2-cxx0x.cpp
  clang/test/CXX/drs/dr0xx.cpp
  clang/test/CXX/except/except.spec/p14-ir.cpp
  clang/test/CXX/expr/expr.prim/expr.prim.lambda/blocks-irgen.mm
  clang/test/CXX/modules-ts/codegen-basics.cppm
  clang/test/CXX/special/class.copy/p3.cpp
  clang/test/CodeGen/2004-02-13-Memset.c
  clang/test/CodeGen/2004-06-17-UnorderedCompares.c
  clang/test/CodeGen/2006-05-19-SingleEltReturn.c
  clang/test/CodeGen/2007-02-25-C-DotDotDot.c
  clang/test/CodeGen/2007-06-18-SextAttrAggregate.c
  clang/test/CodeGen/2008-03-05-syncPtr.c
  clang/test/CodeGen/2008-07-29-override-alias-decl.c
  clang/test/CodeGen/2008-07-30-implicit-initialization.c
  clang/test/CodeGen/2008-07-31-promotion-of-compound-pointer-arithmetic.c
  clang/test/CodeGen/2009-02-13-zerosize-union-field.c
  clang/test/CodeGen/2009-05-04-EnumInreg.c
  clang/test/CodeGen/2009-09-24-SqrtErrno.c
  clang/test/CodeGen/3dnow-builtins.c
  clang/test/CodeGen/64bit-swiftcall.c
  clang/test/CodeGen/PR3589-freestanding-libcalls.c
  clang/test/CodeGen/_Bool-conversion.c
  clang/test/CodeGen/aapcs-align.cpp
  clang/test/CodeGen/aapcs64-align.cpp
  clang/test/CodeGen/aarch64-args.cpp
  clang/test/CodeGen/aarch64-byval-temp.c
  clang/test/CodeGen/aarch64-neon-3v.c
  clang/test/CodeGen/aarch64-neon-across.c
  clang/test/CodeGen/aarch64-neon-dot-product.c
  clang/test/CodeGen/aarch64-neon-extract.c
  clang/test/CodeGen/aarch64-neon-fcvt-intrinsics.c
  clang/test/CodeGen/aarch64-neon-fma.c
  clang/test/CodeGen/aarch64-neon-ldst-one.c
  clang/test/CodeGen/aarch64-neon-scalar-copy.c
  clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c
  clang/test/CodeGen/aarch64-neon-tbl.c
  clang/test/CodeGen/aarch64-neon-vcombine.c
  clang/test/CodeGen/aarch64-neon-vget-hilo.c
  clang/test/CodeGen/aarch64-neon-vget.c
  clang/test/CodeGen/aarch64-poly128.c
  clang/test/CodeGen/aarch64-poly64.c
  clang/test/CodeGen/aarch64-varargs-ms.c
  clang/test/CodeGen/aarch64-varargs.c
  clang/test/CodeGen/address-space-avr.c
  clang/test/CodeGen/address-space-field1.c
  clang/test/CodeGen/address-space.c
  clang/test/CodeGen/aggregate-assign-call.c
  clang/test/CodeGen/aix-return.c
  clang/test/CodeGen/aix-struct-arg.c
  clang/test/CodeGen/aix-vaargs.c
  clang/test/CodeGen/alias.c
  clang/test/CodeGen/align-param.c
  clang/test/CodeGen/align_value.cpp
  clang/test/CodeGen/alloc-align-attr.c
  clang/test/CodeGen/arc/arguments.c
  clang/test/CodeGen/arc/struct-align.c
  clang/test/CodeGen/arm-aapcs-vfp.c
  clang/test/CodeGen/arm-abi-vector.c
  clang/test/CodeGen/arm-arguments.c
  clang/test/CodeGen/arm-bf16-params-returns.c
  clang/test/CodeGen/arm-byval-align.c
  clang/test/CodeGen/arm-cmse-attr.c
  clang/test/CodeGen/arm-cmse-call.c
  clang/test/CodeGen/arm-float-helpers.c
  clang/test/CodeGen/arm-fp16-arguments.c
  clang/test/CodeGen/arm-homogenous.c
  clang/test/CodeGen/arm-mangle-bf16.cpp

[PATCH] D82244: [SanitizeCoverage] Rename -fsanitize-coverage-{white,black}list to -fsanitize-coverage-{allow,block}list

2020-06-20 Thread Fangrui Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2a4317bfb319: [SanitizeCoverage] Rename 
-fsanitize-coverage-{white,black}list to -fsanitize… (authored by MaskRay).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82244

Files:
  clang/docs/ClangCommandLineReference.rst
  clang/docs/SanitizerCoverage.rst
  clang/include/clang/Basic/CodeGenOptions.h
  clang/include/clang/Driver/Options.td
  clang/include/clang/Driver/SanitizerArgs.h
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Driver/SanitizerArgs.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  
compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_allowlist_blocklist.cpp
  
compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_whitelist_blacklist.cpp
  llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
  llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp

Index: llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
===
--- llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -200,10 +200,10 @@
 public:
   ModuleSanitizerCoverage(
   const SanitizerCoverageOptions  = SanitizerCoverageOptions(),
-  const SpecialCaseList *Whitelist = nullptr,
-  const SpecialCaseList *Blacklist = nullptr)
-  : Options(OverrideFromCL(Options)), Whitelist(Whitelist),
-Blacklist(Blacklist) {}
+  const SpecialCaseList *Allowlist = nullptr,
+  const SpecialCaseList *Blocklist = nullptr)
+  : Options(OverrideFromCL(Options)), Allowlist(Allowlist),
+Blocklist(Blocklist) {}
   bool instrumentModule(Module , DomTreeCallback DTCallback,
 PostDomTreeCallback PDTCallback);
 
@@ -268,31 +268,31 @@
 
   SanitizerCoverageOptions Options;
 
-  const SpecialCaseList *Whitelist;
-  const SpecialCaseList *Blacklist;
+  const SpecialCaseList *Allowlist;
+  const SpecialCaseList *Blocklist;
 };
 
 class ModuleSanitizerCoverageLegacyPass : public ModulePass {
 public:
   ModuleSanitizerCoverageLegacyPass(
   const SanitizerCoverageOptions  = SanitizerCoverageOptions(),
-  const std::vector  =
+  const std::vector  =
   std::vector(),
-  const std::vector  =
+  const std::vector  =
   std::vector())
   : ModulePass(ID), Options(Options) {
-if (WhitelistFiles.size() > 0)
-  Whitelist = SpecialCaseList::createOrDie(WhitelistFiles,
+if (AllowlistFiles.size() > 0)
+  Allowlist = SpecialCaseList::createOrDie(AllowlistFiles,
*vfs::getRealFileSystem());
-if (BlacklistFiles.size() > 0)
-  Blacklist = SpecialCaseList::createOrDie(BlacklistFiles,
+if (BlocklistFiles.size() > 0)
+  Blocklist = SpecialCaseList::createOrDie(BlocklistFiles,
*vfs::getRealFileSystem());
 initializeModuleSanitizerCoverageLegacyPassPass(
 *PassRegistry::getPassRegistry());
   }
   bool runOnModule(Module ) override {
-ModuleSanitizerCoverage ModuleSancov(Options, Whitelist.get(),
- Blacklist.get());
+ModuleSanitizerCoverage ModuleSancov(Options, Allowlist.get(),
+ Blocklist.get());
 auto DTCallback = [this](Function ) -> const DominatorTree * {
   return >getAnalysis(F).getDomTree();
 };
@@ -314,16 +314,16 @@
 private:
   SanitizerCoverageOptions Options;
 
-  std::unique_ptr Whitelist;
-  std::unique_ptr Blacklist;
+  std::unique_ptr Allowlist;
+  std::unique_ptr Blocklist;
 };
 
 } // namespace
 
 PreservedAnalyses ModuleSanitizerCoveragePass::run(Module ,
ModuleAnalysisManager ) {
-  ModuleSanitizerCoverage ModuleSancov(Options, Whitelist.get(),
-   Blacklist.get());
+  ModuleSanitizerCoverage ModuleSancov(Options, Allowlist.get(),
+   Blocklist.get());
   auto  = MAM.getResult(M).getManager();
   auto DTCallback = [](Function ) -> const DominatorTree * {
 return (F);
@@ -396,11 +396,11 @@
 Module , DomTreeCallback DTCallback, PostDomTreeCallback PDTCallback) {
   if (Options.CoverageType == SanitizerCoverageOptions::SCK_None)
 return false;
-  if (Whitelist &&
-  !Whitelist->inSection("coverage", "src", M.getSourceFileName()))
+  if (Allowlist &&
+  !Allowlist->inSection("coverage", "src", M.getSourceFileName()))
 return false;
-  if (Blacklist &&
-  Blacklist->inSection("coverage", "src", M.getSourceFileName()))
+  if (Blocklist &&
+  Blocklist->inSection("coverage", "src", M.getSourceFileName()))
 return false;
   C = &(M.getContext());
   DL = ();
@@ -639,9 +639,9 @@
   if (F.hasPersonalityFn() &&
   

[PATCH] D81678: Introduce frozen attribute at call sites for stricter poison analysis

2020-06-20 Thread Evgenii Stepanov via Phabricator via cfe-commits
eugenis added a comment.

> Could you explicitly state that if it is aggregate or vector type all 
> elements and paddings should be frozen too?

If an aggregate is passed as an aggregate at IR level, we should not care about 
the padding.
Unless it's coerced to an integer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81678



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


[PATCH] D81678: Introduce partialinit attribute at call sites for stricter poison analysis

2020-06-20 Thread Juneyoung Lee via Phabricator via cfe-commits
aqjune added a comment.

In D81678#2099444 , @efriedma wrote:

> So I guess we've discussed the following alternatives so far:
>
> (snip)
>
> Maybe (1) is the least-bad; all the others compromise by making LLVM harder 
> to understand.  We can make porting the clang tests easier by adding a cc1 
> flag to turn off emitting frozen attributes, I guess (so instead of updating 
> the CHECK lines, you could just mechanically update the RUN line).




In D81678#2099591 , @eugenis wrote:

> I agree that (1) is the easiest to work with and the least error-prone, and 
> that's what we must shoot for in the design. We could do (4) later as an 
> optimization.


I agree. After going to (1) we can bring optimizations as a follow-up if it 
needed. I vote for the -cc1 option as a workaround.
BTW, was there a case in the past that needed a massive updates in tests as 
well? I wonder how it was addressed at that time.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81678



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


[clang-tools-extra] a146991 - Update error to read a little better when an error occurs.

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-19T23:34:30-07:00
New Revision: a1469914fd7542526693b07a26a0bdcaa27591a3

URL: 
https://github.com/llvm/llvm-project/commit/a1469914fd7542526693b07a26a0bdcaa27591a3
DIFF: 
https://github.com/llvm/llvm-project/commit/a1469914fd7542526693b07a26a0bdcaa27591a3.diff

LOG: Update error to read a little better when an error occurs.

Added: 


Modified: 
clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp

Removed: 




diff  --git 
a/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp 
b/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
index 61754fe41bc1..babc207cb0e0 100644
--- a/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
+++ b/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
@@ -106,7 +106,7 @@ int main(int argc, const char **argv) {
   llvm::ErrorOr> AllowedPatterns =
   GetAllowedSymbolPatterns();
   if (!AllowedPatterns) {
-llvm::errs() << "Failed to open Allowed file " << AllowedFile << ". "
+llvm::errs() << "Failed to open allow file " << AllowedFile << ". "
  << AllowedPatterns.getError().message() << "\n";
 return 1;
   }



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


[PATCH] D82213: [Remarks] Add callsite locations to inline remarks

2020-06-20 Thread Wenlei He via Phabricator via cfe-commits
wenlei updated this revision to Diff 272240.
wenlei added a comment.

Address David's comments, add test for nested inlinining.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82213

Files:
  clang/test/Frontend/optimization-remark-with-hotness-new-pm.c
  clang/test/Frontend/optimization-remark-with-hotness.c
  llvm/include/llvm/Analysis/InlineAdvisor.h
  llvm/lib/Analysis/InlineAdvisor.cpp
  llvm/lib/Transforms/IPO/SampleProfile.cpp
  llvm/test/Transforms/Inline/optimization-remarks-passed-yaml.ll
  llvm/test/Transforms/SampleProfile/Inputs/remarks.prof
  llvm/test/Transforms/SampleProfile/remarks.ll

Index: llvm/test/Transforms/SampleProfile/remarks.ll
===
--- llvm/test/Transforms/SampleProfile/remarks.ll
+++ llvm/test/Transforms/SampleProfile/remarks.ll
@@ -21,7 +21,8 @@
 
 ; We are expecting foo() to be inlined in main() (almost all the cycles are
 ; spent inside foo).
-; CHECK: remark: remarks.cc:13:21: inlined callee '_Z3foov' into 'main'
+; CHECK: remark: remarks.cc:13:21: _Z3foov inlined into main by profile guided inliner with (cost=130, threshold=225) at callsite main:0
+; CHECK: remark: remarks.cc:9:19: rand inlined into main by profile guided inliner with (cost=always): always inline attribute at callsite _Z3foov:6 @ main:0
 
 ; The back edge for the loop is the hottest edge in the loop subgraph.
 ; CHECK: remark: remarks.cc:6:9: most popular destination for conditional branches at remarks.cc:5:3
@@ -32,18 +33,51 @@
 ; Checking to see if YAML file is generated and contains remarks
 ;YAML:   --- !Passed
 ;YAML-NEXT:  Pass:sample-profile-inline
-;YAML-NEXT:  Name:InlineSuccess
+;YAML-NEXT:  Name:Inlined
 ;YAML-NEXT:  DebugLoc:{ File: remarks.cc, Line: 13, Column: 21 }
 ;YAML-NEXT:  Function:main
 ;YAML-NEXT:  Args:
-;YAML-NEXT:- String:  'inlined callee '''
 ;YAML-NEXT:- Callee:  _Z3foov
 ;YAML-NEXT:  DebugLoc:{ File: remarks.cc, Line: 3, Column: 0 }
-;YAML-NEXT:- String:  ''' into '''
+;YAML-NEXT:- String:  ' inlined into '
 ;YAML-NEXT:- Caller:  main
 ;YAML-NEXT:DebugLoc:{ File: remarks.cc, Line: 13, Column: 0 }
-;YAML-NEXT:- String:  
+;YAML-NEXT:- String:  ' by profile guided inliner'
+;YAML-NEXT:- String:  ' with '
+;YAML-NEXT:- String:  '(cost='
+;YAML-NEXT:- Cost:'130'
+;YAML-NEXT:- String:  ', threshold='
+;YAML-NEXT:- Threshold:   '225'
+;YAML-NEXT:- String:  ')'
+;YAML-NEXT:- String:  ' at callsite '
+;YAML-NEXT:- String:  main
+;YAML-NEXT:- String:  ':'
+;YAML-NEXT:- Line:'0'
 ;YAML-NEXT:  ...
+;YAML:   --- !Passed
+;YAML-NEXT:  Pass:sample-profile-inline
+;YAML-NEXT:  Name:AlwaysInline
+;YAML-NEXT:  DebugLoc:{ File: remarks.cc, Line: 9, Column: 19 }
+;YAML-NEXT:  Function:main
+;YAML-NEXT:  Args:
+;YAML-NEXT:- Callee:  rand
+;YAML-NEXT:  DebugLoc:{ File: remarks.cc, Line: 90, Column: 0 }
+;YAML-NEXT:- String:  ' inlined into '
+;YAML-NEXT:- Caller:  main
+;YAML-NEXT:  DebugLoc:{ File: remarks.cc, Line: 13, Column: 0 }
+;YAML-NEXT:- String:  ' by profile guided inliner'
+;YAML-NEXT:- String:  ' with '
+;YAML-NEXT:- String:  '(cost=always)'
+;YAML-NEXT:- String:  ': '
+;YAML-NEXT:- Reason:  always inline attribute
+;YAML-NEXT:- String:  ' at callsite '
+;YAML-NEXT:- String:  _Z3foov
+;YAML-NEXT:- String:  ':'
+;YAML-NEXT:- Line:'6'
+;YAML-NEXT:- String:  ' @ '
+;YAML-NEXT:- String:  main
+;YAML-NEXT:- String:  ':'
+;YAML-NEXT:- Line:'0'
 ;YAML:  --- !Analysis
 ;YAML-NEXT:  Pass:sample-profile
 ;YAML-NEXT:  Name:AppliedSamples
@@ -139,7 +173,9 @@
 declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
 
 ; Function Attrs: nounwind
-declare i32 @rand() #3
+define i32 @rand() #3 !dbg !59 {
+  ret i32 1
+}
 
 ; Function Attrs: nounwind argmemonly
 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
@@ -158,7 +194,7 @@
 attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" "use-sample-profile" }
 attributes #1 = { nounwind argmemonly }
 attributes #2 = { nounwind readnone }
-attributes #3 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none"