Wrap op (de)serialization methods in anonymous namespace

It's a known bug that older GCC is not happy with method specialization in
the enclosing (global) namespace:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480

This CL wraps the generated specialization methods in the anonymous namespace
to make sure the specialization is in the same namespace as the class.

PiperOrigin-RevId: 258983181
This commit is contained in:
Lei Zhang 2019-07-19 09:31:55 -07:00 committed by Mehdi Amini
parent c253c6eb2f
commit 1331c84fe3
2 changed files with 4 additions and 0 deletions

View File

@ -462,10 +462,12 @@ LogicalResult Deserializer::processInstruction(spirv::Opcode opcode,
return dispatchToAutogenDeserialization(opcode, operands);
}
namespace {
// Pull in auto-generated Deserializer::dispatchToAutogenDeserialization() and
// various processOpImpl specializations.
#define GET_DESERIALIZATION_FNS
#include "mlir/Dialect/SPIRV/SPIRVSerialization.inc"
} // namespace
Optional<spirv::ModuleOp> spirv::deserialize(ArrayRef<uint32_t> binary,
MLIRContext *context) {

View File

@ -409,10 +409,12 @@ LogicalResult Serializer::processOperation(Operation *op) {
return dispatchToAutogenSerialization(op);
}
namespace {
// Pull in auto-generated Serializer::dispatchToAutogenSerialization() and
// various processOpImpl specializations.
#define GET_SERIALIZATION_FNS
#include "mlir/Dialect/SPIRV/SPIRVSerialization.inc"
} // namespace
LogicalResult spirv::serialize(spirv::ModuleOp module,
SmallVectorImpl<uint32_t> &binary) {