skywalk wrote:Argg, Danilo. I am now stuck when trying the same approach for mydll.asm?
There is no main line code to compare against defined ProcedureDLL's.
I tested DeadProcedureRemover_IDE.zip also with DLLs. It worked because I'm looking
for references in the form of "_ProcedureXXX" and ProcedureDLL functions are referenced
outside MPXXX{} macros at the beginning of the ASM output:
Code: Select all
public _Procedure6
public _Procedure8
public _Procedure10
public _Procedure12
public _Procedure2
Those "public _ProcedureXXX" are ProcedureDLL functions and get included by default.
Other procedures get included only if they are referenced by one of the public _ProcedureXXX
functions, or in data sections etc.
EDIT:
Simple test, compile to DLL from within the IDE:
Code: Select all
ProcedureDLL Init()
EndProcedure
Procedure DoIt(x=0)
if x = 123
procedurereturn DoIt()
endif
EndProcedure
ProcedureDLL Func1()
; DoIt()
EndProcedure
ProcedureDLL Func2()
; DoIt()
EndProcedure
It can remove DoIt() because it is not referenced by any other function,
and it is a "Procedure", not "ProcedureDLL".
ProcedureDLL are always included, because the are exported, so they
can be called by external programs. ProcedureDLL can not get removed.
Output in the IDE log window for the above DLL test (with installed
DeadProcedureRemover_IDE.zip):
Code: Select all
Analyzing 'PureBasic.asm'
- Found 4 procedure macros.
- Removed 1 out of 4 used procedure macros.
The procedure that got removed is DoIt().