Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 81a06e7

Browse files
committed
disable some inlining to tame dmd inliner, it causes huge compilation times when optimizing
1 parent 2e37769 commit 81a06e7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/core/demangle.d

+12
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ pure @safe:
100100

101101
static void error( string msg = "Invalid symbol" ) @trusted /* exception only used in module */
102102
{
103+
pragma(inline, false); // tame dmd inliner
104+
103105
//throw new ParseException( msg );
104106
debug(info) printf( "error: %.*s\n", cast(int) msg.length, msg.ptr );
105107
throw __ctfe ? new ParseException(msg)
@@ -110,6 +112,8 @@ pure @safe:
110112

111113
static void overflow( string msg = "Buffer overflow" ) @trusted /* exception only used in module */
112114
{
115+
pragma(inline, false); // tame dmd inliner
116+
113117
//throw new OverflowException( msg );
114118
debug(info) printf( "overflow: %.*s\n", cast(int) msg.length, msg.ptr );
115119
throw cast(OverflowException) cast(void*) typeid(OverflowException).initializer;
@@ -176,6 +180,8 @@ pure @safe:
176180
// move val to the end of the dst buffer
177181
char[] shift( const(char)[] val )
178182
{
183+
pragma(inline, false); // tame dmd inliner
184+
179185
if( val.length && !mute )
180186
{
181187
assert( contains( dst[0 .. len], val ) );
@@ -196,6 +202,8 @@ pure @safe:
196202
// remove val from dst buffer
197203
void remove( const(char)[] val )
198204
{
205+
pragma(inline, false); // tame dmd inliner
206+
199207
if( val.length )
200208
{
201209
assert( contains( dst[0 .. len], val ) );
@@ -210,6 +218,8 @@ pure @safe:
210218

211219
char[] append( const(char)[] val )
212220
{
221+
pragma(inline, false); // tame dmd inliner
222+
213223
if( val.length && !mute )
214224
{
215225
if( !dst.length )
@@ -252,6 +262,8 @@ pure @safe:
252262

253263
char[] put( const(char)[] val )
254264
{
265+
pragma(inline, false); // tame dmd inliner
266+
255267
if( val.length )
256268
{
257269
if( !contains( dst[0 .. len], val ) )

0 commit comments

Comments
 (0)