From: Mehdi Amini Date: Mon, 1 Apr 2019 17:36:50 +0000 (-0700) Subject: Add a getContext() convenient accessor on mlir::Value (NFC) X-Git-Tag: llvmorg-11-init~1466^2~2059 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=005d54329ed1ea49450441df24d26faef2525438;p=platform%2Fupstream%2Fllvm.git Add a getContext() convenient accessor on mlir::Value (NFC) -- PiperOrigin-RevId: 241352789 --- diff --git a/mlir/include/mlir/IR/Value.h b/mlir/include/mlir/IR/Value.h index 948870b..30f352b 100644 --- a/mlir/include/mlir/IR/Value.h +++ b/mlir/include/mlir/IR/Value.h @@ -52,6 +52,9 @@ public: Type getType() { return typeAndKind.getPointer(); } + /// Utility to get the associated MLIRContext that this value is defined in. + MLIRContext *getContext() { return getType().getContext(); } + /// Mutate the type of this Value to be of the specified type. /// /// Note that this is an extremely dangerous operation which can create