This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Unittest for Attributor
ClosedPublic

Authored by bbn on Jul 14 2020, 1:56 AM.

Details

Summary

This patch introduces basic unittest interface for the Attributor and a simple test case for casting.

Diff Detail

Event Timeline

bbn created this revision.Jul 14 2020, 1:56 AM
Herald added a reviewer: uenoku. · View Herald Transcript
Herald added a reviewer: homerdin. · View Herald Transcript
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
jdoerfert accepted this revision.Jul 14 2020, 8:06 AM

LGTM. Merge it with D83172.

This revision is now accepted and ready to land.Jul 14 2020, 8:06 AM
This revision was automatically updated to reflect the committed changes.
asb added a subscriber: asb.Jul 14 2020, 9:07 PM

This broke the build for -DBUILD_SHARED_LIBS=True. I've committed rG5282a6186c which fixes it for me.

fhahn added a subscriber: fhahn.Jul 23 2020, 6:24 AM
fhahn added inline comments.
llvm/unittests/Transforms/IPO/AttributorTest.cpp
49

This seems to cause the following warning for the builder http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-ubuntu

/home/buildbot/as-builder-4/llvm-clang-x86_64-expensive-checks-ubuntu/llvm-project/llvm/unittests/Transforms/IPO/AttributorTest.cpp:48:61: warning: cast from type ‘const llvm::AAIsDead*’ to type ‘llvm::AbstractAttribute*’ casts away qualifiers [-Wcast-qual]

jdoerfert added inline comments.Jul 23 2020, 7:51 AM
llvm/unittests/Transforms/IPO/AttributorTest.cpp
50

This slipped through. @bbn, please don't use this kind of type punning at all. if you need to remove a const, there is const_cast. I somehow doubt you need to remove the const at all.

bbn added a comment.Jul 23 2020, 10:04 PM

Sorry, I will look into it and update soon.

bbn added a comment.Jul 26 2020, 9:52 AM

I uploaded this patch D84532 to fix it.