mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-04 03:23:14 +01:00
Added '-Hkeep-all-bodies' switch.
The same behavior is triggered by the '-inline' switch for DMD, but this doesn't quite translate to LDC.
This commit is contained in:
16
dmd2/func.c
16
dmd2/func.c
@@ -1948,7 +1948,13 @@ void FuncDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
|
||||
bodyToCBuffer(buf, hgs);
|
||||
hgs->autoMember--;
|
||||
}
|
||||
else if(hgs->tpltMember == 0 && global.params.useInline == 0)
|
||||
else if(hgs->tpltMember == 0 &&
|
||||
#if IN_LLVM
|
||||
!global.params.hdrKeepAllBodies
|
||||
#else
|
||||
global.params.useInline == 0
|
||||
#endif
|
||||
)
|
||||
buf->writestring(";");
|
||||
else
|
||||
bodyToCBuffer(buf, hgs);
|
||||
@@ -2022,7 +2028,13 @@ int FuncDeclaration::equals(Object *o)
|
||||
|
||||
void FuncDeclaration::bodyToCBuffer(OutBuffer *buf, HdrGenState *hgs)
|
||||
{
|
||||
if (fbody && (!hgs->hdrgen || global.params.useInline || hgs->autoMember || hgs->tpltMember))
|
||||
if (fbody && (!hgs->hdrgen ||
|
||||
#if IN_LLVM
|
||||
global.params.hdrKeepAllBodies ||
|
||||
#else
|
||||
global.params.useInline ||
|
||||
#endif
|
||||
hgs->autoMember || hgs->tpltMember))
|
||||
{
|
||||
int savetlpt = hgs->tpltMember;
|
||||
int saveauto = hgs->autoMember;
|
||||
|
||||
@@ -282,6 +282,11 @@ struct Param
|
||||
char *exefile;
|
||||
char *mapfile;
|
||||
#if IN_LLVM
|
||||
// Whether to keep all function bodies in .di file generation or to strip
|
||||
// those of plain functions. For DMD, this is govenered by the -inline
|
||||
// flag, which does not directly translate to LDC.
|
||||
bool hdrKeepAllBodies;
|
||||
|
||||
// LDC stuff
|
||||
OUTPUTFLAG output_ll;
|
||||
OUTPUTFLAG output_bc;
|
||||
|
||||
Reference in New Issue
Block a user