Commit 294685 broke offset initialization in MachineLocation(unsigned R, int O)
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 1 08:32:53 PST 2017
1. Freij, thanks for catching this!
2. Eugene, if this change was possible without breaking the LLVM testsuite, it looks like we have a gap in test coverage in the code that your commit changed. Could you please take a look?
-- adrian
> On Mar 1, 2017, at 3:42 AM, Frej Drejhammar <frej at sics.se> wrote:
>
> Hi Eugene,
>
> Your SVN commit 294685 removed the initialization of the 'Offset' field
> for register-indirect MachineLocations, probably due to a mixup between
> Offset(O) and Offset(0). The attached patch restores the functionality.
>
> Cheers,
>
> --Frej
>
> From: Frej Drejhammar <frej at sics.se>
> Date: Tue, 28 Feb 2017 15:51:12 +0100
> Subject: Restore offset initialization in MachineLocation(unsigned R, int O)
>
> Restore offset initialization for register-indirect MachineLocations
> as SVN commit 294685 mistakenly removed it.
>
> diff --git a/include/llvm/MC/MachineLocation.h b/include/llvm/MC/MachineLocation.h
> index 000ab2998ed..f4fc6ee2fd1 100644
> --- a/include/llvm/MC/MachineLocation.h
> +++ b/include/llvm/MC/MachineLocation.h
> @@ -36,7 +36,7 @@ public:
> /// Create a direct register location.
> explicit MachineLocation(unsigned R) : IsRegister(true), Register(R) {}
> /// Create a register-indirect location with an offset.
> - MachineLocation(unsigned R, int O) : Register(R) {}
> + MachineLocation(unsigned R, int O) : Register(R), Offset(O) {}
>
> bool operator==(const MachineLocation &Other) const {
> return IsRegister == Other.IsRegister && Register == Other.Register &&
More information about the llvm-commits
mailing list