This is an archive of the discontinued LLVM Phabricator instance.

[sanitizers] Fix missing header for mac builds
ClosedPublic

Authored by paulkirth on Feb 11 2022, 2:57 PM.

Diff Detail

Event Timeline

paulkirth requested review of this revision.Feb 11 2022, 2:57 PM
paulkirth created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2022, 2:57 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
leonardchan accepted this revision.Feb 11 2022, 3:00 PM
This revision is now accepted and ready to land.Feb 11 2022, 3:00 PM
This revision was landed with ongoing or failed builds.Feb 11 2022, 3:03 PM
This revision was automatically updated to reflect the committed changes.
rastogishubham added a subscriber: rastogishubham.EditedFeb 11 2022, 4:07 PM

This change breaks the lldb greendragon bot

/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp:521:32: error: no type named 'tokens_iterator' in 'clang::MacroInfo'

for (clang::MacroInfo::tokens_iterator ti = macro_info->tokens_begin(),
     ~~~~~~~~~~~~~~~~~~^

/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp:522:51: error: expected ';' in 'for' statement specifier

te = macro_info->tokens_end();
   ^

/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp:522:51: error: expected expression
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp:523:20: error: use of undeclared identifier 'te'

ti != te; ++ti) {
      ^

/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp:523:22: error: expected ')'

ti != te; ++ti) {
        ^

/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp:521:13: note: to match this '('

for (clang::MacroInfo::tokens_iterator ti = macro_info->tokens_begin(),
    ^

/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp:523:24: warning: misleading indentation; statement is not part of the previous 'for' [-Wmisleading-indentation]

ti != te; ++ti) {
          ^

/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp:521:9: note: previous statement is here

for (clang::MacroInfo::tokens_iterator ti = macro_info->tokens_begin(),
^

/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp:523:28: error: expected ';' after expression

ti != te; ++ti) {
              ^
              ;

/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp:523:26: error: use of undeclared identifier 'ti'

ti != te; ++ti) {
            ^

/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp:523:28: error: expected expression

ti != te; ++ti) {
              ^

1 warning and 8 errors generated.

Build log here:

https://green.lab.llvm.org/green/job/lldb-cmake/41315/

I tried a local revert and the errors did vanish.

To reproduce the errors, please run

please ninja check-lldb-unit and revert the change or fix the error as soon as possible

Thanks!

This change breaks the lldb greendragon bot

Build log here:

https://green.lab.llvm.org/green/job/lldb-cmake/41315/

I tried a local revert and the errors did vanish.

To reproduce the errors, please run

please ninja check-lldb-unit and revert the change or fix the error as soon as possible

Thanks!

It was https://reviews.llvm.org/D117348

That is unfortunate, since this patch was needed to fix our mac builds after https://reviews.llvm.org/D119546. Similarly, https://reviews.llvm.org/rG11b0506c08897a132b1b810be4ca71c3d605c7e9 fixed the issue in the same manner.

I'm a bit confused as to why adding a header caused your issue. I don't mind reverting per se, but this is the correct fix from what I can tell.

Ah, thanks for pointing that out @abrachet

Ah I see, weird because I just locally reverted this change and those errors vanished though there are other errors that popped up in its place, which I suspected were due to some other change because greendragon has been red for a while. Thanks @abrachet