diff options
author | Simon Tatham <simon.tatham@arm.com> | 2018-07-11 08:57:56 +0000 |
---|---|---|
committer | Simon Tatham <simon.tatham@arm.com> | 2018-07-11 08:57:56 +0000 |
commit | 09f256575b4a21a6e9151d1d0cee0bb435f13e29 (patch) | |
tree | 3e50831ed03cb7e099585dec8391e650c2803680 /llvm/lib/TableGen | |
parent | 6a8c6cadf10c73f0f9caa1d53bc105f48910efd4 (diff) | |
download | bcm5719-llvm-09f256575b4a21a6e9151d1d0cee0bb435f13e29.tar.gz bcm5719-llvm-09f256575b4a21a6e9151d1d0cee0bb435f13e29.zip |
[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
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r-- | llvm/lib/TableGen/JSONBackend.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/TableGen/JSONBackend.cpp b/llvm/lib/TableGen/JSONBackend.cpp index 94fa5209715..36cb2208a29 100644 --- a/llvm/lib/TableGen/JSONBackend.cpp +++ b/llvm/lib/TableGen/JSONBackend.cpp @@ -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) { |