[PATCH] D52366: [tblgen][disasm] Separate encodings from instructions

Justin Bogner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 31 15:45:29 PDT 2018


bogner accepted this revision.
bogner added inline comments.
This revision is now accepted and ready to land.


================
Comment at: utils/TableGen/FixedLenDecoderEmitter.cpp:94-95
+
+  EncodingAndInst(const Record *EncodingDef, const CodeGenInstruction *Inst)
+      : EncodingDef(EncodingDef), Inst(Inst) {}
+};
----------------
dsanders wrote:
> bogner wrote:
> > Would simplifying by omitting this and just using brace-initialization be better?
> It's needed for std::vector<EncodingAndInst>::emplace_back(). It eventually ends up failing on the placement new inside std::allocator::construct() without it
I doubt that emplace_back() is much/any better than push_back({...}) for a simple value type like this, so I'd personally probably go with the simpler approach. It's pretty minor though.


Repository:
  rL LLVM

https://reviews.llvm.org/D52366





More information about the llvm-commits mailing list