Lines Matching defs:method

41 /// Emit the method name and argument list for the given method. If 'addThisArg'
44 static void emitMethodNameAndArgs(const InterfaceMethod &method,
47 os << method.getName() << '(';
53 << "tablegen_opaque_val" << (method.arg_empty() ? "" : ", ");
55 llvm::interleaveComma(method.getArguments(), os,
172 static void emitInterfaceMethodDoc(const InterfaceMethod &method,
174 if (std::optional<StringRef> description = method.getDescription())
181 for (auto &method : interface.getMethods()) {
182 emitInterfaceMethodDoc(method, os);
183 emitCPPType(method.getReturnType(), os);
185 emitMethodNameAndArgs(method, os, valueType, /*addThisArg=*/false,
188 // Forward to the method on the concrete operation type.
189 os << " {\n return " << implValue << "->" << method.getName() << '(';
190 if (!method.isStatic()) {
193 os << (method.arg_empty() ? "" : ", ");
196 method.getArguments(), os,
208 // Insert the method definitions.
213 // Insert the method definitions for base classes.
238 for (auto &method : interface.getMethods()) {
240 emitCPPType(method.getReturnType(), os);
241 os << "(*" << method.getName() << ")(";
242 if (!method.isStatic()) {
244 emitCPPType(valueType, os) << (method.arg_empty() ? "" : ", ");
247 method.getArguments(), os,
261 // Define an "initialize" method that allows for the initialization of the
291 [&](const InterfaceMethod &method) { os << method.getName(); });
294 // Insert each of the virtual method overrides.
295 for (auto &method : interface.getMethods()) {
296 emitCPPType(method.getReturnType(), os << " static inline ");
297 emitMethodNameAndArgs(method, os, valueType,
298 /*addThisArg=*/!method.isStatic(),
314 for (auto &method : interface.getMethods()) {
315 if (!method.getDefaultImplementation())
318 if (method.isStatic())
320 emitCPPType(method.getReturnType(), os);
321 os << method.getName() << "(";
322 if (!method.isStatic()) {
325 if (!method.arg_empty())
328 llvm::interleaveComma(method.getArguments(), os,
334 if (!method.isStatic())
347 for (auto &method : interface.getMethods()) {
349 emitCPPType(method.getReturnType(), os);
352 emitMethodNameAndArgs(method, os, valueType,
353 /*addThisArg=*/!method.isStatic(),
358 if (std::optional<StringRef> body = method.getBody()) {
359 if (method.isStatic())
367 // Forward to the method on the concrete operation type.
368 if (method.isStatic())
374 os << method.getName() << '(';
376 method.getArguments(), os,
381 for (auto &method : interface.getMethods()) {
383 emitCPPType(method.getReturnType(), os);
386 emitMethodNameAndArgs(method, os, valueType,
387 /*addThisArg=*/!method.isStatic(),
391 // Forward to the method on the concrete Model implementation.
392 if (method.isStatic())
398 os << method.getName() << '(';
399 if (!method.isStatic())
400 os << "tablegen_opaque_val" << (method.arg_empty() ? "" : ", ");
402 method.getArguments(), os,
408 for (auto &method : interface.getMethods()) {
409 if (!method.getDefaultImplementation())
413 emitCPPType(method.getReturnType(), os);
418 os << method.getName() << "(";
419 if (!method.isStatic()) {
422 if (!method.arg_empty())
425 llvm::interleaveComma(method.getArguments(), os,
431 if (!method.isStatic())
438 os << tblgen::tgfmt(method.getDefaultImplementation()->trim(),
439 method.isStatic() ? &ctx : &nonStaticMethodFmt);
458 for (auto &method : interface.getMethods()) {
460 if (method.getName() == "verifyTrait")
462 formatv("'verifyTrait' method cannot be specified as interface "
463 "method for '{0}'; use the 'verify' field instead",
465 auto defaultImpl = method.getDefaultImplementation();
469 emitInterfaceMethodDoc(method, os, " ");
470 os << " " << (method.isStatic() ? "static " : "");
471 emitCPPType(method.getReturnType(), os);
472 emitMethodNameAndArgs(method, os, valueType, /*addThisArg=*/false,
473 /*addConst=*/!isOpInterface && !method.isStatic());
502 for (auto &method : interface.getMethods()) {
503 emitInterfaceMethodDoc(method, os, " ");
504 emitCPPType(method.getReturnType(), os << " ");
505 emitMethodNameAndArgs(method, os, valueType, /*addThisArg=*/false,
557 // Insert the method declarations.
562 // Insert the method declarations for base classes.
637 for (const auto &method : interface.getMethods()) {
638 // Emit the method name.
639 os << "#### `" << method.getName() << "`\n\n```c++\n";
641 // Emit the method signature.
642 if (method.isStatic())
644 emitCPPType(method.getReturnType(), os) << method.getName() << '(';
645 llvm::interleaveComma(method.getArguments(), os,
652 if (auto description = method.getDescription())
655 // If the body is not provided, this method must be provided by the user.
656 if (!method.getBody())
657 os << "\nNOTE: This method *must* be implemented by the user.";