mirror of
https://github.com/intel/llvm.git
synced 2026-02-03 02:26:27 +08:00
Add MLFunction::getReturnStmt.
PiperOrigin-RevId: 208514441
This commit is contained in:
committed by
jpienaar
parent
067d70f20d
commit
95c1bf445a
@@ -80,6 +80,10 @@ public:
|
||||
|
||||
~MLFunction();
|
||||
|
||||
// Return the 'return' statement of this MLFunction.
|
||||
const OperationStmt *getReturnStmt() const;
|
||||
OperationStmt *getReturnStmt();
|
||||
|
||||
/// Methods for support type inquiry through isa, cast, and dyn_cast.
|
||||
static bool classof(const Function *func) {
|
||||
return func->getKind() == Function::Kind::MLFunc;
|
||||
|
||||
@@ -152,3 +152,11 @@ void MLFunction::destroy() {
|
||||
this->~MLFunction();
|
||||
free(this);
|
||||
}
|
||||
|
||||
const OperationStmt *MLFunction::getReturnStmt() const {
|
||||
return cast<OperationStmt>(&back());
|
||||
}
|
||||
|
||||
OperationStmt *MLFunction::getReturnStmt() {
|
||||
return cast<OperationStmt>(&back());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user