[llvm] [TableGen] Use SmallVectors for preprocessor include stack. NFC. (PR #121571)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 3 05:42:03 PST 2025


================
@@ -656,17 +654,13 @@ tgtok::TokKind TGLexer::LexExclaim() {
 bool TGLexer::prepExitInclude(bool IncludeStackMustBeEmpty) {
   // Report an error, if preprocessor control stack for the current
   // file is not empty.
-  if (!PrepIncludeStack.back()->empty()) {
+  if (!PrepIncludeStack.back().empty()) {
     prepReportPreprocessorStackError();
 
     return false;
   }
 
   // Pop the preprocessing controls from the include stack.
-  if (PrepIncludeStack.empty()) {
----------------
jayfoad wrote:

This check was pointless since we have already accessed `PrepIncludeStack.back()` above.

https://github.com/llvm/llvm-project/pull/121571


More information about the llvm-commits mailing list