[llvm] 93b8f56 - [llvm][TableGen] Fix value description made by OptRSTEmitter

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 02:35:50 PST 2023


Author: David Spickett
Date: 2023-11-06T10:35:38Z
New Revision: 93b8f5695bb73fa381c00611b3aeefb3644192e1

URL: https://github.com/llvm/llvm-project/commit/93b8f5695bb73fa381c00611b3aeefb3644192e1
DIFF: https://github.com/llvm/llvm-project/commit/93b8f5695bb73fa381c00611b3aeefb3644192e1.diff

LOG: [llvm][TableGen] Fix value description made by OptRSTEmitter

When this was ported to clang-tblen for https://reviews.llvm.org/D123682,
some of the refactoring for the clang copy was backported to llvm,
but used .front instead of .back as clang does.

This means that if you have values "a, b, c" you get
"must be 'a', ' b' or 'a'." instead of "must be 'a', ' b' or 'c'.".

Added: 
    

Modified: 
    llvm/utils/TableGen/OptRSTEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/OptRSTEmitter.cpp b/llvm/utils/TableGen/OptRSTEmitter.cpp
index 87e755d943a14fc..5a7f079dc1681cb 100644
--- a/llvm/utils/TableGen/OptRSTEmitter.cpp
+++ b/llvm/utils/TableGen/OptRSTEmitter.cpp
@@ -91,7 +91,7 @@ static void EmitOptRST(RecordKeeper &Records, raw_ostream &OS) {
           HelpText += join(Values.begin(), Values.end() - 1, "', '");
           HelpText += "' or '";
         }
-        HelpText += (Values.front() + "'.").str();
+        HelpText += (Values.back() + "'.").str();
       }
 
       if (!HelpText.empty()) {


        


More information about the llvm-commits mailing list