[PATCH] D31387: MachineVerifier: avoid reference to nullptr

Sven van Haastregt via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 08:38:37 PDT 2017


On 29/03/17 16:05, David Blaikie wrote:
>
> On Wed, Mar 29, 2017 at 2:20 AM Sven van Haastregt via Phabricator
> <reviews at reviews.llvm.org <mailto:reviews at reviews.llvm.org>> wrote:
>
>     Index: llvm/trunk/lib/CodeGen/MachineVerifier.cpp
>     ===================================================================
>     --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp
>     +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp
>     @@ -260,8 +260,8 @@
>           static char ID; // Pass ID, replacement for typeid
>           const std::string Banner;
>
>     -    MachineVerifierPass(const std::string &banner = nullptr)
>     -      : MachineFunctionPass(ID), Banner(banner) {
>     +    MachineVerifierPass(const std::string banner = std::string())
>
>
> Now that this is a value, the 'const' here is incorrect/pessimizing and will
> prevent the std::move from being effective (it's not possible to move from a
> const object). Please remove it. :)

Sorry, I overlooked that; thanks for spotting it!

Fixed in r298999.

Sven
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the llvm-commits mailing list