Subzero: Enable the C++11 build.
This just adds -std=c++11 to the compiler flags and fixes the resulting errors/warnings.
Later CLs can fix things related to the LLVM 3.5 merge.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3930
R=jfb@chromium.org, kschimpf@google.com
Review URL: https://codereview.chromium.org/607443003
diff --git a/src/IceOperand.h b/src/IceOperand.h
index 6a1560f..f233bec 100644
--- a/src/IceOperand.h
+++ b/src/IceOperand.h
@@ -77,6 +77,7 @@
protected:
Operand(OperandKind Kind, Type Ty)
: Ty(Ty), Kind(Kind), NumVars(0), Vars(NULL) {}
+ Operand(Operand &&O) = default;
const Type Ty;
const OperandKind Kind;
@@ -345,6 +346,7 @@
class Variable : public Operand {
Variable(const Variable &) LLVM_DELETED_FUNCTION;
Variable &operator=(const Variable &) LLVM_DELETED_FUNCTION;
+ Variable(Variable &&V) = default;
public:
static Variable *create(Cfg *Func, Type Ty, SizeT Index,
diff --git a/src/IceTypeConverter.cpp b/src/IceTypeConverter.cpp
index bfe1976..078c664b 100644
--- a/src/IceTypeConverter.cpp
+++ b/src/IceTypeConverter.cpp
@@ -17,7 +17,7 @@
namespace Ice {
-TypeConverter::TypeConverter(llvm::LLVMContext &Context) : Context(Context) {
+TypeConverter::TypeConverter(llvm::LLVMContext &Context) {
AddLLVMType(IceType_void, llvm::Type::getVoidTy(Context));
AddLLVMType(IceType_i1, llvm::IntegerType::get(Context, 1));
AddLLVMType(IceType_i8, llvm::IntegerType::get(Context, 8));
diff --git a/src/IceTypeConverter.h b/src/IceTypeConverter.h
index 81a955c..f436e43 100644
--- a/src/IceTypeConverter.h
+++ b/src/IceTypeConverter.h
@@ -61,8 +61,6 @@
llvm::Type *getLLVMVectorType(unsigned Size, Type Ty) const;
private:
- // The LLVM context to use to build LLVM types.
- llvm::LLVMContext &Context;
// The list of allowable LLVM types. Indexed by ICE type.
std::vector<llvm::Type *> LLVMTypes;
// The inverse mapping of LLVMTypes.
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index 6c0ee8a..47f6a5e 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -66,13 +66,12 @@
setErrStream(Translator.getContext()->getStrDump());
}
- virtual ~TopLevelParser() {}
- LLVM_OVERRIDE;
+ ~TopLevelParser() override {}
Ice::Translator &getTranslator() { return Translator; }
// Generates error with given Message. Always returns true.
- virtual bool Error(const std::string &Message) LLVM_OVERRIDE {
+ bool Error(const std::string &Message) override {
ErrorStatus = true;
++NumErrors;
NaClBitcodeParser::Error(Message);
@@ -281,7 +280,7 @@
// references to global variable addresses.
Type *GlobalVarPlaceHolderType;
- virtual bool ParseBlock(unsigned BlockID) LLVM_OVERRIDE;
+ bool ParseBlock(unsigned BlockID) override;
/// Reports that type ID is undefined, and then returns
/// the void type.
@@ -339,7 +338,7 @@
BlockParserBaseClass(unsigned BlockID, TopLevelParser *Context)
: NaClBitcodeParser(BlockID, Context), Context(Context) {}
- virtual ~BlockParserBaseClass() LLVM_OVERRIDE {}
+ ~BlockParserBaseClass() override {}
protected:
// The context parser that contains the decoded state.
@@ -356,7 +355,7 @@
const Ice::ClFlags &getFlags() const { return getTranslator().getFlags(); }
// Generates an error Message with the bit address prefixed to it.
- virtual bool Error(const std::string &Message) LLVM_OVERRIDE {
+ bool Error(const std::string &Message) override {
uint64_t Bit = Record.GetStartBit() + Context->getHeaderSize() * 8;
std::string Buffer;
raw_string_ostream StrBuf(Buffer);
@@ -367,11 +366,11 @@
// Default implementation. Reports that block is unknown and skips
// its contents.
- virtual bool ParseBlock(unsigned BlockID) LLVM_OVERRIDE;
+ bool ParseBlock(unsigned BlockID) override;
// Default implementation. Reports that the record is not
// understood.
- virtual void ProcessRecord() LLVM_OVERRIDE;
+ void ProcessRecord() override;
// Checks if the size of the record is Size. Return true if valid.
// Otherwise generates an error and returns false.
@@ -465,14 +464,14 @@
TypesParser(unsigned BlockID, BlockParserBaseClass *EnclosingParser)
: BlockParserBaseClass(BlockID, EnclosingParser), NextTypeId(0) {}
- ~TypesParser() LLVM_OVERRIDE {}
+ ~TypesParser() override {}
private:
// The type ID that will be associated with the next type defining
// record in the types block.
unsigned NextTypeId;
- virtual void ProcessRecord() LLVM_OVERRIDE;
+ void ProcessRecord() override;
};
void TypesParser::ProcessRecord() {
@@ -565,7 +564,7 @@
NextGlobalID = Context->getNumFunctionIDs();
}
- virtual ~GlobalsParser() LLVM_OVERRIDE {}
+ ~GlobalsParser() override {}
private:
// Holds the sequence of initializers for the global.
@@ -584,7 +583,7 @@
// The index of the next global variable.
unsigned NextGlobalID;
- virtual void ExitBlock() LLVM_OVERRIDE {
+ void ExitBlock() override {
verifyNoMissingInitializers();
unsigned NumIDs = Context->getNumGlobalValueIDs();
if (NextGlobalID < NumIDs) {
@@ -598,7 +597,7 @@
BlockParserBaseClass::ExitBlock();
}
- virtual void ProcessRecord() LLVM_OVERRIDE;
+ void ProcessRecord() override;
// Checks if the number of initializers needed is the same as the
// number found in the bitcode file. If different, and error message
@@ -773,7 +772,7 @@
ValuesymtabParser(unsigned BlockID, BlockParserBaseClass *EnclosingParser)
: BlockParserBaseClass(BlockID, EnclosingParser) {}
- virtual ~ValuesymtabParser() LLVM_OVERRIDE {}
+ ~ValuesymtabParser() override {}
protected:
typedef SmallString<128> StringType;
@@ -786,7 +785,7 @@
private:
- virtual void ProcessRecord() LLVM_OVERRIDE;
+ void ProcessRecord() override;
void ConvertToString(StringType &ConvertedName) {
const NaClBitcodeRecord::RecordVector &Values = Record.GetValues();
@@ -853,7 +852,7 @@
}
}
- ~FunctionParser() LLVM_OVERRIDE;
+ ~FunctionParser() override;
// Set the next constant ID to the given constant C.
void setNextConstantID(Ice::Constant *C) {
@@ -905,11 +904,11 @@
Alignment = 1;
}
- virtual bool ParseBlock(unsigned BlockID) LLVM_OVERRIDE;
+ bool ParseBlock(unsigned BlockID) override;
- virtual void ProcessRecord() LLVM_OVERRIDE;
+ void ProcessRecord() override;
- virtual void ExitBlock() LLVM_OVERRIDE;
+ void ExitBlock() override;
// Creates and appends a new basic block to the list of basic blocks.
Ice::CfgNode *InstallNextBasicBlock() { return Func->makeNode(); }
@@ -2032,7 +2031,7 @@
: BlockParserBaseClass(BlockID, FuncParser), FuncParser(FuncParser),
NextConstantType(Ice::IceType_void) {}
- ~ConstantsParser() LLVM_OVERRIDE {}
+ ~ConstantsParser() override {}
private:
// The parser of the function block this constants block appears in.
@@ -2040,7 +2039,7 @@
// The type to use for succeeding constants.
Ice::Type NextConstantType;
- virtual void ProcessRecord() LLVM_OVERRIDE;
+ void ProcessRecord() override;
Ice::GlobalContext *getContext() { return getTranslator().getContext(); }
@@ -2154,8 +2153,8 @@
return reinterpret_cast<FunctionParser *>(GetEnclosingParser());
}
- virtual void setValueName(uint64_t Index, StringType &Name) LLVM_OVERRIDE;
- virtual void setBbName(uint64_t Index, StringType &Name) LLVM_OVERRIDE;
+ void setValueName(uint64_t Index, StringType &Name) override;
+ void setBbName(uint64_t Index, StringType &Name) override;
// Reports that the assignment of Name to the value associated with
// index is not possible, for the given Context.
@@ -2221,7 +2220,7 @@
: BlockParserBaseClass(BlockID, Context),
GlobalAddressNamesAndInitializersInstalled(false) {}
- virtual ~ModuleParser() LLVM_OVERRIDE {}
+ ~ModuleParser() override {}
private:
// True if we have already instaledl names for unnamed global addresses,
@@ -2241,14 +2240,14 @@
}
}
- virtual bool ParseBlock(unsigned BlockID) LLVM_OVERRIDE;
+ bool ParseBlock(unsigned BlockID) override;
- virtual void ExitBlock() LLVM_OVERRIDE {
+ void ExitBlock() override {
InstallGlobalAddressNamesAndInitializers();
getTranslator().emitConstants();
}
- virtual void ProcessRecord() LLVM_OVERRIDE;
+ void ProcessRecord() override;
};
class ModuleValuesymtabParser : public ValuesymtabParser {
@@ -2260,11 +2259,11 @@
ModuleValuesymtabParser(unsigned BlockID, ModuleParser *MP)
: ValuesymtabParser(BlockID, MP) {}
- virtual ~ModuleValuesymtabParser() LLVM_OVERRIDE {}
+ ~ModuleValuesymtabParser() override {}
private:
- virtual void setValueName(uint64_t Index, StringType &Name) LLVM_OVERRIDE;
- virtual void setBbName(uint64_t Index, StringType &Name) LLVM_OVERRIDE;
+ void setValueName(uint64_t Index, StringType &Name) override;
+ void setBbName(uint64_t Index, StringType &Name) override;
};
void ModuleValuesymtabParser::setValueName(uint64_t Index, StringType &Name) {
@@ -2287,7 +2286,7 @@
Error(StrBuf.str());
}
-bool ModuleParser::ParseBlock(unsigned BlockID) LLVM_OVERRIDE {
+bool ModuleParser::ParseBlock(unsigned BlockID) {
switch (BlockID) {
case naclbitc::BLOCKINFO_BLOCK_ID:
return NaClBitcodeParser::ParseBlock(BlockID);
diff --git a/src/assembler_ia32.h b/src/assembler_ia32.h
index b5c9a16..2dc0c12 100644
--- a/src/assembler_ia32.h
+++ b/src/assembler_ia32.h
@@ -157,7 +157,6 @@
private:
uint8_t length_;
uint8_t encoding_[6];
- uint8_t padding_;
AssemblerFixup *fixup_;
explicit Operand(GPRRegister reg) : fixup_(NULL) { SetModRM(3, reg); }