summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-09-03 05:49:07 +0000
committerCraig Topper <craig.topper@gmail.com>2014-09-03 05:49:07 +0000
commit5c2b4ac04513cfdea75009fe047250e961502829 (patch)
treec621d048f0f16b3dfde8df4077c3d15186cf34af
parent99ff9c7bb229d81ab3fa57360f398ffdfd3cdcd9 (diff)
downloadbcm5719-llvm-5c2b4ac04513cfdea75009fe047250e961502829.tar.gz
bcm5719-llvm-5c2b4ac04513cfdea75009fe047250e961502829.zip
Implement move constructor and remove copy constructor for Filter objects in FixedLenDecoderEmitter. Also remove unused copy constructor of FilterChooser.
llvm-svn: 217013
-rw-r--r--llvm/utils/TableGen/FixedLenDecoderEmitter.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
index 42639cc4cf9..27114cba5e5 100644
--- a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
+++ b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
@@ -252,7 +252,7 @@ public:
return *(FilterChooserMap.find((unsigned)-1)->second);
}
- Filter(const Filter &f);
+ Filter(Filter &&f);
Filter(FilterChooser &owner, unsigned startBit, unsigned numBits, bool mixed);
~Filter();
@@ -333,13 +333,9 @@ protected:
// Parent emitter
const FixedLenDecoderEmitter *Emitter;
+ FilterChooser(const FilterChooser &) LLVM_DELETED_FUNCTION;
+ void operator=(const FilterChooser &) LLVM_DELETED_FUNCTION;
public:
- FilterChooser(const FilterChooser &FC)
- : AllInstructions(FC.AllInstructions), Opcodes(FC.Opcodes),
- Operands(FC.Operands), Filters(FC.Filters),
- FilterBitValues(FC.FilterBitValues), Parent(FC.Parent),
- BestIndex(FC.BestIndex), BitWidth(FC.BitWidth),
- Emitter(FC.Emitter) { }
FilterChooser(const std::vector<const CodeGenInstruction*> &Insts,
const std::vector<unsigned> &IDs,
@@ -490,11 +486,11 @@ public:
// //
///////////////////////////
-Filter::Filter(const Filter &f)
+Filter::Filter(Filter &&f)
: Owner(f.Owner), StartBit(f.StartBit), NumBits(f.NumBits), Mixed(f.Mixed),
- FilteredInstructions(f.FilteredInstructions),
- VariableInstructions(f.VariableInstructions),
- FilterChooserMap(f.FilterChooserMap), NumFiltered(f.NumFiltered),
+ FilteredInstructions(std::move(f.FilteredInstructions)),
+ VariableInstructions(std::move(f.VariableInstructions)),
+ FilterChooserMap(std::move(f.FilterChooserMap)), NumFiltered(f.NumFiltered),
LastOpcFiltered(f.LastOpcFiltered) {
}
@@ -1384,8 +1380,7 @@ void FilterChooser::emitSingletonTableEntry(DecoderTableInfo &TableInfo,
void FilterChooser::runSingleFilter(unsigned startBit, unsigned numBit,
bool mixed) {
Filters.clear();
- Filter F(*this, startBit, numBit, true);
- Filters.push_back(F);
+ Filters.push_back(Filter(*this, startBit, numBit, true));
BestIndex = 0; // Sole Filter instance to choose from.
bestFilter().recurse();
}
OpenPOWER on IntegriCloud