Successfully identified regression in *llvm* in CI configuration tcwg_bmk_llvm_tx1/llvm-release-aarch64-spec2k6-O2. So far, this commit has regressed CI configurations: - tcwg_bmk_llvm_tx1/llvm-release-aarch64-spec2k6-O2
Culprit: <cut> commit 50b523cb2ceee4ca7279b4ce22ddb0d0b05df313 Author: Stephen Kelly steveire@gmail.com Date: Mon Apr 26 18:28:50 2021 +0100
[AST] Fix DeclarationNameInfo introspection
Some AST classes return `const DeclarationNameInfo &` instead of returning by value (eg CXXDependentScopeMemberExpr). </cut>
Results regressed to (for first_bad == 50b523cb2ceee4ca7279b4ce22ddb0d0b05df313) # reset_artifacts: -10 # build_abe binutils: -9 # build_abe stage1 -- --set gcc_override_configure=--disable-libsanitizer: -8 # build_abe linux: -7 # build_abe glibc: -6 # build_abe stage2 -- --set gcc_override_configure=--disable-libsanitizer: -5 # build_llvm true: -3 # true: 0 # benchmark -- -O2 artifacts/build-50b523cb2ceee4ca7279b4ce22ddb0d0b05df313/results_id: 1 # 433.milc,[.] mult_su3_mat_vec regressed by 115
from (for last_good == 10038d0b3dfcfa6abf8a710612899f859ef1534b) # reset_artifacts: -10 # build_abe binutils: -9 # build_abe stage1 -- --set gcc_override_configure=--disable-libsanitizer: -8 # build_abe linux: -7 # build_abe glibc: -6 # build_abe stage2 -- --set gcc_override_configure=--disable-libsanitizer: -5 # build_llvm true: -3 # true: 0 # benchmark -- -O2 artifacts/build-10038d0b3dfcfa6abf8a710612899f859ef1534b/results_id: 1
Artifacts of last_good build: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-... Results ID of last_good: tx1_64/tcwg_bmk_llvm_tx1/bisect-llvm-release-aarch64-spec2k6-O2/4634 Artifacts of first_bad build: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-... Results ID of first_bad: tx1_64/tcwg_bmk_llvm_tx1/bisect-llvm-release-aarch64-spec2k6-O2/4631 Build top page/logs: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-...
Configuration details:
Reproduce builds: <cut> mkdir investigate-llvm-50b523cb2ceee4ca7279b4ce22ddb0d0b05df313 cd investigate-llvm-50b523cb2ceee4ca7279b4ce22ddb0d0b05df313
git clone https://git.linaro.org/toolchain/jenkins-scripts
mkdir -p artifacts/manifests curl -o artifacts/manifests/build-baseline.sh https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-... --fail curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-... --fail curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-... --fail chmod +x artifacts/test.sh
# Reproduce the baseline build (build all pre-requisites) ./jenkins-scripts/tcwg_bmk-build.sh @@ artifacts/manifests/build-baseline.sh
# Save baseline build state (which is then restored in artifacts/test.sh) mkdir -p ./bisect rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ --exclude /llvm/ ./ ./bisect/baseline/
cd llvm
# Reproduce first_bad build git checkout --detach 50b523cb2ceee4ca7279b4ce22ddb0d0b05df313 ../artifacts/test.sh
# Reproduce last_good build git checkout --detach 10038d0b3dfcfa6abf8a710612899f859ef1534b ../artifacts/test.sh
cd .. </cut>
History of pending regressions and results: https://git.linaro.org/toolchain/ci/base-artifacts.git/log/?h=linaro-local/c...
Artifacts: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-... Build log: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-...
Full commit (up to 1000 lines): <cut> commit 50b523cb2ceee4ca7279b4ce22ddb0d0b05df313 Author: Stephen Kelly steveire@gmail.com Date: Mon Apr 26 18:28:50 2021 +0100
[AST] Fix DeclarationNameInfo introspection
Some AST classes return `const DeclarationNameInfo &` instead of returning by value (eg CXXDependentScopeMemberExpr). --- clang/lib/Tooling/DumpTool/ASTSrcLocProcessor.cpp | 3 + .../unittests/Introspection/IntrospectionTest.cpp | 66 ++++++++++++++++++++++ 2 files changed, 69 insertions(+)
diff --git a/clang/lib/Tooling/DumpTool/ASTSrcLocProcessor.cpp b/clang/lib/Tooling/DumpTool/ASTSrcLocProcessor.cpp index 0aeb3a7703f7..0a7fb9b52f23 100644 --- a/clang/lib/Tooling/DumpTool/ASTSrcLocProcessor.cpp +++ b/clang/lib/Tooling/DumpTool/ASTSrcLocProcessor.cpp @@ -225,6 +225,9 @@ void ASTSrcLocProcessor::run(const MatchFinder::MatchResult &Result) { CaptureMethods("class clang::NestedNameSpecifierLoc", ASTClass, Result); CD.DeclNameInfos = CaptureMethods("struct clang::DeclarationNameInfo", ASTClass, Result); + auto DI = CaptureMethods("const struct clang::DeclarationNameInfo &", + ASTClass, Result); + CD.DeclNameInfos.insert(CD.DeclNameInfos.end(), DI.begin(), DI.end());
if (const auto *DerivedFrom = Result.Nodes.getNodeAsclang::CXXRecordDecl("derivedFrom")) { diff --git a/clang/unittests/Introspection/IntrospectionTest.cpp b/clang/unittests/Introspection/IntrospectionTest.cpp index 521520c9a7c7..d4f626bfeb74 100644 --- a/clang/unittests/Introspection/IntrospectionTest.cpp +++ b/clang/unittests/Introspection/IntrospectionTest.cpp @@ -1456,6 +1456,72 @@ getNamedTypeInfo()->getTypeLoc().getAsclang::TypeSpecTypeLoc().getNameLoc()), STRING_LOCATION_PAIR((&NI), getSourceRange()))); }
+TEST(Introspection, SourceLocations_DeclarationNameInfo_CRef) { + if (!NodeIntrospection::hasIntrospectionSupport()) + return; + + auto AST = buildASTFromCodeWithArgs( + R"cpp( +template<typename T> +struct MyContainer +{ + template <typename U> + void pushBack(); +}; + +template<typename T> +void foo() +{ + MyContainer<T> mc; + mc.template pushBack<int>(); +} +)cpp", + {"-fno-delayed-template-parsing"}, "foo.cpp", "clang-tool", + std::make_shared<PCHContainerOperations>()); + + auto &Ctx = AST->getASTContext(); + auto &TU = *Ctx.getTranslationUnitDecl(); + + auto BoundNodes = ast_matchers::match( + decl(hasDescendant(cxxDependentScopeMemberExpr(hasMemberName("pushBack")).bind("member"))), TU, + Ctx); + + EXPECT_EQ(BoundNodes.size(), 1u); + + const auto *Member = BoundNodes[0].getNodeAs<CXXDependentScopeMemberExpr>("member"); + auto Result = NodeIntrospection::GetLocations(Member); + + auto ExpectedLocations = + FormatExpected<SourceLocation>(Result.LocationAccessors); + + llvm::sort(ExpectedLocations); + + EXPECT_EQ( + llvm::makeArrayRef(ExpectedLocations), + (ArrayRef<std::pair<std::string, SourceLocation>>{ + STRING_LOCATION_STDPAIR(Member, getBeginLoc()), + STRING_LOCATION_STDPAIR(Member, getEndLoc()), + STRING_LOCATION_STDPAIR(Member, getExprLoc()), + STRING_LOCATION_STDPAIR(Member, getLAngleLoc()), + STRING_LOCATION_STDPAIR(Member, getMemberLoc()), + STRING_LOCATION_STDPAIR(Member, getMemberNameInfo().getBeginLoc()), + STRING_LOCATION_STDPAIR(Member, getMemberNameInfo().getEndLoc()), + STRING_LOCATION_STDPAIR(Member, getMemberNameInfo().getLoc()), + STRING_LOCATION_STDPAIR(Member, getOperatorLoc()), + STRING_LOCATION_STDPAIR(Member, getRAngleLoc()), + STRING_LOCATION_STDPAIR(Member, getTemplateKeywordLoc()) + })); + + auto ExpectedRanges = FormatExpected<SourceRange>(Result.RangeAccessors); + + EXPECT_THAT( + ExpectedRanges, + UnorderedElementsAre( + STRING_LOCATION_PAIR(Member, getMemberNameInfo().getSourceRange()), + STRING_LOCATION_PAIR(Member, getSourceRange()) + )); +} + TEST(Introspection, SourceLocations_DeclarationNameInfo_ConvOp) { if (!NodeIntrospection::hasIntrospectionSupport()) return; </cut>