[llvm] r253955 - [TableGen] Use array_pod_sort. NFC

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 16:28:57 PST 2015


On Mon, Nov 23, 2015 at 10:22 PM, Craig Topper via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: ctopper
> Date: Tue Nov 24 00:22:43 2015
> New Revision: 253955
>
> URL: http://llvm.org/viewvc/llvm-project?rev=253955&view=rev
> Log:
> [TableGen] Use array_pod_sort. NFC
>
> Modified:
>     llvm/trunk/utils/TableGen/CodeGenTarget.cpp
>
> Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.cpp?rev=253955&r1=253954&r2=253955&view=diff
>
> ==============================================================================
> --- llvm/trunk/utils/TableGen/CodeGenTarget.cpp (original)
> +++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp Tue Nov 24 00:22:43 2015
> @@ -217,7 +217,8 @@ CodeGenRegBank &CodeGenTarget::getRegBan
>
>  void CodeGenTarget::ReadRegAltNameIndices() const {
>    RegAltNameIndices = Records.getAllDerivedDefinitions("RegAltNameIndex");
> -  std::sort(RegAltNameIndices.begin(), RegAltNameIndices.end(),
> LessRecord());
> +  array_pod_sort(RegAltNameIndices.begin(), RegAltNameIndices.end(),
> +                 LessRecord());
>  }
>

array_pod_sort with an explicit comparator takes a qsort-like comparator,
so this is probably not behaving as intended.

-- Sean Silva


>
>  /// getRegisterByName - If there is a register with the specific AsmName,
> @@ -253,7 +254,7 @@ void CodeGenTarget::ReadLegalValueTypes(
>      LegalValueTypes.insert(LegalValueTypes.end(), RC.VTs.begin(),
> RC.VTs.end());
>
>    // Remove duplicates.
> -  std::sort(LegalValueTypes.begin(), LegalValueTypes.end());
> +  array_pod_sort(LegalValueTypes.begin(), LegalValueTypes.end());
>    LegalValueTypes.erase(std::unique(LegalValueTypes.begin(),
>                                      LegalValueTypes.end()),
>                          LegalValueTypes.end());
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151124/1e6a4154/attachment.html>


More information about the llvm-commits mailing list