Skip to content

Commit 0d07ce1

Browse files
Googlercopybara-github
authored andcommitted
Remove -fretain-subst-template-type-parm-type-ast-nodes from nullability code.
llvm/llvm-project#132748 makes this flag a no-op PiperOrigin-RevId: 747946560 Change-Id: Id2c92df6b2eb2c62dcdf8bb59e96b8e3cb118723
1 parent d2d37e5 commit 0d07ce1

File tree

4 files changed

+7
-25
lines changed

4 files changed

+7
-25
lines changed

nullability/inference/augmented_test_inputs.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ TestInputs getAugmentedTestInputs(llvm::StringRef Source,
2929
for (const auto& Entry : llvm::ArrayRef(ctn_replacement_macros_create(),
3030
ctn_replacement_macros_size()))
3131
Inputs.ExtraFiles.try_emplace(Entry.name, Entry.data);
32-
// TODO: b/357760487 -- use the flag until the issue is resolved or we find a
33-
// workaround.
34-
Inputs.ExtraArgs.push_back(
35-
"-fretain-subst-template-type-parm-type-ast-nodes");
32+
3633
Inputs.ExtraArgs.push_back("-I.");
3734
Inputs.ExtraArgs.push_back("-include");
3835
Inputs.ExtraArgs.push_back("nullability_annotations.h");

nullability/inference/infer_tu_main.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,7 @@ int main(int argc, const char **absl_nonnull argv) {
319319
"-w",
320320
// Include the file containing macro replacements that enable
321321
// additional inference.
322-
"-include", std::string(ReplacementMacrosHeaderFileName),
323-
// TODO: b/357760487 -- use the flag until the issue is resolved or
324-
// we find a workaround.
325-
"-Xclang", "-fretain-subst-template-type-parm-type-ast-nodes"},
322+
"-include", std::string(ReplacementMacrosHeaderFileName)},
326323
ArgumentInsertPosition::BEGIN));
327324
QCHECK(!Err) << toString(std::move(Err));
328325
}

nullability/test/nullability_test.cc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -647,14 +647,10 @@ int main(int argc, const char **argv) {
647647
// Run in C++17 and C++20 mode to cover differences in the AST between modes
648648
// (e.g. C++20 can contain `CXXRewrittenBinaryOperator`).
649649
for (const char *CxxMode : {"-std=c++17", "-std=c++20"})
650-
require(Executor.execute(
651-
clang::tooling::newFrontendActionFactory(&F, &F),
652-
clang::tooling::getInsertArgumentAdjuster(
653-
// Ensure test_headers are on the include path.
654-
{"-isystem.", CxxMode,
655-
// TODO: b/357760487 -- use the flag until the issue is resolved or
656-
// we find a workaround.
657-
"-Xclang", "-fretain-subst-template-type-parm-type-ast-nodes"},
658-
clang::tooling::ArgumentInsertPosition::END)));
650+
require(Executor.execute(clang::tooling::newFrontendActionFactory(&F, &F),
651+
clang::tooling::getInsertArgumentAdjuster(
652+
// Ensure test_headers are on the include path.
653+
{"-isystem.", CxxMode},
654+
clang::tooling::ArgumentInsertPosition::END)));
659655
return F.Output.hadErrors() ? 1 : 0;
660656
}

nullability/type_nullability_test.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,6 @@ class GetTypeNullabilityTest : public ::testing::Test {
418418
Inputs.ExtraArgs.push_back("nullability.h");
419419
Inputs.ExtraArgs.push_back("-include");
420420
Inputs.ExtraArgs.push_back("header.h");
421-
// TODO: b/357760487 -- use the flag until the issue is resolved or we find
422-
// a workaround.
423-
Inputs.ExtraArgs.push_back(
424-
"-fretain-subst-template-type-parm-type-ast-nodes");
425421
Inputs.ExtraFiles["nullability.h"] = R"cpp(
426422
template <class X>
427423
using Nullable [[clang::annotate("Nullable")]] = X _Nullable;
@@ -793,10 +789,6 @@ std::vector<ComparableNullabilityLoc> getComparableNullabilityLocs(
793789
TestInputs Inputs(AnnotatedInput.code());
794790
Inputs.MakeAction = makeRegisterPragmasAction(Pragmas);
795791
Inputs.Language = TestLanguage::Lang_CXX17;
796-
// TODO: b/357760487 -- use the flag until the issue is resolved or we find a
797-
// workaround.
798-
Inputs.ExtraArgs.push_back(
799-
"-fretain-subst-template-type-parm-type-ast-nodes");
800792
if (!HeaderWithAttributes.empty()) {
801793
Inputs.ExtraFiles["header.h"] = HeaderWithAttributes;
802794
Inputs.ExtraArgs.push_back("-include");

0 commit comments

Comments
 (0)