[llvm] [TableGen] Use SmallVectors for preprocessor include stack. NFC. (PR #121571)
Min-Yih Hsu via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 3 09:17:50 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()) {
----------------
mshockwave wrote:
should we instead move this check before accessing `PrepIncludeStack.back()` above? I feel like an error message will be more helpful than simply crash in the case of PrepIncludeStack being empty.
https://github.com/llvm/llvm-project/pull/121571
More information about the llvm-commits
mailing list