From 5de3003af561bad33680940ab1809622c428e94b Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Thu, 17 Aug 2017 09:46:19 -0700 Subject: IR generation cleanup work - Make all instructions store their argument count for now, so we can iterate over them easily. - Longer term we might try to optimize for space because the common case is that the operand count is known, but keeping it simpler seems better for now - Split apart the creation of an instruction from adding it to a parent - Use the above capability to make sure that we add a function to its parent *after* all the parameter/result type emission has occured. - Perform simple value numbering for types during IR creation - This logic also tries to pick a good parent for any type instructions, so that types don't get created local to a function unless they really need to - Create all constants at global scope, and re-use when values are identical --- source/slang/emit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/slang/emit.cpp') diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index c8f3f06cb..d9b2ffcd6 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -3951,11 +3951,11 @@ String emitEntryPoint( throw 99; } - else if(translationUnit->compileRequest->loadedModulesList.Count() != 0) + else if( #else - if(!(translationUnit->compileFlags & SLANG_COMPILE_FLAG_NO_CHECKING ) - || translationUnit->compileRequest->loadedModulesList.Count() != 0) + if(!(translationUnit->compileFlags & SLANG_COMPILE_FLAG_NO_CHECKING ) || #endif + translationUnit->compileRequest->loadedModulesList.Count() != 0) { // The user has `import`ed some Slang modules, and so we are in case (2) // -- cgit v1.2.3