llvm::impl::strip_quotes

Return Str as a StringRef, stripping surrounding quotes if present.

Synopsis

Declared in <llvm/Support/DebugLog.h>

constexpr
llvm::StringRef
strip_quotes(char const* Str);

Description

Also, strip out potential surrounding quotes: this comes from an artifact of the macro stringification, if DEBUG_TYPE is undefined we get the string "DEBUG_TYPE", however if it is defined we get the string with the quotes. For example if DEBUG_TYPE is "foo", we get ""foo"" but we want to return "foo" here.

Return Value

Str as a StringRef, without surrounding quotes when present.

Parameters

NameDescription
StrNull-terminated string, possibly wrapped in quotes by stringification.