vsk updated this revision to Diff 86746.
vsk edited the summary of this revision.
vsk added a comment.
- Remove a stale test case in unsigned-promotion.c.
https://reviews.llvm.org/D29369
Files:
lib/CodeGen/CGExprScalar.cpp
test/CodeGen/compound-assign-overflow.c
vsk updated this revision to Diff 86739.
vsk marked an inline comment as done.
vsk added a comment.
- Per Eli's comment: check that integers are actually widened, instead of
incorrectly assuming they are always widened. I added some test cases for this.
- Address the 'fixme' regarding
vsk marked an inline comment as done.
vsk added inline comments.
Comment at: lib/CodeGen/CGExprScalar.cpp:72
+ if (const auto *UO = dyn_cast(Op.E))
+return IsPromotedInteger(UO->getSubExpr());
+
efriedma wrote:
> Checking isPromotableIntegerType doesn't
vsk created this revision.
C requires the operands of arithmetic expressions to be promoted if
their types are smaller than an int. Ubsan emits overflow checks when
this sort of type promotion occurs, even if there is no way to actually
get an overflow with the promoted type.
This patch teaches
vsk created this revision.
Ubsan does not report UB shifts in some cases where the shift exponent
needs to be truncated to match the type of the shift base. We perform a
range check on the truncated shift amount, leading to false negatives.
Fix the issue (PR27271) by performing the range check
vsk added a comment.
Ah ok, so it sounds like a better approach would be to split the missing record
message into a separate off-by-default warning. I don't have the time to update
this diff this week, but will shoot for the next.
https://reviews.llvm.org/D28867
vsk created this revision.
Clang warns that a profile is out-of-date if it can't find a profile
record for any function in a TU. This warning is now noisy because llvm
can dead-strip functions with profiling instrumentation.
Only emit the out-of-date warning if there is an actual record
vsk added a comment.
LGTM. I'm not sure what to do for a test. Have you tried checking the IR for
the affected object file in tablegen at '-O2 -fsanitize=undefined'? If there's
an unconditional call to the ubsan handler, maybe the tablegen source could be
used to find a small reproducer?
vsk added inline comments.
Comment at: llvm/tools/clang/test/CodeGenCXX/vtable-coverage-gen.cpp:3
+// RUN: FileCheck %s < %t
+// CHECK: @_ZTV8Category = linkonce_odr unnamed_addr constant {{.*}}, comdat,
+
vsk wrote:
> ahatanak wrote:
> > I'm not sure I
vsk added inline comments.
Comment at: llvm/tools/clang/test/CodeGenCXX/vtable-coverage-gen.cpp:3
+// RUN: FileCheck %s < %t
+// CHECK: @_ZTV8Category = linkonce_odr unnamed_addr constant {{.*}}, comdat,
+
ahatanak wrote:
> I'm not sure I understood the purpose
vsk updated this revision to Diff 80960.
vsk marked 3 inline comments as done.
vsk added a comment.
- Use NSAPI's 'is-BOOL' predicate.
- Simplify test.
https://reviews.llvm.org/D27607
Files:
lib/CodeGen/CGExpr.cpp
test/CodeGenObjC/ubsan-bool.m
Index: test/CodeGenObjC/ubsan-bool.m
vsk marked 3 inline comments as done.
vsk added a comment.
Thanks for your feedback. I will updated the patch shortly.
Comment at: lib/CodeGen/CGExpr.cpp:1221
+/// Check if \p Ty is defined as BOOL in a system header. In ObjC language
+/// modes, it's safe to treat such a type
vsk created this revision.
vsk added a reviewer: ahatanak.
vsk added subscribers: kubabrecka, cfe-commits.
On some Apple platforms, the ObjC BOOL type is defined as a signed char.
When performing instrumentation for -fsanitize=bool, we'd like to treat
the range of BOOL like it's always {0, 1}.
vsk added a comment.
Looks good. Apart from some nitpicks, I'm happy with this. This isn't really my
area so it'd be good to get an explicit lgtm from one of the reviewers.
Comment at: tools/clang-import-test/CMakeLists.txt:7
+ clang-import-test.cpp
+ )
+
vsk added a comment.
Thanks for working on this! I'm happy with the direction of this patch. It
makes sense that clang would have a tool to help test AST reconstruction from
'external' sources. As you pointed out, it provides a good avenue for clients
of the clang AST's to get better test
vsk accepted this revision.
vsk added a reviewer: vsk.
vsk added a comment.
This revision is now accepted and ready to land.
Thanks for working on this. LGTM with a nit.
Comment at: lib/CodeGen/CGExpr.cpp:2506
+ assert(CheckHandler >= 0 &&
+ CheckHandler <
601 - 616 of 616 matches
Mail list logo