IR: Make IRBuilder uncopyable

Hiding and not implementing the copy constructor is a pre-C++11 thing.
It should also be noted that a copy constructor, as defined by the
language, contains a const qualifier on its parameter, so this wouldn't
have prevented copies from being performed.
This commit is contained in:
Lioncash 2017-01-16 18:58:38 -05:00
parent a8b2dd7fc3
commit cd12b2c55f

View File

@ -8,6 +8,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/NonCopyable.h"
namespace IREmitter namespace IREmitter
{ {
@ -227,7 +228,7 @@ InstLoc inline getOp2(InstLoc i)
return i; return i;
} }
class IRBuilder class IRBuilder final : private NonCopyable
{ {
public: public:
IRBuilder(); IRBuilder();
@ -387,8 +388,6 @@ public:
void WriteToFile(u64 codeHash); void WriteToFile(u64 codeHash);
private: private:
IRBuilder(IRBuilder&); // DO NOT IMPLEMENT
InstLoc EmitZeroOp(unsigned Opcode, unsigned extra); InstLoc EmitZeroOp(unsigned Opcode, unsigned extra);
InstLoc EmitUOp(unsigned OpCode, InstLoc Op1, unsigned extra = 0); InstLoc EmitUOp(unsigned OpCode, InstLoc Op1, unsigned extra = 0);
InstLoc EmitBiOp(unsigned OpCode, InstLoc Op1, InstLoc Op2, unsigned extra = 0); InstLoc EmitBiOp(unsigned OpCode, InstLoc Op1, InstLoc Op2, unsigned extra = 0);