Replace code with equivalent satisfiesLLVMModule() function call.
authorTres Popp <tpopp@google.com>
Tue, 17 Dec 2019 15:05:06 +0000 (07:05 -0800)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 17 Dec 2019 15:05:40 +0000 (07:05 -0800)
This is a general code cleanup and should be a NFC.

PiperOrigin-RevId: 285972718

mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp

index 9201da2..9ac5645 100644 (file)
@@ -1033,9 +1033,7 @@ static LogicalResult verify(GlobalOp op) {
   if (!llvm::PointerType::isValidElementType(op.getType().getUnderlyingType()))
     return op.emitOpError(
         "expects type to be a valid element type for an LLVM pointer");
-  if (op.getParentOp() &&
-      !(op.getParentOp()->hasTrait<OpTrait::SymbolTable>() &&
-        op.getParentOp()->hasTrait<OpTrait::IsIsolatedFromAbove>()))
+  if (op.getParentOp() && !satisfiesLLVMModule(op.getParentOp()))
     return op.emitOpError("must appear at the module level");
 
   if (auto strAttr = op.getValueOrNull().dyn_cast_or_null<StringAttr>()) {