[llvm] 13e061e - Revert "Quick fix to unbreak tblgen past 8ae18303f97d"

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 05:44:07 PST 2022


Author: Nico Weber
Date: 2022-12-06T08:43:30-05:00
New Revision: 13e061e73e1b067589d3bd680fc29297d7e4ec8d

URL: https://github.com/llvm/llvm-project/commit/13e061e73e1b067589d3bd680fc29297d7e4ec8d
DIFF: https://github.com/llvm/llvm-project/commit/13e061e73e1b067589d3bd680fc29297d7e4ec8d.diff

LOG: Revert "Quick fix to unbreak tblgen past 8ae18303f97d"

This reverts commit e50a60d7349de151bd2b06d85a79201ebc372d8a.
Prerequisite for reverting 8ae18303f97d5.

Added: 
    

Modified: 
    llvm/utils/TableGen/OptParserEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/OptParserEmitter.cpp b/llvm/utils/TableGen/OptParserEmitter.cpp
index f8ddbefdcc596..ebef5847f7137 100644
--- a/llvm/utils/TableGen/OptParserEmitter.cpp
+++ b/llvm/utils/TableGen/OptParserEmitter.cpp
@@ -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 << '[' << PrefixLength << "])";
+  OS << ").substr(" << PrefixLength << ")";
 }
 
 class MarshallingInfo {


        


More information about the llvm-commits mailing list