From 5d493291bd010bbba0fdc1e7da0922fd214fdffd Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 28 Apr 2021 10:21:31 -0400 Subject: [PATCH] [clang] remove dead code after 2a1332245fc Commit 2a1332245fc extracted this code to a new function checkSectionName() and added a call to it, but didn't remove the original code. The original code is dead since the checkSectionName() early return would fire when it would trigger. (If it weren't dead, it'd make clang crash since err_attribute_section_invalid_for_target now takes two args instead of just the one that's passed.) No behavior change. Differential Revision: https://reviews.llvm.org/D101457 --- clang/lib/Sema/SemaDeclAttr.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index b31f9ec..7db720f 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -3006,13 +3006,6 @@ static void handleSectionAttr(Sema &S, Decl *D, const ParsedAttr &AL) { if (!S.checkSectionName(LiteralLoc, Str)) return; - // If the target wants to validate the section specifier, make it happen. - if (llvm::Error E = S.Context.getTargetInfo().isValidSectionSpecifier(Str)) { - S.Diag(LiteralLoc, diag::err_attribute_section_invalid_for_target) - << toString(std::move(E)); - return; - } - SectionAttr *NewAttr = S.mergeSectionAttr(D, AL, Str); if (NewAttr) { D->addAttr(NewAttr); -- 2.7.4