Skip to content

Commit

Permalink
more functions inlined
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Dec 30, 2011
1 parent c268c4a commit 90a9638
Show file tree
Hide file tree
Showing 5 changed files with 265 additions and 34 deletions.
7 changes: 4 additions & 3 deletions src/declaration.h
Expand Up @@ -553,7 +553,8 @@ struct FuncDeclaration : Declaration
Loc endloc; // location of closing curly bracket
int vtblIndex; // for member functions, index into vtbl[]
int naked; // !=0 if naked
ILS inlineStatus;
ILS inlineStatusStmt;
ILS inlineStatusExp;
int inlineNest; // !=0 if nested inline
int isArrayOp; // !=0 if array operation
enum PASS semanticRun;
Expand Down Expand Up @@ -646,8 +647,8 @@ struct FuncDeclaration : Declaration
virtual int addPostInvariant();
Expression *interpret(InterState *istate, Expressions *arguments, Expression *thisexp = NULL);
void inlineScan();
int canInline(int hasthis, int hdrscan = 0);
Expression *doInline(InlineScanState *iss, Expression *ethis, Expressions *arguments);
int canInline(int hasthis, int hdrscan, int statementsToo);
Expression *expandInline(InlineScanState *iss, Expression *ethis, Expressions *arguments, Statement **ps);
const char *kind();
void toDocBuffer(OutBuffer *buf);
FuncDeclaration *isUnique();
Expand Down
5 changes: 3 additions & 2 deletions src/func.c
Expand Up @@ -64,7 +64,8 @@ FuncDeclaration::FuncDeclaration(Loc loc, Loc endloc, Identifier *id, StorageCla
vtblIndex = -1;
hasReturnExp = 0;
naked = 0;
inlineStatus = ILSuninitialized;
inlineStatusExp = ILSuninitialized;
inlineStatusStmt = ILSuninitialized;
inlineNest = 0;
isArrayOp = 0;
semanticRun = PASSinit;
Expand Down Expand Up @@ -1755,7 +1756,7 @@ int FuncDeclaration::equals(Object *o)
void FuncDeclaration::bodyToCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
if (fbody &&
(!hgs->hdrgen || hgs->tpltMember || canInline(1,1))
(!hgs->hdrgen || hgs->tpltMember || canInline(1,1,1))
)
{ buf->writenl();

Expand Down

1 comment on commit 90a9638

@CyberShadow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit introduced a regression:
https://issues.dlang.org/show_bug.cgi?id=14560

Please sign in to comment.