From 1941e644888995d97960748dff1c9539fcf92966 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 19 Apr 2015 21:37:43 +0000 Subject: [PATCH] + added a hook to insert object-global information into the asmlists (will be used to insert type definitions for llvm) git-svn-id: trunk@30674 - --- compiler/ngenutil.pas | 11 +++++++++++ compiler/pmodules.pas | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/compiler/ngenutil.pas b/compiler/ngenutil.pas index a0d6c7feb1..447aeab784 100644 --- a/compiler/ngenutil.pas +++ b/compiler/ngenutil.pas @@ -97,6 +97,11 @@ interface class procedure InsertMemorySizes; virtual; + { called right before an object is assembled, can be used to insert + global information into the assembler list (used by LLVM to insert type + info) } + class procedure InsertObjectInfo; virtual; + strict protected class procedure add_main_procdef_paras(pd: tdef); virtual; end; @@ -999,6 +1004,12 @@ implementation end; + class procedure tnodeutils.InsertObjectInfo; + begin + { don't do anything by default } + end; + + class procedure tnodeutils.add_main_procdef_paras(pd: tdef); begin { no parameters by default } diff --git a/compiler/pmodules.pas b/compiler/pmodules.pas index 06b5b660e5..91d0d32cba 100644 --- a/compiler/pmodules.pas +++ b/compiler/pmodules.pas @@ -92,6 +92,10 @@ implementation KeepShared.Free; end; + { allow a target-specific pass over all assembler code (used by LLVM + to insert type definitions } + cnodeutils.InsertObjectInfo; + { Start and end module debuginfo, at least required for stabs to insert n_sourcefile lines } if (cs_debuginfo in current_settings.moduleswitches) or