Skip to content

Commit

Permalink
strlen optimization: use constexpr instead of runtime-constant
Browse files Browse the repository at this point in the history
strlen cannot be a constexpr in all platforms otherwise.
  • Loading branch information
ferdymercury authored and jenkins committed Dec 9, 2024
1 parent 6c15be6 commit 6555674
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Interpreter/ForwardDeclPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ namespace cling {
// FIXME: Once the C++ modules replaced the forward decls, remove this.
if (D->getASTContext().getLangOpts().Modules &&
llvm::StringRef(includeText).starts_with("include ")) {
includeText += strlen("include ");
includeText += std::char_traits<char>::length("include ");
}

assert((includeText[0] == '<' || includeText[0] == '"') &&
Expand Down

0 comments on commit 6555674

Please sign in to comment.