Skip to content

Commit 6555674

Browse files
ferdymercuryjenkins
authored and
jenkins
committed
strlen optimization: use constexpr instead of runtime-constant
strlen cannot be a constexpr in all platforms otherwise.
1 parent 6c15be6 commit 6555674

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Interpreter/ForwardDeclPrinter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ namespace cling {
192192
// FIXME: Once the C++ modules replaced the forward decls, remove this.
193193
if (D->getASTContext().getLangOpts().Modules &&
194194
llvm::StringRef(includeText).starts_with("include ")) {
195-
includeText += strlen("include ");
195+
includeText += std::char_traits<char>::length("include ");
196196
}
197197

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

0 commit comments

Comments
 (0)