We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9a5d48 commit 49bf60dCopy full SHA for 49bf60d
IGC/Compiler/CISACodeGen/helper.h
@@ -536,4 +536,20 @@ namespace IGC
536
std::pair<llvm::Value*, unsigned int> GetURBBaseAndOffset(llvm::Value* pUrbOffset);
537
538
std::vector<std::pair<unsigned int, std::string>> GetPrintfStrings(llvm::Module &M);
539
+
540
+ template<typename Fn>
541
+ struct Defer
542
+ {
543
+ Defer(Fn F) : F(F) {}
544
+ ~Defer() {
545
+ if (Do) F();
546
+ }
547
+ void operator()() {
548
549
+ Do = false;
550
551
+ private:
552
+ bool Do = true;
553
+ Fn F;
554
+};
555
} // namespace IGC
0 commit comments