71f1f27cc303 — Leonard Ritter 2 months ago
* reduce the compiler flags that invalidate cache
2 files changed, 5 insertions(+), 1 deletions(-)

M src/compiler_flags.hpp
M src/execution.cpp
M src/compiler_flags.hpp +3 -0
@@ 29,6 29,9 @@ SCOPES_COMPILER_FLAGS()
 #undef T
 };
 
+// which flags are going to be effecting cache invalidation
+#define SCOPES_CACHE_COMPILER_FLAGS (CF_O3 | CF_NoDebugInfo)
+
 } // namespace scopes
 
 #endif // SCOPES_COMPILER_FLAGS_HPP

          
M src/execution.cpp +2 -1
@@ 332,7 332,8 @@ SCOPES_RESULT(void) add_module(LLVMModul
     const char *filepath = nullptr;
     if (cache) {
         assert(irbuf);
-        key = get_cache_key(compiler_flags, LLVMGetBufferStart(irbuf), LLVMGetBufferSize(irbuf));
+        key = get_cache_key(compiler_flags & SCOPES_CACHE_COMPILER_FLAGS,
+            LLVMGetBufferStart(irbuf), LLVMGetBufferSize(irbuf));
         filepath = get_cache_file(key);
 
         const char *keyfilepath = get_cache_key_file(key);