[PATCH] D77930: [llvm][NFC] Refactor uses of CallSite to CallBase - call promotion
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 13 13:00:11 PDT 2020
dblaikie added inline comments.
================
Comment at: llvm/unittests/Transforms/Utils/CallPromotionUtilsTest.cpp:95-98
+ CallBase &CB = *CI;
+ ASSERT_FALSE(CB.getCalledFunction());
+ bool IsPromoted = tryPromoteCall(CB);
EXPECT_FALSE(IsPromoted);
----------------
mtrofin wrote:
> dblaikie wrote:
> > Can probably drop the intermediate CB variable now (& just write CI->getCalledFunction() and tryPromoteCall(*CI))
> >
> > (similarly below)
> Done.
>
> Also, seems like this file would benefit from ASSERT_TRUE(pointer) -> ASSERT_NE(pointer, nullptr) (same for EXPECT_) - or is this not particularly followed?
When writing non-gtest boolean tests, I favor "if (X)" or "if (!X)" but I'm not sure what's most common across LLVM.
For gtests - yeah, I think using the most descriptive test is good from a gtest error message perspective - I don't know of any particular convention there, but I wouldn't object to/would encourage changes to go in that direction (of using the most descriptive tests).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77930/new/
https://reviews.llvm.org/D77930
More information about the llvm-commits
mailing list