I want to know which all llvm IRL instructions correspond to code inside a specific pragma in clang. My pragma has the following structure.
#pragma markme { stmt1; stmt2; }
I need to know what all the stmts were present between the opening brackets and the closing brackets mark me pragma.
Can we attach some metadata to these stmts? If so, can I point to some link.
I searched on google and found this
Add a pragma handler that has a callback in the action interface. Add a callback sema implementation that sets some internal bit in the Sema object. Add a new bit to the 'for' statement to indicate whether it was #pragma optimize set. Modify the code to extract metadata based on this bit.
Can anyone give more details on this.
I am using the latest version of llvm (llvm 3.4)
Note: Any help in any direction is appreciated. I know that llvm can do optimizations that move statements around. But this is normal with me.
source share