nouveau: Drop C++03 compat code

Mesa as a whole requires C++14 nowadays, so this isn't needed any more.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17307>
This commit is contained in:
M Henning
2022-06-18 16:45:53 -04:00
committed by Marge Bot
parent 184ae84a0a
commit 4ee6345d2e
8 changed files with 15 additions and 64 deletions

View File

@@ -47,7 +47,6 @@ files_libnouveau_codegen = files(
'nv50_ir_target_nv50.h',
'nv50_ir_util.cpp',
'nv50_ir_util.h',
'unordered_set.h',
'nv50_ir_emit_gv100.cpp',
'nv50_ir_emit_gv100.h',
'nv50_ir_emit_gk110.cpp',

View File

@@ -28,9 +28,9 @@
#include <stdint.h>
#include <deque>
#include <list>
#include <unordered_set>
#include <vector>
#include "unordered_set.h"
#include "nv50_ir_util.h"
#include "nv50_ir_graph.h"
@@ -751,10 +751,10 @@ public:
static inline Value *get(Iterator&);
unordered_set<ValueRef *> uses;
std::unordered_set<ValueRef *> uses;
std::list<ValueDef *> defs;
typedef unordered_set<ValueRef *>::iterator UseIterator;
typedef unordered_set<ValueRef *>::const_iterator UseCIterator;
typedef std::unordered_set<ValueRef *>::iterator UseIterator;
typedef std::unordered_set<ValueRef *>::const_iterator UseCIterator;
typedef std::list<ValueDef *>::iterator DefIterator;
typedef std::list<ValueDef *>::const_iterator DefCIterator;

View File

@@ -34,25 +34,13 @@
#include "nv50_ir_util.h"
#include "tgsi/tgsi_from_mesa.h"
#if __cplusplus >= 201103L
#include <unordered_map>
#else
#include <tr1/unordered_map>
#endif
#include <cstring>
#include <list>
#include <vector>
namespace {
#if __cplusplus >= 201103L
using std::hash;
using std::unordered_map;
#else
using std::tr1::hash;
using std::tr1::unordered_map;
#endif
using namespace nv50_ir;
int
@@ -85,9 +73,9 @@ public:
bool run();
private:
typedef std::vector<LValue*> LValues;
typedef unordered_map<unsigned, LValues> NirDefMap;
typedef unordered_map<unsigned, nir_load_const_instr*> ImmediateMap;
typedef unordered_map<unsigned, BasicBlock*> NirBlockMap;
typedef std::unordered_map<unsigned, LValues> NirDefMap;
typedef std::unordered_map<unsigned, nir_load_const_instr*> ImmediateMap;
typedef std::unordered_map<unsigned, BasicBlock*> NirBlockMap;
CacheMode convert(enum gl_access_qualifier);
TexTarget convert(glsl_sampler_dim, bool isArray, bool isShadow);

View File

@@ -437,7 +437,7 @@ NVC0LegalizePostRA::findFirstUses(
int minGPR = texi->def(0).rep()->reg.data.id;
int maxGPR = minGPR + texi->def(0).rep()->reg.size / 4 - 1;
unordered_set<const BasicBlock *> visited;
std::unordered_set<const BasicBlock *> visited;
findFirstUsesBB(minGPR, maxGPR, texi->next, texi, uses, visited);
}
@@ -445,7 +445,7 @@ void
NVC0LegalizePostRA::findFirstUsesBB(
int minGPR, int maxGPR, Instruction *start,
const Instruction *texi, std::list<TexUse> &uses,
unordered_set<const BasicBlock *> &visited)
std::unordered_set<const BasicBlock *> &visited)
{
const BasicBlock *bb = start->bb;

View File

@@ -109,7 +109,7 @@ private:
void findFirstUses(Instruction *texi, std::list<TexUse> &uses);
void findFirstUsesBB(int minGPR, int maxGPR, Instruction *start,
const Instruction *texi, std::list<TexUse> &uses,
unordered_set<const BasicBlock *> &visited);
std::unordered_set<const BasicBlock *> &visited);
void addTexUse(std::list<TexUse>&, Instruction *, const Instruction *);
const Instruction *recurseDef(const Instruction *);

View File

@@ -26,22 +26,10 @@
#include <algorithm>
#include <stack>
#include <limits>
#if __cplusplus >= 201103L
#include <unordered_map>
#else
#include <tr1/unordered_map>
#endif
namespace nv50_ir {
#if __cplusplus >= 201103L
using std::hash;
using std::unordered_map;
#else
using std::tr1::hash;
using std::tr1::unordered_map;
#endif
#define MAX_REGISTER_FILE_SIZE 256
class RegisterSet
@@ -410,12 +398,12 @@ RegAlloc::PhiMovesPass::needNewElseBlock(BasicBlock *b, BasicBlock *p)
struct PhiMapHash {
size_t operator()(const std::pair<Instruction *, BasicBlock *>& val) const {
return hash<Instruction*>()(val.first) * 31 +
hash<BasicBlock*>()(val.second);
return std::hash<Instruction*>()(val.first) * 31 +
std::hash<BasicBlock*>()(val.second);
}
};
typedef unordered_map<
typedef std::unordered_map<
std::pair<Instruction *, BasicBlock *>, Value *, PhiMapHash> PhiMap;
// Critical edges need to be split up so that work can be inserted along
@@ -1837,7 +1825,7 @@ SpillCodeInserter::run(const std::list<ValuePair>& lst)
// Keep track of which instructions to delete later. Deleting them
// inside the loop is unsafe since a single instruction may have
// multiple destinations that all need to be spilled (like OP_SPLIT).
unordered_set<Instruction *> to_del;
std::unordered_set<Instruction *> to_del;
std::list<ValueDef *> &defs = mergedDefs(lval);
for (Value::DefIterator d = defs.begin(); d != defs.end();
@@ -1887,7 +1875,7 @@ SpillCodeInserter::run(const std::list<ValuePair>& lst)
}
}
for (unordered_set<Instruction *>::const_iterator it = to_del.begin();
for (std::unordered_set<Instruction *>::const_iterator it = to_del.begin();
it != to_del.end(); ++it) {
mergedDefs.removeDefsOfInstruction(*it);
delete_Instruction(func->getProgram(), *it);

View File

@@ -94,11 +94,7 @@ public:
virtual void reset() { assert(0); } // only for graph iterators
};
#if __cplusplus >= 201103L
typedef std::unique_ptr<Iterator> IteratorRef;
#else
typedef std::auto_ptr<Iterator> IteratorRef;
#endif
class ManipIterator : public Iterator
{

View File

@@ -1,20 +0,0 @@
#ifndef __NV50_UNORDERED_SET_H__
#define __NV50_UNORDERED_SET_H__
#if (__cplusplus >= 201103L)
#include <unordered_set>
#else
#include <tr1/unordered_set>
#endif
namespace nv50_ir {
#if __cplusplus >= 201103L
using std::unordered_set;
#else
using std::tr1::unordered_set;
#endif
} // namespace nv50_ir
#endif // __NV50_UNORDERED_SET_H__