23#ifndef TVM_IR_LOCATION_H_
24#define TVM_IR_LOCATION_H_
26#include <tvm/ffi/container/array.h>
27#include <tvm/ffi/function.h>
28#include <tvm/ffi/reflection/registry.h>
52 namespace refl = tvm::ffi::reflection;
74 explicit SourceName(ffi::UnsafeInit tag, ffi::ObjectPtr<SourceNameObj> n) : ffi::ObjectRef(tag) {
129 namespace refl = tvm::ffi::reflection;
130 refl::ObjectDef<SourceLocObj>()
160 namespace refl = tvm::ffi::reflection;
161 refl::ObjectDef<CallSiteLocObj>()
#define TVM_TIRX_DLL
Definition base.h:55
The location of a callee together with its caller's provenance.
Definition location.h:154
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("ir.CallSiteLoc", CallSiteLocObj, LocationObj)
Location callee
Definition location.h:156
static void RegisterReflection()
Definition location.h:159
Location caller
Definition location.h:157
Explicit inline callee/caller provenance.
Definition location.h:170
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(CallSiteLoc, Location, CallSiteLocObj)
TVM_TIRX_DLL CallSiteLoc(Location callee, Location caller)
Base class for immutable source-location metadata.
Definition location.h:82
TVM_FFI_DECLARE_OBJECT_INFO("ir.Location", LocationObj, ffi::Object)
static void RegisterReflection()
Definition location.h:84
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition location.h:86
Non-nullable source-location metadata.
Definition location.h:91
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Location, ffi::ObjectRef, LocationObj)
A range in one source, retaining frontend coordinate conventions.
Definition location.h:113
int start_line
The starting line number.
Definition location.h:120
int start_column
The starting column offset.
Definition location.h:122
SourceName source_name
The source name.
Definition location.h:118
SourceLocObj(SourceName source_name)
Definition location.h:115
int end_column
The ending column offset.
Definition location.h:126
SourceLocObj(ffi::UnsafeInit tag)
Definition location.h:116
static void RegisterReflection()
Definition location.h:128
int end_line
The ending line number.
Definition location.h:124
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("ir.SourceLoc", SourceLocObj, LocationObj)
A concrete source range.
Definition location.h:142
TVM_TIRX_DLL SourceLoc Merge(const SourceLoc &other) const
Merge two ranges in the same source.
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(SourceLoc, Location, SourceLocObj)
TVM_TIRX_DLL SourceLoc(SourceName source_name, int start_line, int start_column, int end_line, int end_column)
The name of a source fragment.
Definition location.h:46
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("ir.SourceName", SourceNameObj, ffi::Object)
ffi::String name
The source name.
Definition location.h:49
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition location.h:56
static void RegisterReflection()
Definition location.h:51
The source name of a file loc.
Definition location.h:64
SourceName(ffi::UnsafeInit tag, ffi::ObjectPtr< SourceNameObj > n)
Definition location.h:74
static TVM_TIRX_DLL SourceName Get(const ffi::String &name)
Get an SourceName for a given operator name. Will raise an error if the source name has not been regi...
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(SourceName, ffi::ObjectRef, SourceNameObj)
No source-location information is available.
Definition location.h:97
static void RegisterReflection()
Definition location.h:99
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("ir.UnknownLoc", UnknownLocObj, LocationObj)
Reference to the shared immutable unknown location.
Definition location.h:105
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(UnknownLoc, Location, UnknownLocObj)
TVM_TIRX_DLL UnknownLoc()
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analysis.h:41