Pārlūkot izejas kodu

+ helper to add an extra clause to a landingpad instruction

git-svn-id: branches/debug_eh@40408 -
Jonas Maebe 6 gadi atpakaļ
vecāks
revīzija
e6c89bbf0a
1 mainītis faili ar 17 papildinājumiem un 0 dzēšanām
  1. 17 0
      compiler/llvm/aasmllvm.pas

+ 17 - 0
compiler/llvm/aasmllvm.pas

@@ -138,6 +138,8 @@ interface
         procedure loadparas(opidx: longint; _paras: tfplist);
         procedure loadasmlist(opidx: longint; _asmlist: tasmlist);
 
+        procedure landingpad_add_clause(op: tllvmop; def: tdef; kind: TAsmSymbol);
+
         { register spilling code }
         function spilling_get_operation_type(opnr: longint): topertype;override;
         function spilling_get_reg_type(opnr: longint): tdef;
@@ -474,6 +476,21 @@ uses
       end;
 
 
+    procedure taillvm.landingpad_add_clause(op: tllvmop; def: tdef; kind: TAsmSymbol);
+      var
+        lastclause,
+        clause: taillvm;
+      begin
+        if llvmopcode<>la_landingpad then
+          internalerror(2018052001);
+        clause:=taillvm.exceptclause(op,voidpointertype,nil,nil);
+        lastclause:=self;
+        while assigned(lastclause.oper[2]^.ai) do
+          lastclause:=taillvm(lastclause.oper[2]^.ai);
+        lastclause.loadtai(2,clause);
+      end;
+
+
     function taillvm.spilling_get_operation_type(opnr: longint): topertype;
       begin
         case llvmopcode of