llvm.org GIT mirror llvm / 2962664
Remove a bit more cruft from the sjlj moving to a backend pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79272 91177308-0d34-0410-b5e6-96231b3b80d8 Jim Grosbach 10 years ago
6 changed file(s) with 0 addition(s) and 81 deletion(s). Raw diff Collapse all Expand all
3737
  • llvm.eh.sjlj.setjmp
  • 3838
  • llvm.eh.sjlj.longjmp
  • 3939
  • llvm.eh.sjlj.lsda
  • 40
  • llvm.eh.sjlj.callsite
  • 4140
    4241
  • Asm Table Formats
  • 4342
    471470
    472471
    473472
    474
    475 llvm.eh.sjlj.callsite
    476
    477
    478
    479
    480
    
                      
                    
    481 void %llvm.eh.sjlj.callsite(i32)
    482
    483
    484

    The SJLJ front-end allocates call site indices for invoke instrucitons.

    485 These values are passed to the back-end via the
    486 llvm.eh.sjlj.callsite
    487 intrinsic, where they are used to build the LSDA call-site table.

    488
    489
    490
    491
    492473
    493474 Asm Table Formats
    494475
    114114 // The alignment of the function.
    115115 unsigned Alignment;
    116116
    117 // The currently active call_site value
    118 unsigned CallSiteIndex;
    119
    120 // The largest call_site value encountered
    121 unsigned MaxCallSiteIndex;
    122
    123 // Call sites mapped to corresponding landing pads
    124 std::map LandingPadCallSiteIndexMap;
    125
    126117 public:
    127118 MachineFunction(Function *Fn, const TargetMachine &TM);
    128119 ~MachineFunction();
    167158 /// setAlignment - Set the alignment (log2, not bytes) of the function.
    168159 ///
    169160 void setAlignment(unsigned A) { Alignment = A; }
    170
    171 /// getCallSiteIndex() - Get the current call site index
    172 ///
    173 unsigned getCallSiteIndex() { return CallSiteIndex; }
    174
    175 /// setCallSiteIndex() - Set the current call site index
    176 ///
    177 void setCallSiteIndex(unsigned Idx) {
    178 CallSiteIndex = Idx;
    179 if (CallSiteIndex > MaxCallSiteIndex)
    180 MaxCallSiteIndex = CallSiteIndex;
    181 }
    182
    183 /// getMaxCallSiteIndex() - Get the largest call site index issued
    184 ///
    185 unsigned getMaxCallSiteIndex() { return MaxCallSiteIndex; }
    186
    187 /// setCallSiteIndexLandingPad() - Map the call site to a landing pad
    188 ///
    189 void setLandingPadCallSiteIndex(MachineBasicBlock *LandingPad,
    190 unsigned CallSite) {
    191 LandingPadCallSiteIndexMap[LandingPad] = CallSite;
    192 }
    193
    194 /// getCallSiteIndexLandingPad() - Get landing pad for the call site index
    195 ///
    196 unsigned getLandingPadCallSiteIndex(MachineBasicBlock *LandingPad) {
    197 return LandingPadCallSiteIndexMap[LandingPad];
    198 }
    199
    200 /// getCallSiteCount() - Get the count of call site entries
    201 ///
    202 unsigned getCallSiteCount() {
    203 return LandingPadCallSiteIndexMap.size();
    204 }
    205161
    206162 /// MachineFunctionInfo - Keep track of various per-function pieces of
    207163 /// information for backends that would like to do so.
    309309 def int_eh_sjlj_longjmp : Intrinsic<[llvm_void_ty], [llvm_ptr_ty]>;
    310310 def int_eh_sjlj_lsda : Intrinsic<[llvm_ptr_ty]>;
    311311 }
    312 let Properties = [IntrWriteMem] in {
    313 def int_eh_sjlj_callsite: Intrinsic<[llvm_void_ty], [llvm_i32_ty]>;
    314 }
    315312
    316313 //===---------------- Generic Variable Attribute Intrinsics----------------===//
    317314 //
    639639 Asm->EmitULEB128Bytes(SizeSites);
    640640 Asm->EOL("Call-site table length");
    641641
    642
    643 assert(MF->getCallSiteCount() == CallSites.size());
    644
    645642 // Emit the landing pad site information.
    646643 unsigned idx = 0;
    647644 for (SmallVectorImpl::const_iterator
    9292 MachineConstantPool(TM.getTargetData());
    9393 Alignment = TM.getTargetLowering()->getFunctionAlignment(F);
    9494
    95 CallSiteIndex = 0;
    96 MaxCallSiteIndex = 0;
    97
    9895 // Set up jump table.
    9996 const TargetData &TD = *TM.getTargetData();
    10097 bool IsPic = TM.getRelocationModel() == Reloc::PIC_;
    40834083 Offset));
    40844084 return 0;
    40854085 }
    4086 case Intrinsic::eh_sjlj_callsite: {
    4087 MachineFunction &MF = DAG.getMachineFunction();
    4088 MF.setCallSiteIndex(cast(getValue(I.getOperand(1)))->getZExtValue());
    4089 return 0;
    4090 }
    40914086 case Intrinsic::convertff:
    40924087 case Intrinsic::convertfsi:
    40934088 case Intrinsic::convertfui:
    44514446 }
    44524447
    44534448 if (LandingPad && MMI) {
    4454 MachineFunction &MF = DAG.getMachineFunction();
    44554449 // Insert a label before the invoke call to mark the try range. This can be
    44564450 // used to detect deletion of the invoke via the MachineModuleInfo.
    44574451 BeginLabel = MMI->NextLabelID();
    4458
    4459 // Map this landing pad to the current call site entry
    4460 MF.setLandingPadCallSiteIndex(LandingPad, MF.getCallSiteIndex());
    44614452
    44624453 // Both PendingLoads and PendingExports must be flushed here;
    44634454 // this call might not return.