@@ -70,7 +70,7 @@ def Nbdl_Store : TypeDef<Nbdl_Dialect, "Store", []> {
7070 }];
7171}
7272
73- /* FIXME Should this have member information?
73+ /* FIXME Types should only be based on corresponding concepts in nbdl.
7474def Nbdl_Struct : Nbdl_TypeBase<"Struct", "struct"> {
7575 let summary = "C++ semiregular aggregate type";
7676 let description = [{
@@ -179,7 +179,7 @@ def Nbdl_MatchOp : Nbdl_Op<"match", [Terminator, NoTerminator]> {
179179def Nbdl_OverloadOp : Nbdl_Op<"overload", []> {
180180 let description = [{
181181 In the region of a MatchOp we specify a function overload of the
182- given Nbdl_TypenameAttr using OverloadOp.
182+ given typename using OverloadOp.
183183 The body of the overload takes an argument that is the matched
184184 object and the rest of the arguments are the captures.
185185 }];
@@ -226,7 +226,7 @@ def Nbdl_MemberNameOp : Nbdl_Op<"member_name", []> {
226226
227227def Nbdl_StoreComposeOp : Nbdl_Op<"store_compose", []> {
228228 let description = [{
229- Add a store $lhs as a member to another store $rhs using a key $key
229+ Add a value $lhs as a member to another store $rhs using a key $key
230230 to access the member. The type $key will shadow any key of the same
231231 type in $rhs (ie values are not considered.)
232232
@@ -263,14 +263,22 @@ def Nbdl_ContextOp : Nbdl_Op<"context", [Symbol, IsolatedFromAbove]> {
263263 created type is a Tag.
264264 }];
265265
266- // Copying the approach used for scheme globals
267- let extraClassDeclaration = [{
268- bool isExternal() { return getBody().empty(); }
269- }];
270-
271266 let regions = (region AnyRegion:$body);
272267 let arguments = (ins StrAttr:$sym_name);
273268 let results = (outs);
269+ let extraClassDeclaration = [{
270+ bool isExternal() { return getBody().empty(); }
271+
272+ // Get the fully qualified name.
273+ // This is needed for defining template specializations.
274+ llvm::StringRef getFullName() { return getSymName(); }
275+
276+ // Get the unqualified name.
277+ llvm::StringRef getName() {
278+ llvm::StringRef SymName = getSymName();
279+ return SymName.take_back(SymName.rfind(':'));
280+ }
281+ }];
274282}
275283
276284def Nbdl_ContOp : Nbdl_Op<"cont", [Terminator]> {
0 commit comments