mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-03 14:31:10 +00:00
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
This commit is contained in:
parent
216def8ecf
commit
75ee2eb4e2
@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user