2
0
Эх сурвалжийг харах

* add support for la_catch in spilling_get_reg_type (it will never need
spilling, but we may need the type to insert bitcasts)
* load the la_catch symbol operand with loadref instead of loadsymbol,
as the latter sets refaddr_full and with llvm we use that to indicated
symbol names of named registers rather than data symbols (which in turn
prevents it from being processed for inserting bitcasts if necessary)

git-svn-id: branches/debug_eh@40412 -

Jonas Maebe 6 жил өмнө
parent
commit
ae65f88f62

+ 6 - 3
compiler/llvm/aasmllvm.pas

@@ -488,7 +488,7 @@ uses
         if llvmopcode<>la_landingpad then
         if llvmopcode<>la_landingpad then
           internalerror(2018052001);
           internalerror(2018052001);
         if op<>la_cleanup then
         if op<>la_cleanup then
-          clause:=taillvm.exceptclause(op,voidpointertype,nil,nil)
+          clause:=taillvm.exceptclause(op,def,kind,nil)
         else
         else
           clause:=taillvm.cleanupclause;
           clause:=taillvm.cleanupclause;
         lastclause:=self;
         lastclause:=self;
@@ -569,7 +569,7 @@ uses
               end;
               end;
             end;
             end;
           la_ret, la_switch, la_indirectbr,
           la_ret, la_switch, la_indirectbr,
-          la_resume:
+          la_resume, la_catch:
             begin
             begin
               { ret size reg }
               { ret size reg }
               if opnr=1 then
               if opnr=1 then
@@ -1085,11 +1085,14 @@ uses
 
 
 
 
     constructor taillvm.exceptclause(op: tllvmop; def: tdef; kind: TAsmSymbol; nextclause: taillvm);
     constructor taillvm.exceptclause(op: tllvmop; def: tdef; kind: TAsmSymbol; nextclause: taillvm);
+      var
+        ref: treference;
       begin
       begin
         create_llvm(op);
         create_llvm(op);
         ops:=3;
         ops:=3;
         loaddef(0,def);
         loaddef(0,def);
-        loadsymbol(1,kind,0);
+        reference_reset_symbol(ref,kind,0,def.alignment,[]);
+        loadref(1,ref);
         loadtai(2,nextclause);
         loadtai(2,nextclause);
       end;
       end;