Quick fix to unbreak tblgen past 8ae18303f97d
llvm/tools/llvm-objdump/llvm-objdump.cpp:128:38: error: constexpr variable 'ObjdumpInfoTable' must be initialized by a constant expression
static constexpr opt::OptTable::Info ObjdumpInfoTable[] = {
^ ~
ObjdumpOpts.inc:30:45: note: non-constexpr function 'substr' cannot be used in a constant expression
OPTION(prefix_0, llvm::StringRef("<input>").substr(0), INPUT, Input, INVALID, INVALID, nullptr, 0, 0, nullptr, nullptr, nullptr)
^
This commit is contained in:
parent
8ff4d218a8
commit
e50a60d734
@ -54,9 +54,9 @@ static std::string getOptionSpelling(const Record &R) {
|
||||
|
||||
static void emitNameUsingSpelling(raw_ostream &OS, const Record &R) {
|
||||
size_t PrefixLength;
|
||||
OS << "llvm::StringRef(";
|
||||
OS << "llvm::StringRef(&";
|
||||
write_cstring(OS, StringRef(getOptionSpelling(R, PrefixLength)));
|
||||
OS << ").substr(" << PrefixLength << ")";
|
||||
OS << '[' << PrefixLength << "])";
|
||||
}
|
||||
|
||||
class MarshallingInfo {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user