diff options
author | Chris Lattner <sabre@nondot.org> | 2005-10-14 03:54:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-10-14 03:54:49 +0000 |
commit | 75ee2eb4e20f74a14ebb78aad03b15555c53043d (patch) | |
tree | f2f727738cf3ab35ca1446ceb959557951680faa | |
parent | 216def8ecfb8d2b03520a4fe004d498ad7b8b1c9 (diff) | |
download | external_llvm-75ee2eb4e20f74a14ebb78aad03b15555c53043d.zip external_llvm-75ee2eb4e20f74a14ebb78aad03b15555c53043d.tar.gz external_llvm-75ee2eb4e20f74a14ebb78aad03b15555c53043d.tar.bz2 |
Do not let getLegalValueTypes return a list with duplicates in it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23723 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/TableGen/CodeGenTarget.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index f0fdeae..1b3605a 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -19,6 +19,7 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/Support/CommandLine.h" #include <set> +#include <algorithm> using namespace llvm; static cl::opt<unsigned> @@ -179,6 +180,12 @@ void CodeGenTarget::ReadLegalValueTypes() const { const std::vector<CodeGenRegisterClass> &RCs = getRegisterClasses(); for (unsigned i = 0, e = RCs.size(); i != e; ++i) LegalValueTypes.push_back(RCs[i].VT); + + // Remove duplicates. + std::sort(LegalValueTypes.begin(), LegalValueTypes.end()); + LegalValueTypes.erase(std::unique(LegalValueTypes.begin(), + LegalValueTypes.end()), + LegalValueTypes.end()); } |