diff options
| author | River Riddle <riverriddle@google.com> | 2019-11-11 18:18:02 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-11-11 18:18:31 -0800 |
| commit | 9b9c647cefea0a81fdf7d2bf6586a13f99d9a2cf (patch) | |
| tree | 2fd6e7aeaa1e41a5e5a6355f860f35bc63ca8d99 /mlir/test/lib/TestDialect | |
| parent | 5cf6e0ce7f03f9841675b1a9d44232540f3df5cc (diff) | |
| download | bcm5719-llvm-9b9c647cefea0a81fdf7d2bf6586a13f99d9a2cf.tar.gz bcm5719-llvm-9b9c647cefea0a81fdf7d2bf6586a13f99d9a2cf.zip | |
Add support for nested symbol references.
This change allows for adding additional nested references to a SymbolRefAttr to allow for further resolving a symbol if that symbol also defines a SymbolTable. If a referenced symbol also defines a symbol table, a nested reference can be used to refer to a symbol within that table. Nested references are printed after the main reference in the following form:
symbol-ref-attribute ::= symbol-ref-id (`::` symbol-ref-id)*
Example:
module @reference {
func @nested_reference()
}
my_reference_op @reference::@nested_reference
Given that SymbolRefAttr is now more general, the existing functionality centered around a single reference is moved to a derived class FlatSymbolRefAttr. Followup commits will add support to lookups, rauw, etc. for scoped references.
PiperOrigin-RevId: 279860501
Diffstat (limited to 'mlir/test/lib/TestDialect')
| -rw-r--r-- | mlir/test/lib/TestDialect/TestOps.td | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mlir/test/lib/TestDialect/TestOps.td b/mlir/test/lib/TestDialect/TestOps.td index 4071f7e232f..2972793bf02 100644 --- a/mlir/test/lib/TestDialect/TestOps.td +++ b/mlir/test/lib/TestDialect/TestOps.td @@ -206,7 +206,7 @@ def UpdateFloatElementsAttr : Pat< def SymbolRefOp : TEST_Op<"symbol_ref_attr"> { let arguments = (ins - Confined<SymbolRefAttr, [ReferToOp<"FuncOp">]>:$symbol + Confined<FlatSymbolRefAttr, [ReferToOp<"FuncOp">]>:$symbol ); } @@ -232,7 +232,7 @@ def SizedRegionOp : TEST_Op<"sized_region_op", []> { def ConversionCallOp : TEST_Op<"conversion_call_op", [CallOpInterface]> { - let arguments = (ins Variadic<AnyType>:$inputs, SymbolRefAttr:$callee); + let arguments = (ins Variadic<AnyType>:$inputs, FlatSymbolRefAttr:$callee); let results = (outs Variadic<AnyType>); let extraClassDeclaration = [{ @@ -241,7 +241,7 @@ def ConversionCallOp : TEST_Op<"conversion_call_op", /// Return the callee of this operation. CallInterfaceCallable getCallableForCallee() { - return getAttrOfType<SymbolRefAttr>("callee"); + return getAttrOfType<FlatSymbolRefAttr>("callee"); } }]; } |

