Skip to content

Commit d205191

Browse files
authored
[MSVC] work-around for compile time issue 102513 (#110986)
Disable optimizations when building clang/lib/AST/ByteCode/Interp.cpp with Microsoft's compiler as it has a bug that causes excessive build times. We do this only when NDEBUG is not defined on the assumption that building without asserts indicates that a user is strongly invested in runtime performance. Partially addresses: #102513. Once the bug is addressed in the Microsoft compiler this can be removed. Co-authored-by: dyung
1 parent 4da4fac commit d205191

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,10 @@ bool handleFixedPointOverflow(InterpState &S, CodePtr OpPC,
14061406
return S.noteUndefinedBehavior();
14071407
}
14081408

1409+
// https://github.com/llvm/llvm-project/issues/102513
1410+
#if defined(_WIN32) && !defined(__clang__) && !defined(NDEBUG)
1411+
#pragma optimize("", off)
1412+
#endif
14091413
bool Interpret(InterpState &S, APValue &Result) {
14101414
// The current stack frame when we started Interpret().
14111415
// This is being used by the ops to determine wheter
@@ -1430,6 +1434,10 @@ bool Interpret(InterpState &S, APValue &Result) {
14301434
}
14311435
}
14321436
}
1437+
// https://github.com/llvm/llvm-project/issues/102513
1438+
#if defined(_WIN32) && !defined(__clang__) && !defined(NDEBUG)
1439+
#pragma optimize("", on)
1440+
#endif
14331441

14341442
} // namespace interp
14351443
} // namespace clang

0 commit comments

Comments
 (0)