Page MenuHomePhabricator

ziangwan (Ziang Wan)
User

Projects

User does not belong to any projects.

User Details

User Since
Jun 4 2019, 3:37 PM (11 w, 4 d)

Recent Activity

Wed, Aug 7

ziangwan updated the diff for D65549: [Sema] Prevent -Wunused-lambda-capture from generating false positive warnings on templated member function.

Fix style issue.

Wed, Aug 7, 3:10 PM · Restricted Project, Restricted Project

Sun, Aug 4

ziangwan changed the repository for D65549: [Sema] Prevent -Wunused-lambda-capture from generating false positive warnings on templated member function from rC Clang to rL LLVM.
Sun, Aug 4, 6:24 PM · Restricted Project, Restricted Project
ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

The warning is actually correct here. This implicit integral to float conversion loses precision. Is it the intended behavior of the code? If so, we can simply add an explicit type cast to silence the warning.

I don't really know. Hence, I added author of the code and libc++ maintainers as subscribers. Do you think I should open a bug for it too?

Sun, Aug 4, 12:02 PM · Restricted Project, Restricted Project

Fri, Aug 2

ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
Fri, Aug 2, 3:28 PM · Restricted Project, Restricted Project
ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

The two failing cases I am seeing are:

/home/motus/netbsd8/netbsd8/llvm/projects/libcxx/include/random:3648:40: error: implicit conversion from 'unsigned long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion]
    const _RealType _Rp = _URNG::max() - _URNG::min() + _RealType(1);
/data/motus/netbsd8/netbsd8/llvm/projects/libcxx/test/std/numerics/rand/rand.util/rand.util.canonical/generate_canonical.pass.cpp:27:64: error: implicit conversion from 'unsigned int' to 'float' changes value from 2147483645 to 2147483648 [-Werror,-Wimplicit-int-float-conversion]
        assert(f == truncate_fp((16807 - E::min()) / (E::max() - E::min() + F(1))));

These are the intended behavior of this warning.

Fri, Aug 2, 2:36 PM · Restricted Project, Restricted Project
ziangwan retitled D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss from [Sema] Enable -Wimplicit-float-conversion for integral to floating point precision loss to [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
Fri, Aug 2, 2:29 PM · Restricted Project, Restricted Project
ziangwan updated the summary of D65549: [Sema] Prevent -Wunused-lambda-capture from generating false positive warnings on templated member function.
Fri, Aug 2, 1:29 PM · Restricted Project, Restricted Project

Wed, Jul 31

ziangwan retitled D65184: [Sema] Thread Safety Analysis: Make negative capability typeless. from [Sema] Thread Safety Analysis: Fix negative capability's LockKind representation. to [Sema] Thread Safety Analysis: Make negative capability typeless..
Wed, Jul 31, 6:47 PM · Restricted Project
ziangwan committed rG7f62ff911406: [Sema] Enable -Wimplicit-float-conversion for integral to floating point… (authored by ziangwan).
[Sema] Enable -Wimplicit-float-conversion for integral to floating point…
Wed, Jul 31, 6:42 PM
ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Fixed.

Wed, Jul 31, 6:42 PM · Restricted Project, Restricted Project
ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Buildbot failed for x86_64 target. Fix in progress.

Wed, Jul 31, 6:14 PM · Restricted Project, Restricted Project
ziangwan committed rG87b668befe19: [Sema] Enable -Wimplicit-float-conversion for integral to floating point… (authored by ziangwan).
[Sema] Enable -Wimplicit-float-conversion for integral to floating point…
Wed, Jul 31, 5:19 PM
ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

I have committed this patch. I will stay diligent in case anything fails.

Wed, Jul 31, 5:19 PM · Restricted Project, Restricted Project
ziangwan edited reviewers for D65549: [Sema] Prevent -Wunused-lambda-capture from generating false positive warnings on templated member function, added: arphaman; removed: stephenkelly.
Wed, Jul 31, 5:07 PM · Restricted Project, Restricted Project
ziangwan created D65549: [Sema] Prevent -Wunused-lambda-capture from generating false positive warnings on templated member function.
Wed, Jul 31, 5:06 PM · Restricted Project, Restricted Project

Tue, Jul 30

ziangwan added inline comments to D65184: [Sema] Thread Safety Analysis: Make negative capability typeless..
Tue, Jul 30, 2:17 PM · Restricted Project
ziangwan added inline comments to D65184: [Sema] Thread Safety Analysis: Make negative capability typeless..
Tue, Jul 30, 11:26 AM · Restricted Project
ziangwan added inline comments to D65184: [Sema] Thread Safety Analysis: Make negative capability typeless..
Tue, Jul 30, 11:25 AM · Restricted Project
ziangwan added a comment to D65184: [Sema] Thread Safety Analysis: Make negative capability typeless..
Tue, Jul 30, 11:24 AM · Restricted Project
ziangwan added inline comments to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
Tue, Jul 30, 11:16 AM · Restricted Project, Restricted Project

Mon, Jul 29

ziangwan added inline comments to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
Mon, Jul 29, 10:35 AM · Restricted Project, Restricted Project

Fri, Jul 26

ziangwan updated the diff for D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Fix typos.

Fri, Jul 26, 3:17 PM · Restricted Project, Restricted Project
ziangwan updated the diff for D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Update diff.

Fri, Jul 26, 1:51 PM · Restricted Project, Restricted Project
ziangwan added inline comments to D65184: [Sema] Thread Safety Analysis: Make negative capability typeless..
Fri, Jul 26, 10:56 AM · Restricted Project

Jul 25 2019

ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

My bad. I omit these two test cases. I apologize for my carelessness.

Jul 25 2019, 10:32 AM · Restricted Project, Restricted Project

Jul 24 2019

ziangwan updated the diff for D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Update diff.

Jul 24 2019, 9:11 PM · Restricted Project, Restricted Project
ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

I'm seeing some test failures which appear to have been introduced by this change:

******************** TEST 'Clang :: CXX/dcl.decl/dcl.init/dcl.init.list/p7-0x.cpp' FAILED ********************
Script:
--
: 'RUN: at line 1';   /b/s/w/ir/k/recipe_cleanup/clango5zn3b/llvm_build_dir/bin/clang -cc1 -internal-isystem /b/s/w/ir/k/recipe_cleanup/clango5zn3b/llvm_build_dir/lib/clang/10.0.0/include -nostdsysteminc -fsyntax-only -std=c++11 -triple x86_64-apple-macosx10.6.7 -verify /b/s/w/ir/k/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-0x.cpp
--
Exit Code: 1

Command Output (stderr):
--
error: 'warning' diagnostics seen but not expected: 
  File /b/s/w/ir/k/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-0x.cpp Line 136: implicit conversion from 'int' to 'float' changes value from 123456789 to 123456792
  File /b/s/w/ir/k/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-0x.cpp Line 138: implicit conversion from 'int' to 'float' changes value from 123456789 to 123456792
2 errors generated.

--

********************
Testing: 0 .
FAIL: Clang :: CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp (1096 of 15293)
******************** TEST 'Clang :: CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp' FAILED ********************
Script:
--
: 'RUN: at line 1';   /b/s/w/ir/k/recipe_cleanup/clango5zn3b/llvm_build_dir/bin/clang -cc1 -internal-isystem /b/s/w/ir/k/recipe_cleanup/clango5zn3b/llvm_build_dir/lib/clang/10.0.0/include -nostdsysteminc -fsyntax-only -std=c++11 -Wno-error=c++11-narrowing -triple x86_64-apple-macosx10.6.7 -verify /b/s/w/ir/k/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp
: 'RUN: at line 2';   /b/s/w/ir/k/recipe_cleanup/clango5zn3b/llvm_build_dir/bin/clang -cc1 -internal-isystem /b/s/w/ir/k/recipe_cleanup/clango5zn3b/llvm_build_dir/lib/clang/10.0.0/include -nostdsysteminc -fsyntax-only -std=c++11 -Wno-error=narrowing -triple x86_64-apple-macosx10.6.7 -verify /b/s/w/ir/k/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp
--
Exit Code: 1

Command Output (stderr):
--
error: 'warning' diagnostics seen but not expected: 
  File /b/s/w/ir/k/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp Line 124: implicit conversion from 'int' to 'float' changes value from 123456789 to 123456792
  File /b/s/w/ir/k/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp Line 126: implicit conversion from 'int' to 'float' changes value from 123456789 to 123456792
2 errors generated.

--
Jul 24 2019, 7:45 PM · Restricted Project, Restricted Project
ziangwan committed rG2028d97d09b8: [Sema] Enable -Wimplicit-float-conversion for integral to floating point… (authored by ziangwan).
[Sema] Enable -Wimplicit-float-conversion for integral to floating point…
Jul 24 2019, 5:35 PM
ziangwan updated the diff for D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Update diff.

Jul 24 2019, 3:42 PM · Restricted Project, Restricted Project
ziangwan retitled D65184: [Sema] Thread Safety Analysis: Make negative capability typeless. from [Sema] Fix negative capability's LockKind representation. to [Sema] Thread Safety Analysis: Fix negative capability's LockKind representation..
Jul 24 2019, 2:22 PM · Restricted Project
ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
In D64666#1598194, @jfb wrote:

Thanks, the update looks good.

One thing I just noticed: if I have a codebase with -Wimplicit-float-conversion it seems like updating clang will automatically turn the two new warnings on, correct? That seems good, but also difficult to roll out because I can't turns off just the two new warnings. In other words, if I want to adopt a new clang and I had -Wimplicit-float-conversion then the only options I have are: fix all the new warnings (which might take time given how much code I have), or turn off *all* of -Wimplicit-float-conversion. I think it makes sense to force fixing all warnings for the warning that's always a problem warn_impcast_integer_float_precision_constant, but for warn_impcast_integer_float_precision it would be nice if there were a -Wno-* which disables only warn_impcast_integer_float_precision and nothing else.
This would make it way easier to roll out a new clang.

Jul 24 2019, 10:14 AM · Restricted Project, Restricted Project

Jul 23 2019

ziangwan created D65184: [Sema] Thread Safety Analysis: Make negative capability typeless..
Jul 23 2019, 7:42 PM · Restricted Project
ziangwan updated the diff for D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Update diff.

Jul 23 2019, 4:37 PM · Restricted Project, Restricted Project
ziangwan added inline comments to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
Jul 23 2019, 3:40 PM · Restricted Project, Restricted Project
ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
In D64666#1597627, @jfb wrote:

I think we should warn in that case even if GCC does not warn.

Strong +1.

Sorry if the phrasing was misleading: if we know for a fact that there's a problem, we should warn unconditionally. If we don't know for a fact then the warning should *not* be enabled by -Wall nor -Wextra. I don't really care what GCC does by default, LLVM doesn't have to match every single thing. That being said, if LLVM behaves differently then maybe the flag name should be different.

Final review ping.

Please be sure to give reviewers enough time to respond to comments before pinging a review.

Indeed. You haven't answered my first comment, I'd expect you to do so and not "final ping" anything. I'm not saying you must do what I say, just that you must answer comments, not ignore them.

Jul 23 2019, 10:20 AM · Restricted Project, Restricted Project

Jul 22 2019

ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Final review ping.

Jul 22 2019, 8:36 PM · Restricted Project, Restricted Project
ziangwan updated the diff for D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Update diff

Jul 22 2019, 8:19 PM · Restricted Project, Restricted Project
ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

@jfb’s comment is not addressed yet.

In D64666#1583629, @jfb wrote:

I think you want to default-ignore the "may lose precision" warnings, but not the ones that you know always lose precision.

Jul 22 2019, 4:12 PM · Restricted Project, Restricted Project
ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Ping. I am going to submit this patch if nobody objects.

Jul 22 2019, 2:34 PM · Restricted Project, Restricted Project

Jul 16 2019

ziangwan added inline comments to D64427: [Test-Suite] Support Cross-Compilation and Cross-execution targeting arm64-linux-android.
Jul 16 2019, 3:57 PM · Restricted Project
ziangwan updated the diff for D64427: [Test-Suite] Support Cross-Compilation and Cross-execution targeting arm64-linux-android.

Update diff.

Jul 16 2019, 3:57 PM · Restricted Project
ziangwan added inline comments to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
Jul 16 2019, 10:42 AM · Restricted Project, Restricted Project

Jul 15 2019

ziangwan updated the diff for D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Update diff.

Jul 15 2019, 12:03 PM · Restricted Project, Restricted Project

Jul 13 2019

ziangwan added inline comments to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
Jul 13 2019, 7:10 PM · Restricted Project, Restricted Project
ziangwan updated the diff for D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Update diff:

Jul 13 2019, 7:00 PM · Restricted Project, Restricted Project

Jul 12 2019

ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

You can check also https://reviews.llvm.org/D52835. I hit there issue which I didn't know how to solve.

Hi David,

Can you elaborate what issues you encountered? Thank you.

I had duplicated warning for C++11+ - my new warning and C++11’s narrowing warning.

Did you run ‘ninja check-clang’?

Jul 12 2019, 5:20 PM · Restricted Project, Restricted Project
ziangwan added inline comments to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
Jul 12 2019, 3:05 PM · Restricted Project, Restricted Project
ziangwan added inline comments to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
Jul 12 2019, 3:04 PM · Restricted Project, Restricted Project
ziangwan updated the diff for D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Fix spelling / comment / naming issues.

Jul 12 2019, 3:01 PM · Restricted Project, Restricted Project
ziangwan retitled D64427: [Test-Suite] Support Cross-Compilation and Cross-execution targeting arm64-linux-android from LLVM Test-Suite: Support Cross-Compilation and Cross-execution targeting arm64-linux-android to [Test-Suite] Support Cross-Compilation and Cross-execution targeting arm64-linux-android.
Jul 12 2019, 2:45 PM · Restricted Project
ziangwan retitled D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss from Allow Clang -Wconversion, -Wimplicit-float-conversion warns about integer type -> floating point type implicit conversion precision loss. to [Sema] Enable -Wimplicit-float-conversion for integral to floating point precision loss.
Jul 12 2019, 2:44 PM · Restricted Project, Restricted Project
ziangwan added a comment to D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

You can check also https://reviews.llvm.org/D52835. I hit there issue which I didn't know how to solve.

Jul 12 2019, 2:41 PM · Restricted Project, Restricted Project
ziangwan updated the diff for D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.

Removed patch.patch.

Jul 12 2019, 2:25 PM · Restricted Project, Restricted Project
ziangwan updated the summary of D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
Jul 12 2019, 2:22 PM · Restricted Project, Restricted Project
ziangwan created D64666: [Sema] Enable -Wimplicit-int-float-conversion for integral to floating point precision loss.
Jul 12 2019, 2:18 PM · Restricted Project, Restricted Project

Jul 11 2019

ziangwan added inline comments to D64427: [Test-Suite] Support Cross-Compilation and Cross-execution targeting arm64-linux-android.
Jul 11 2019, 3:50 PM · Restricted Project
ziangwan added inline comments to D64427: [Test-Suite] Support Cross-Compilation and Cross-execution targeting arm64-linux-android.
Jul 11 2019, 2:38 PM · Restricted Project
ziangwan added inline comments to D64427: [Test-Suite] Support Cross-Compilation and Cross-execution targeting arm64-linux-android.
Jul 11 2019, 1:21 PM · Restricted Project
ziangwan added inline comments to D64427: [Test-Suite] Support Cross-Compilation and Cross-execution targeting arm64-linux-android.
Jul 11 2019, 10:31 AM · Restricted Project

Jul 10 2019

ziangwan added inline comments to D64427: [Test-Suite] Support Cross-Compilation and Cross-execution targeting arm64-linux-android.
Jul 10 2019, 1:46 PM · Restricted Project
ziangwan updated the diff for D64427: [Test-Suite] Support Cross-Compilation and Cross-execution targeting arm64-linux-android.

Update diff:

  1. Have a workaround inside top-level CMakeLists.txt to set TARGET_OS to Android.
  2. Test against TARGET_OS instead of TEST_SUITE_REMOTE_CLIENT in the build system.
  3. lit.site.cfg.in: remove the double quote around @TEST_SUITE_PROFILE_GENERATE@.
Jul 10 2019, 1:41 PM · Restricted Project

Jul 9 2019

Herald updated subscribers of D64427: [Test-Suite] Support Cross-Compilation and Cross-execution targeting arm64-linux-android.
Jul 9 2019, 11:48 AM · Restricted Project
ziangwan created D64427: [Test-Suite] Support Cross-Compilation and Cross-execution targeting arm64-linux-android.
Jul 9 2019, 10:31 AM · Restricted Project

Jun 28 2019

ziangwan accepted D63822: [Driver] Fix style issues of --print-supported-cpus.

LGTM

Jun 28 2019, 10:09 AM · Restricted Project, Restricted Project

Jun 26 2019

ziangwan added a comment to D63822: [Driver] Fix style issues of --print-supported-cpus.

Hey @MaskRay , can you explain why we should remove --print-supported-cpus. There already are similar options in clang such as --print-effective-triple and --print-libgcc-file-name. On the other hand, I almost never see an option goes like -xxx=?.

Jun 26 2019, 9:34 AM · Restricted Project, Restricted Project

Jun 25 2019

ziangwan added a comment to rGaf857b93df36: Add --print-supported-cpus flag for clang..

Reviewed at https://reviews.llvm.org/D63105. Forgot to link it. Sorry.

Jun 25 2019, 5:06 PM
ziangwan committed rGde94ac935775: print-supported-cpus quality of life patch. (authored by ziangwan).
print-supported-cpus quality of life patch.
Jun 25 2019, 4:58 PM

Jun 17 2019

ziangwan added a comment to D63105: Add --print-supported-cpus flag for clang..

This option is useful but may be hard to discover. Will something like -march=? and -mtune=? make the feature more discoverable?

That's a good idea. Currently, my change has nothing to do with -march or -mtune. I might work on that later.

Jun 17 2019, 9:39 AM · Restricted Project

Jun 14 2019

ziangwan added a comment to D63105: Add --print-supported-cpus flag for clang..

@dyung I pushed another commit to fix the test. Let me know if the problem persists.

Jun 14 2019, 4:44 PM · Restricted Project
ziangwan committed rG9a2e7784b158: Fixed the --print-supported-cpus test (authored by ziangwan).
Fixed the --print-supported-cpus test
Jun 14 2019, 4:32 PM
ziangwan added a comment to D63105: Add --print-supported-cpus flag for clang..

I am working on fixing the test file right now. I will add REQUIRES: x86-registered-target and REQUIRES: arm-registered-target before each test correspondingly.

Jun 14 2019, 4:21 PM · Restricted Project
ziangwan committed rGaf857b93df36: Add --print-supported-cpus flag for clang. (authored by ziangwan).
Add --print-supported-cpus flag for clang.
Jun 14 2019, 2:41 PM
ziangwan closed D63105: Add --print-supported-cpus flag for clang..

Committed. SVN Revision: 363464.

Jun 14 2019, 2:41 PM · Restricted Project

Jun 12 2019

ziangwan added inline comments to D63105: Add --print-supported-cpus flag for clang..
Jun 12 2019, 2:44 PM · Restricted Project
ziangwan updated the diff for D63105: Add --print-supported-cpus flag for clang..

Adjust the docs: remove the redundant -mcpu flag. Add an explanation for --print-supported-cpus.
Replace one manual delete with std::unique_ptr.
Use None for an llvm::Optional value.
Add one more test case.
Adjust the message printout to include the usage of -mtune.

Jun 12 2019, 2:41 PM · Restricted Project

Jun 11 2019

ziangwan updated the diff for D63105: Add --print-supported-cpus flag for clang..

Add full context. Change the name of the static variable from "Printed" to "PrintOnce". Add a newline for the test file.

Jun 11 2019, 4:36 PM · Restricted Project

Jun 10 2019

ziangwan updated the summary of D63105: Add --print-supported-cpus flag for clang..
Jun 10 2019, 4:11 PM · Restricted Project
ziangwan created D63105: Add --print-supported-cpus flag for clang..
Jun 10 2019, 4:11 PM · Restricted Project