@@ -55,10 +55,13 @@ class TargetOptions {
5555 StringRef cmdOptions = {}, StringRef elfSection = {},
5656 CompilationTarget compilationTarget = getDefaultCompilationTarget(),
5757 function_ref<SymbolTable *()> getSymbolTableCallback = {},
58- function_ref<LogicalResult(llvm::Module &)> initialLlvmIRCallback = {},
59- function_ref<LogicalResult(llvm::Module &)> linkedLlvmIRCallback = {},
60- function_ref<LogicalResult(llvm::Module &)> optimizedLlvmIRCallback = {},
61- function_ref<LogicalResult(StringRef)> isaCallback = {});
58+ function_ref<LogicalResult(Operation *op, llvm::Module &)>
59+ initialLlvmIRCallback = {},
60+ function_ref<LogicalResult(Operation *op, llvm::Module &)>
61+ linkedLlvmIRCallback = {},
62+ function_ref<LogicalResult(Operation *op, llvm::Module &)>
63+ optimizedLlvmIRCallback = {},
64+ function_ref<LogicalResult(Operation *op, StringRef)> isaCallback = {});
6265
6366 // / Returns the typeID.
6467 TypeID getTypeID () const ;
@@ -97,20 +100,22 @@ class TargetOptions {
97100
98101 // / Returns the callback invoked with the initial LLVM IR for the device
99102 // / module.
100- function_ref<LogicalResult(llvm::Module &)> getInitialLlvmIRCallback () const ;
103+ function_ref<LogicalResult(Operation *op, llvm::Module &)>
104+ getInitialLlvmIRCallback () const ;
101105
102106 // / Returns the callback invoked with LLVM IR for the device module
103107 // / after linking the device libraries.
104- function_ref<LogicalResult(llvm::Module &)> getLinkedLlvmIRCallback () const ;
108+ function_ref<LogicalResult(Operation *op, llvm::Module &)>
109+ getLinkedLlvmIRCallback () const ;
105110
106111 // / Returns the callback invoked with LLVM IR for the device module after
107112 // / LLVM optimizations but before codegen.
108- function_ref<LogicalResult(llvm::Module &)>
113+ function_ref<LogicalResult(Operation *op, llvm::Module &)>
109114 getOptimizedLlvmIRCallback () const ;
110115
111116 // / Returns the callback invoked with the target ISA for the device,
112117 // / for example PTX assembly.
113- function_ref<LogicalResult(StringRef)> getISACallback () const ;
118+ function_ref<LogicalResult(Operation *op, StringRef)> getISACallback () const ;
114119
115120 // / Returns the default compilation target: `CompilationTarget::Fatbin`.
116121 static CompilationTarget getDefaultCompilationTarget ();
@@ -128,10 +133,13 @@ class TargetOptions {
128133 StringRef elfSection = {},
129134 CompilationTarget compilationTarget = getDefaultCompilationTarget(),
130135 function_ref<SymbolTable *()> getSymbolTableCallback = {},
131- function_ref<LogicalResult(llvm::Module &)> initialLlvmIRCallback = {},
132- function_ref<LogicalResult(llvm::Module &)> linkedLlvmIRCallback = {},
133- function_ref<LogicalResult(llvm::Module &)> optimizedLlvmIRCallback = {},
134- function_ref<LogicalResult(StringRef)> isaCallback = {});
136+ function_ref<LogicalResult(Operation *op, llvm::Module &)>
137+ initialLlvmIRCallback = {},
138+ function_ref<LogicalResult(Operation *op, llvm::Module &)>
139+ linkedLlvmIRCallback = {},
140+ function_ref<LogicalResult(Operation *op, llvm::Module &)>
141+ optimizedLlvmIRCallback = {},
142+ function_ref<LogicalResult(Operation *op, StringRef)> isaCallback = {});
135143
136144 // / Path to the target toolkit.
137145 std::string toolkitPath;
@@ -154,19 +162,22 @@ class TargetOptions {
154162 function_ref<SymbolTable *()> getSymbolTableCallback;
155163
156164 // / Callback invoked with the initial LLVM IR for the device module.
157- function_ref<LogicalResult(llvm::Module &)> initialLlvmIRCallback;
165+ function_ref<LogicalResult(Operation *op, llvm::Module &)>
166+ initialLlvmIRCallback;
158167
159168 // / Callback invoked with LLVM IR for the device module after
160169 // / linking the device libraries.
161- function_ref<LogicalResult(llvm::Module &)> linkedLlvmIRCallback;
170+ function_ref<LogicalResult(Operation *op, llvm::Module &)>
171+ linkedLlvmIRCallback;
162172
163173 // / Callback invoked with LLVM IR for the device module after
164174 // / LLVM optimizations but before codegen.
165- function_ref<LogicalResult(llvm::Module &)> optimizedLlvmIRCallback;
175+ function_ref<LogicalResult(Operation *op, llvm::Module &)>
176+ optimizedLlvmIRCallback;
166177
167178 // / Callback invoked with the target ISA for the device,
168179 // / for example PTX assembly.
169- function_ref<LogicalResult(StringRef)> isaCallback;
180+ function_ref<LogicalResult(Operation *op, StringRef)> isaCallback;
170181
171182private:
172183 TypeID typeID;
0 commit comments