|
@@ -182,6 +182,7 @@ interface
|
|
constructor create(l,r,_t1 : tnode);virtual;reintroduce;
|
|
constructor create(l,r,_t1 : tnode);virtual;reintroduce;
|
|
function pass_typecheck:tnode;override;
|
|
function pass_typecheck:tnode;override;
|
|
function pass_1 : tnode;override;
|
|
function pass_1 : tnode;override;
|
|
|
|
+ function simplify(forinline: boolean): tnode; override;
|
|
end;
|
|
end;
|
|
ttryexceptnodeclass = class of ttryexceptnode;
|
|
ttryexceptnodeclass = class of ttryexceptnode;
|
|
|
|
|
|
@@ -2071,6 +2072,15 @@ implementation
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
+ function ttryexceptnode.simplify(forinline: boolean): tnode;
|
|
|
|
+ begin
|
|
|
|
+ result:=nil;
|
|
|
|
+ { empty try -> can never raise exception -> do nothing }
|
|
|
|
+ if has_no_code(left) then
|
|
|
|
+ result:=cnothingnode.create;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+
|
|
{*****************************************************************************
|
|
{*****************************************************************************
|
|
TTRYFINALLYNODE
|
|
TTRYFINALLYNODE
|
|
*****************************************************************************}
|
|
*****************************************************************************}
|