File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -2851,6 +2851,42 @@ Instr::GetPrevRealInstrOrLabel() const
2851
2851
return instr;
2852
2852
}
2853
2853
2854
+ // /----------------------------------------------------------------------------
2855
+ // /
2856
+ // / Instr::GetPrevLabelInstr
2857
+ // /
2858
+ // /----------------------------------------------------------------------------
2859
+ IR::LabelInstr *
2860
+ Instr::GetPrevLabelInstr () const
2861
+ {
2862
+ IR::Instr *instr = this ->m_prev ;
2863
+
2864
+ while (!instr->IsLabelInstr ())
2865
+ {
2866
+ instr = instr->m_prev ;
2867
+ AssertMsg (instr, " GetPrevLabelInstr() failed..." );
2868
+ }
2869
+ return instr->AsLabelInstr ();
2870
+ }
2871
+
2872
+ // /----------------------------------------------------------------------------
2873
+ // /
2874
+ // / Instr::GetPrevLabelInstr
2875
+ // /
2876
+ // /----------------------------------------------------------------------------
2877
+ IR::Instr *
2878
+ Instr::GetBlockStartInstr () const
2879
+ {
2880
+ IR::Instr *instr = this ->m_prev ;
2881
+
2882
+ while (!instr->StartsBasicBlock ())
2883
+ {
2884
+ instr = instr->m_prev ;
2885
+ AssertMsg (instr, " GetBlockStartInstr() failed..." );
2886
+ }
2887
+ return instr;
2888
+ }
2889
+
2854
2890
// /----------------------------------------------------------------------------
2855
2891
// /
2856
2892
// / Instr::GetInsertBeforeByteCodeUsesInstr
Original file line number Diff line number Diff line change @@ -295,6 +295,8 @@ class Instr
295
295
IR::Instr * GetNextBranchOrLabel () const ;
296
296
IR::Instr * GetPrevRealInstr () const ;
297
297
IR::Instr * GetPrevRealInstrOrLabel () const ;
298
+ IR::LabelInstr *GetPrevLabelInstr () const ;
299
+ IR::Instr * GetBlockStartInstr () const ;
298
300
IR::Instr * GetInsertBeforeByteCodeUsesInstr ();
299
301
IR::ByteCodeUsesInstr * GetFirstByteCodeUsesInstrBackward ();
300
302
bool IsByteCodeUsesInstrFor (IR::Instr * instr) const ;
You can’t perform that action at this time.
0 commit comments