aboutsummaryrefslogtreecommitdiff
path: root/source/opt/module.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/opt/module.h')
-rw-r--r--source/opt/module.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/source/opt/module.h b/source/opt/module.h
index 230be709..7a6be460 100644
--- a/source/opt/module.h
+++ b/source/opt/module.h
@@ -83,6 +83,9 @@ class Module {
// Set the memory model for this module.
inline void SetMemoryModel(std::unique_ptr<Instruction> m);
+ // Set the sampled image addressing mode for this module.
+ inline void SetSampledImageAddressMode(std::unique_ptr<Instruction> m);
+
// Appends an entry point instruction to this module.
inline void AddEntryPoint(std::unique_ptr<Instruction> e);
@@ -158,12 +161,20 @@ class Module {
inline IteratorRange<inst_iterator> ext_inst_imports();
inline IteratorRange<const_inst_iterator> ext_inst_imports() const;
- // Return the memory model instruction contained inthis module.
+ // Return the memory model instruction contained in this module.
inline Instruction* GetMemoryModel() { return memory_model_.get(); }
inline const Instruction* GetMemoryModel() const {
return memory_model_.get();
}
+ // Return the sampled image address mode instruction contained in this module.
+ inline Instruction* GetSampledImageAddressMode() {
+ return sampled_image_address_mode_.get();
+ }
+ inline const Instruction* GetSampledImageAddressMode() const {
+ return sampled_image_address_mode_.get();
+ }
+
// There are several kinds of debug instructions, according to where they can
// appear in the logical layout of a module:
// - Section 7a: OpString, OpSourceExtension, OpSource, OpSourceContinued
@@ -288,6 +299,8 @@ class Module {
InstructionList ext_inst_imports_;
// A module only has one memory model instruction.
std::unique_ptr<Instruction> memory_model_;
+ // A module can only have one optional sampled image addressing mode
+ std::unique_ptr<Instruction> sampled_image_address_mode_;
InstructionList entry_points_;
InstructionList execution_modes_;
InstructionList debugs1_;
@@ -326,6 +339,10 @@ inline void Module::SetMemoryModel(std::unique_ptr<Instruction> m) {
memory_model_ = std::move(m);
}
+inline void Module::SetSampledImageAddressMode(std::unique_ptr<Instruction> m) {
+ sampled_image_address_mode_ = std::move(m);
+}
+
inline void Module::AddEntryPoint(std::unique_ptr<Instruction> e) {
entry_points_.push_back(std::move(e));
}