This is an archive of the discontinued LLVM Phabricator instance.

Missing climits header file in MemRefUtils.h
ClosedPublic

Authored by JoeyYe_HW on Aug 9 2022, 4:14 PM.

Details

Summary

MemRefUtils.h uses UINT_MAX, which is not included in current header files list. This patch include climits to avoid compilation error in this header file.

Diff Detail

Event Timeline

JoeyYe_HW created this revision.Aug 9 2022, 4:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2022, 4:14 PM
JoeyYe_HW requested review of this revision.Aug 9 2022, 4:14 PM
ftynse added a subscriber: ftynse.Aug 10 2022, 1:27 AM

Please sort the includes alphabetically and specify the platform on which you see the compilation failure (none of those we test on seems to trigger it).

ftynse edited reviewers, added: ftynse; removed: llvm-commits.Aug 10 2022, 1:27 AM
JoeyYe_HW updated this revision to Diff 451528.Aug 10 2022, 9:47 AM

Sorts include files in alphabetic order

Please sort the includes alphabetically and specify the platform on which you see the compilation failure (none of those we test on seems to trigger it).

I can reproduce the failure with following procedures:
$ cat c.cpp
#include <mlir/ExecutionEngine/MemRefUtils.h>
$ clang++ -I$HOME/src/llvm-project/mlir/include -I$HOME/src/llvm-project/llvm/include -I$HOME/src/llvm-project/build/include -c -o c.o c.cpp
In file included from c.cpp:1:
/home/jinyun/src/llvm-project/mlir/include/mlir/ExecutionEngine/MemRefUtils.h:105:23: error: use of undeclared identifier 'UINT_MAX'

assert(sizeof(T) <= UINT_MAX && "Elemental type overflows");
                    ^

1 error generated.

ftynse accepted this revision.Aug 11 2022, 2:37 AM
This revision is now accepted and ready to land.Aug 11 2022, 2:37 AM

Thanks ftynse for accepting. But I cannot commit it myself. Can someone please help to commit?

Your patch seems malformed though. If you created a different git commit instead of squashing, the patch only contains the _second_ commit. Please reupload the patch applicable to HEAD.

JoeyYe_HW updated this revision to Diff 451864.Aug 11 2022, 8:03 AM

Diff against the latest HEAD

Your patch seems malformed though. If you created a different git commit instead of squashing, the patch only contains the _second_ commit. Please reupload the patch applicable to HEAD.

Reuploaded.

Last request, we need your name and email address as they should appear on the git commit.

(Note that using arcanist https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-command-line lets you avoid this step)

Name: Jinyun Joey Ye
Email address: jinyunye@huawei.com

I will try arc next time.

This revision was automatically updated to reflect the committed changes.