swiftlang / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. This fork is used to manage Swift’s stable releases of Clang as well as support the Swift project.
https://llvm.org
Other
1.12k stars 331 forks source link

[BoundsSafety] Bring full support for -fbounds-safety #9665

Open rapidsna opened 1 day ago

rapidsna commented 1 day ago

-fbounds-safety is a C extension to enforce bounds safety to prevent out-of-bounds (OOB) memory accesses. The extension offers bounds annotations that programmers can use to attach bounds to pointers. Using this bounds information, the compiler inserts bounds checks on every pointer dereference, ensuring that the program does not access memory outside the specified bounds. The compiler requires programmers to provide enough bounds information so that the accesses can be checked at either run time or compile time — and it rejects code if it cannot.

For more details, please refer to

The bounds annotations provided by -fbounds-safety could potentially be useful to implement safe interoperation between C/C++ and safe languages such as Swift. Similar to lifetime dependency annotations as pitched here.

This patch contains collaborative work from @rapidsna @apple-fcloutier @patrykstefanski @delcypher @hnrklssn and from many other collaborators from the optimization and debugger side of support.

rapidsna commented 1 day ago

@swift-ci test

rapidsna commented 1 day ago

@swift-ci test llvm

delcypher commented 23 hours ago

Looks like there's some problems building with gcc.

/home/build-user/llvm-project/clang/lib/Analysis/BoundsSafetySuggestions.cpp:452:45: error: designator order for field 'clang::BoundsSafetySuggestionHandler::SingleEntity::Kind' does not match declaration order in 'clang::BoundsSafetySuggestionHandler::SingleEntity'
  452 |           .SinglePointeeTy = SinglePointeeTy};
      |                                             ^
/home/build-user/llvm-project/clang/lib/Analysis/BoundsSafetySuggestions.cpp:460:11: warning: C++ designated initializers only available with '-std=c++2a' or '-std=gnu++2a' [-Wpedantic]
  460 |           .Entity = SingleVarDecl,

and then a whole bunch of warnings. This are all the ones that obviously looked like they were due to -fbounds-safety code from this Linux build

[1495/4939] /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/build-user/llvm-project/build/tools/clang/lib/AST -I/home/build-user/llvm-project/clang/lib/AST -I/home/build-user/llvm-project/clang/include -I/home/build-user/llvm-project/build/tools/clang/include -I/home/build-user/llvm-project/build/include -I/home/build-user/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/Expr.cpp.o -MF tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/Expr.cpp.o.d -o tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/Expr.cpp.o -c /home/build-user/llvm-project/clang/lib/AST/Expr.cpp
/home/build-user/llvm-project/clang/lib/AST/Expr.cpp: In member function 'bool clang::Expr::isConstantInitializer(clang::ASTContext&, bool, const clang::Expr**) const':
/home/build-user/llvm-project/clang/lib/AST/Expr.cpp:3760:23: warning: unused variable 'DCPTy' [-Wunused-variable]
 3760 |             if (auto *DCPTy = Field->getType()->getAs<CountAttributedType>()) {
      |                       ^~~~~
/home/build-user/llvm-project/clang/lib/AST/Expr.cpp: In member function 'llvm::StringRef clang::PredefinedBoundsCheckExpr::getKindName() const':
/home/build-user/llvm-project/clang/lib/AST/Expr.cpp:2301:1: warning: control reaches end of non-void function [-Wreturn-type]
 2301 | }
      | ^
[407/4939] /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/build-user/llvm-project/build/lib/Remarks -I/home/build-user/llvm-project/llvm/lib/Remarks -I/home/build-user/llvm-project/build/include -I/home/build-user/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT lib/Remarks/CMakeFiles/LLVMRemarks.dir/ExtraOptRemarks.cpp.o -MF lib/Remarks/CMakeFiles/LLVMRemarks.dir/ExtraOptRemarks.cpp.o.d -o lib/Remarks/CMakeFiles/LLVMRemarks.dir/ExtraOptRemarks.cpp.o -c /home/build-user/llvm-project/llvm/lib/Remarks/ExtraOptRemarks.cpp
In file included from /home/build-user/llvm-project/llvm/lib/Remarks/ExtraOptRemarks.cpp:11:
/home/build-user/llvm-project/llvm/include/llvm/Remarks/BoundsSafetyOptRemarks.h:32: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   32 | #pragma clang diagnostic push
      | 
/home/build-user/llvm-project/llvm/include/llvm/Remarks/BoundsSafetyOptRemarks.h:33: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   33 | #pragma clang diagnostic ignored "-Wcovered-switch-default"
      | 
[1564/4939] /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/build-user/llvm-project/build/tools/clang/lib/AST -I/home/build-user/llvm-project/clang/lib/AST -I/home/build-user/llvm-project/clang/include -I/home/build-user/llvm-project/build/tools/clang/include -I/home/build-user/llvm-project/build/include -I/home/build-user/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ExprConstant.cpp.o -MF tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ExprConstant.cpp.o.d -o tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ExprConstant.cpp.o -c /home/build-user/llvm-project/clang/lib/AST/ExprConstant.cpp
/home/build-user/llvm-project/clang/lib/AST/ExprConstant.cpp: In member function 'bool {anonymous}::PointerExprEvaluator::VisitCastExpr(const clang::CastExpr*)':
/home/build-user/llvm-project/clang/lib/AST/ExprConstant.cpp:9738:14: warning: unused variable 'DRP' [-Wunused-variable]
 9738 |     if (auto DRP = E->getType()->getAs<DynamicRangePointerType>()) {
      |              ^~~
[84/4464] /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/build-user/llvm-project/build/tools/clang/lib/Sema -I/home/build-user/llvm-project/clang/lib/Sema -I/home/build-user/llvm-project/clang/include -I/home/build-user/llvm-project/build/tools/clang/include -I/home/build-user/llvm-project/build/include -I/home/build-user/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/AnalysisBasedWarnings.cpp.o -MF tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/AnalysisBasedWarnings.cpp.o.d -o tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/AnalysisBasedWarnings.cpp.o -c /home/build-user/llvm-project/clang/lib/Sema/AnalysisBasedWarnings.cpp
/home/build-user/llvm-project/clang/lib/Sema/AnalysisBasedWarnings.cpp: In member function 'int BoundsSafetySuggestionReporter::WillTrapKindSelectIndex(clang::BoundsSafetySuggestionHandler::WillTrapKind)':
/home/build-user/llvm-project/clang/lib/Sema/AnalysisBasedWarnings.cpp:2527:3: warning: control reaches end of non-void function [-Wreturn-type]
 2527 |   }
      |   ^
/home/build-user/llvm-project/clang/lib/Sema/AnalysisBasedWarnings.cpp: In member function 'int BoundsSafetySuggestionReporter::PtrArithOOBKindSelectIndex(clang::BoundsSafetySuggestionHandler::PtrArithOOBKind)':
/home/build-user/llvm-project/clang/lib/Sema/AnalysisBasedWarnings.cpp:2547:3: warning: control reaches end of non-void function [-Wreturn-type]
 2547 |   }
      |   ^
[251/4464] /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/build-user/llvm-project/build/tools/clang/lib/Sema -I/home/build-user/llvm-project/clang/lib/Sema -I/home/build-user/llvm-project/clang/include -I/home/build-user/llvm-project/build/tools/clang/include -I/home/build-user/llvm-project/build/include -I/home/build-user/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaDecl.cpp.o -MF tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaDecl.cpp.o.d -o tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaDecl.cpp.o -c /home/build-user/llvm-project/clang/lib/Sema/SemaDecl.cpp
/home/build-user/llvm-project/clang/lib/Sema/SemaDecl.cpp: In function 'bool mergeFunctionDeclBoundsAttributes(clang::FunctionDecl*, clang::FunctionDecl*, clang::Sema&)':
/home/build-user/llvm-project/clang/lib/Sema/SemaDecl.cpp:4050:22: warning: unused variable 'FT' [-Wunused-variable]
 4050 |     } else if (auto *FT = New->getType()->getAs<FunctionNoProtoType>()) {
      |                      ^~
/home/build-user/llvm-project/clang/lib/Sema/SemaDecl.cpp: In function 'bool mergeFunctionDeclTerminatedByAttribute(clang::FunctionDecl*, clang::FunctionDecl*, clang::Sema&)':
/home/build-user/llvm-project/clang/lib/Sema/SemaDecl.cpp:4168:22: warning: unused variable 'FT' [-Wunused-variable]
 4168 |     } else if (auto *FT = New->getType()->getAs<FunctionNoProtoType>()) {
      |                      ^~
[256/4464] /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/build-user/llvm-project/build/tools/clang/lib/Sema -I/home/build-user/llvm-project/clang/lib/Sema -I/home/build-user/llvm-project/clang/include -I/home/build-user/llvm-project/build/tools/clang/include -I/home/build-user/llvm-project/build/include -I/home/build-user/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/DynamicCountPointerAssignmentAnalysis.cpp.o -MF tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/DynamicCountPointerAssignmentAnalysis.cpp.o.d -o tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/DynamicCountPointerAssignmentAnalysis.cpp.o -c /home/build-user/llvm-project/clang/lib/Sema/DynamicCountPointerAssignmentAnalysis.cpp
/home/build-user/llvm-project/clang/lib/Sema/DynamicCountPointerAssignmentAnalysis.cpp: In function 'void {anonymous}::analyzeAssignedDeclCommon(clang::Sema&, clang::ValueDecl*, clang::QualType, {anonymous}::AssignedDeclRefResult&)':
/home/build-user/llvm-project/clang/lib/Sema/DynamicCountPointerAssignmentAnalysis.cpp:171:13: warning: unused variable 'DCPTy' [-Wunused-variable]
  171 |   if (auto *DCPTy = Ty->getAs<CountAttributedType>()) {
      |             ^~~~~
/home/build-user/llvm-project/clang/lib/Sema/DynamicCountPointerAssignmentAnalysis.cpp: In member function 'void {anonymous}::PreAssignCheck::buildAndChain(clang::QualType, clang::Expr*)':
/home/build-user/llvm-project/clang/lib/Sema/DynamicCountPointerAssignmentAnalysis.cpp:839:21: warning: unused variable 'DBPTy' [-Wunused-variable]
  839 |     if (const auto *DBPTy = Ty->getAs<BoundsAttributedType>()) {
      |                     ^~~~~
/home/build-user/llvm-project/clang/lib/Sema/DynamicCountPointerAssignmentAnalysis.cpp: In function 'bool {anonymous}::diagnoseRecordInitsImpl(clang::Sema&, clang::InitListExpr*, bool&, bool, llvm::SmallVectorImpl<clang::Expr*>&)':
/home/build-user/llvm-project/clang/lib/Sema/DynamicCountPointerAssignmentAnalysis.cpp:2393:13: warning: unused variable 'AT' [-Wunused-variable]
 2393 |   if (auto *AT = SemaRef.Context.getAsArrayType(IL->getType())) {
      |             ^~
/home/build-user/llvm-project/clang/lib/Sema/DynamicCountPointerAssignmentAnalysis.cpp: In member function 'clang::Expr* {anonymous}::CheckCountAttributedDeclAssignments::HandleInitListExpr(clang::InitListExpr*, {anonymous}::PreAssignCheck&)':
/home/build-user/llvm-project/clang/lib/Sema/DynamicCountPointerAssignmentAnalysis.cpp:2617:24: warning: unused variable 'OrigDCPTy' [-Wunused-variable]
 2617 |       } else if (auto *OrigDCPTy = FD->getType()->getAs<CountAttributedType>()) {
      |                        ^~~~~~~~~
/home/build-user/llvm-project/clang/lib/Sema/DynamicCountPointerAssignmentAnalysis.cpp:2654:13: warning: unused variable 'AT' [-Wunused-variable]
 2654 |   if (auto *AT = SemaRef.Context.getAsArrayType(IL->getType())) {
      |             ^~
[487/4464] /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/build-user/llvm-project/build/tools/clang/lib/Sema -I/home/build-user/llvm-project/clang/lib/Sema -I/home/build-user/llvm-project/clang/include -I/home/build-user/llvm-project/build/tools/clang/include -I/home/build-user/llvm-project/build/include -I/home/build-user/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaExpr.cpp.o -MF tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaExpr.cpp.o.d -o tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaExpr.cpp.o -c /home/build-user/llvm-project/clang/lib/Sema/SemaExpr.cpp
/home/build-user/llvm-project/clang/lib/Sema/SemaExpr.cpp: In member function 'bool clang::Sema::isCompatibleBoundsUnsafeAssignment(clang::Sema::AssignConvertType) const':
/home/build-user/llvm-project/clang/lib/Sema/SemaExpr.cpp:12145:1: warning: control reaches end of non-void function [-Wreturn-type]
12145 | }
      | ^
[1405/4464] /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/build-user/llvm-project/build/tools/clang/lib/CodeGen -I/home/build-user/llvm-project/clang/lib/CodeGen -I/home/build-user/llvm-project/clang/include -I/home/build-user/llvm-project/build/tools/clang/include -I/home/build-user/llvm-project/build/include -I/home/build-user/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BoundsSafetyOptRemarks.cpp.o -MF tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BoundsSafetyOptRemarks.cpp.o.d -o tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BoundsSafetyOptRemarks.cpp.o -c /home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyOptRemarks.cpp
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyOptRemarks.cpp:25: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   25 | #pragma clang diagnostic push
      | 
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyOptRemarks.cpp:26: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   26 | #pragma clang diagnostic ignored "-Wcovered-switch-default"
      | 
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyOptRemarks.cpp:29: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   29 | #pragma clang diagnostic pop
      | 
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyOptRemarks.cpp:46: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   46 | #pragma clang diagnostic push
      | 
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyOptRemarks.cpp:47: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   47 | #pragma clang diagnostic ignored "-Wcovered-switch-default"
      | 
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyOptRemarks.cpp:50: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   50 | #pragma clang diagnostic pop
      | 
[1410/4464] /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/build-user/llvm-project/build/tools/clang/lib/CodeGen -I/home/build-user/llvm-project/clang/lib/CodeGen -I/home/build-user/llvm-project/clang/include -I/home/build-user/llvm-project/build/tools/clang/include -I/home/build-user/llvm-project/build/include -I/home/build-user/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BoundsSafetyTraps.cpp.o -MF tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BoundsSafetyTraps.cpp.o.d -o tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BoundsSafetyTraps.cpp.o -c /home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyTraps.cpp
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyTraps.cpp:77: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   77 | #pragma clang diagnostic push
      | 
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyTraps.cpp:78: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   78 | #pragma clang diagnostic ignored "-Wcovered-switch-default"
      | 
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyTraps.cpp:81: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   81 | #pragma clang diagnostic pop
      | 
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyTraps.cpp: In function 'llvm::StringRef clang::CodeGen::GetBoundsSafetyTrapMessageSuffixWithContext(clang::CodeGen::BoundsSafetyTrapKind, clang::CodeGen::BoundsSafetyTrapCtx::Kind)':
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyTraps.cpp:26:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
   26 |     switch (TrapCtx) {
      |     ^~~~~~
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyTraps.cpp:40:3: note: here
   40 |   case BNS_TRAP_PTR_GT_UPPER_BOUND:
      |   ^~~~
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyTraps.cpp:42:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
   42 |     switch (TrapCtx) {
      |     ^~~~~~
/home/build-user/llvm-project/clang/lib/CodeGen/BoundsSafetyTraps.cpp:58:3: note: here
   58 |   default:
      |   ^~~~~~~
[1412/4464] /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/build-user/llvm-project/build/tools/clang/lib/CodeGen -I/home/build-user/llvm-project/clang/lib/CodeGen -I/home/build-user/llvm-project/clang/include -I/home/build-user/llvm-project/build/tools/clang/include -I/home/build-user/llvm-project/build/include -I/home/build-user/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/CGExprAgg.cpp.o -MF tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/CGExprAgg.cpp.o.d -o tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/CGExprAgg.cpp.o -c /home/build-user/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp
/home/build-user/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp: In member function 'void {anonymous}::AggExprEmitter::VisitBoundsSafetyPointerPromotionExpr(clang::BoundsSafetyPointerPromotionExpr*)':
/home/build-user/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:505:13: warning: unused variable 'LowerE' [-Wunused-variable]
  505 |   if (auto *LowerE = E->getLowerBound()) {
      |             ^~~~~~
[1428/4464] /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/build-user/llvm-project/build/tools/clang/lib/CodeGen -I/home/build-user/llvm-project/clang/lib/CodeGen -I/home/build-user/llvm-project/clang/include -I/home/build-user/llvm-project/build/tools/clang/include -I/home/build-user/llvm-project/build/include -I/home/build-user/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/CGExpr.cpp.o -MF tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/CGExpr.cpp.o.d -o tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/CGExpr.cpp.o -c /home/build-user/llvm-project/clang/lib/CodeGen/CGExpr.cpp
/home/build-user/llvm-project/clang/lib/CodeGen/CGExpr.cpp: In member function 'clang::CodeGen::Address clang::CodeGen::CodeGenFunction::EmitArrayToWidePointerDecay(const clang::Expr*, llvm::Value*&, clang::CodeGen::LValueBaseInfo*, clang::CodeGen::TBAAAccessInfo*, clang::CodeGen::TBAAAccessInfo*)':
/home/build-user/llvm-project/clang/lib/CodeGen/CGExpr.cpp:4718:17: warning: unused variable 'IAT' [-Wunused-variable]
 4718 |   else if (auto IAT = dyn_cast<IncompleteArrayType>(SrcTy)) {
      |                 ^~~
delcypher commented 20 hours ago

For the macOS job we have test failures.

1 warning(s) in tests
********************
Failed Tests (15):
  LLVM :: Transforms/ConstraintElimination/gep-chains.ll
  LLVM :: Transforms/ConstraintElimination/geps-inbounds-precondition-ub-in-use-blocks.ll
  LLVM :: Transforms/ConstraintElimination/geps-inbounds-precondition.ll
  LLVM :: Transforms/ConstraintElimination/geps-precondition-overflow-check.ll
  LLVM :: Transforms/ConstraintElimination/large-system-growth.ll
  LLVM :: Transforms/ConstraintElimination/loops-bottom-tested-base.ll
  LLVM :: Transforms/ConstraintElimination/loops-bottom-tested-pointer-cmps.ll
  LLVM :: Transforms/ConstraintElimination/loops-header-tested-base.ll
  LLVM :: Transforms/ConstraintElimination/loops-header-tested-pointer-cmps.ll
  LLVM :: Transforms/ConstraintElimination/loops.ll
  LLVM :: Transforms/ConstraintElimination/reproducer-remarks.ll
  LLVM :: Transforms/ConstraintElimination/sext-unsigned-predicates.ll
  LLVM :: Transforms/ConstraintElimination/transfer-signed-facts-to-unsigned-is-known-non-negative.ll
  LLVM :: Transforms/ConstraintElimination/transfer-unsigned-facts-to-signed-is-known-non-negative.ll
  LLVM :: Transforms/Util/auto-init-annotation-remarks.ll

********************
Unexpectedly Passed Tests (1):
  Clang :: BoundsSafety/CodeGen/opt-remarks/bounds-safety-ptr-conversion-O2.c