[TableGen] Add missing std::moves to fix build failure.

gcc 4.7 seems to disagree with gcc 5.3 about whether you need to say
'return std::move(thing)' instead of just 'return thing'. All the
json::Arrays and json::Objects that I was implicitly turning into
json::Values by returning them from functions now have explicit
std::move wrappers, so hopefully 4.7 will be happy now.

llvm-svn: 336772
This commit is contained in:
Simon Tatham 2018-07-11 08:57:56 +00:00
parent 6a8c6cadf1
commit 09f256575b
1 changed files with 7 additions and 7 deletions

View File

@ -55,7 +55,7 @@ json::Value JSONEmitter::translateInit(const Init &I) {
json::Array array;
for (unsigned i = 0, limit = Bits->getNumBits(); i < limit; i++)
array.push_back(translateInit(*Bits->getBit(i)));
return array;
return std::move(array);
} else if (auto *Int = dyn_cast<IntInit>(&I)) {
return Int->getValue();
} else if (auto *Str = dyn_cast<StringInit>(&I)) {
@ -66,7 +66,7 @@ json::Value JSONEmitter::translateInit(const Init &I) {
json::Array array;
for (auto val : *List)
array.push_back(translateInit(*val));
return array;
return std::move(array);
}
// Init subclasses that we return as JSON objects containing a
@ -80,17 +80,17 @@ json::Value JSONEmitter::translateInit(const Init &I) {
if (auto *Def = dyn_cast<DefInit>(&I)) {
obj["kind"] = "def";
obj["def"] = Def->getDef()->getName();
return obj;
return std::move(obj);
} else if (auto *Var = dyn_cast<VarInit>(&I)) {
obj["kind"] = "var";
obj["var"] = Var->getName();
return obj;
return std::move(obj);
} else if (auto *VarBit = dyn_cast<VarBitInit>(&I)) {
if (auto *Var = dyn_cast<VarInit>(VarBit->getBitVar())) {
obj["kind"] = "varbit";
obj["var"] = Var->getName();
obj["index"] = VarBit->getBitNum();
return obj;
return std::move(obj);
}
} else if (auto *Dag = dyn_cast<DagInit>(&I)) {
obj["kind"] = "dag";
@ -108,7 +108,7 @@ json::Value JSONEmitter::translateInit(const Init &I) {
args.push_back(std::move(arg));
}
obj["args"] = std::move(args);
return obj;
return std::move(obj);
}
// Final fallback: anything that gets past here is simply given a
@ -117,7 +117,7 @@ json::Value JSONEmitter::translateInit(const Init &I) {
assert(!I.isConcrete());
obj["kind"] = "complex";
return obj;
return std::move(obj);
}
void JSONEmitter::run(raw_ostream &OS) {