Skip to content

Commit cda1853

Browse files
authored
Revert "[clang][Sema] Declare builtins used in #pragma intrinsic" (#141994)
Reverts #138205 Breaks Chrome.
1 parent f9073e7 commit cda1853

File tree

3 files changed

+3
-49
lines changed

3 files changed

+3
-49
lines changed

clang/lib/Parse/ParsePragma.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,9 @@ struct PragmaMSRuntimeChecksHandler : public EmptyPragmaHandler {
301301
};
302302

303303
struct PragmaMSIntrinsicHandler : public PragmaHandler {
304-
PragmaMSIntrinsicHandler(Sema &Actions)
305-
: PragmaHandler("intrinsic"), Actions(Actions) {}
304+
PragmaMSIntrinsicHandler() : PragmaHandler("intrinsic") {}
306305
void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
307306
Token &FirstToken) override;
308-
309-
private:
310-
Sema &Actions;
311307
};
312308

313309
// "\#pragma fenv_access (on)".
@@ -521,7 +517,7 @@ void Parser::initializePragmaHandlers() {
521517
PP.AddPragmaHandler(MSOptimize.get());
522518
MSRuntimeChecks = std::make_unique<PragmaMSRuntimeChecksHandler>();
523519
PP.AddPragmaHandler(MSRuntimeChecks.get());
524-
MSIntrinsic = std::make_unique<PragmaMSIntrinsicHandler>(Actions);
520+
MSIntrinsic = std::make_unique<PragmaMSIntrinsicHandler>();
525521
PP.AddPragmaHandler(MSIntrinsic.get());
526522
MSFenvAccess = std::make_unique<PragmaMSFenvAccessHandler>();
527523
PP.AddPragmaHandler(MSFenvAccess.get());
@@ -3797,15 +3793,7 @@ void PragmaMSIntrinsicHandler::HandlePragma(Preprocessor &PP,
37973793
if (!II->getBuiltinID())
37983794
PP.Diag(Tok.getLocation(), diag::warn_pragma_intrinsic_builtin)
37993795
<< II << SuggestIntrinH;
3800-
// If the builtin hasn't already been declared, declare it now.
3801-
DeclarationNameInfo NameInfo(II, Tok.getLocation());
3802-
LookupResult Previous(Actions, NameInfo, Sema::LookupOrdinaryName,
3803-
Actions.forRedeclarationInCurContext());
3804-
Actions.LookupName(Previous, Actions.getCurScope(),
3805-
/*CreateBuiltins*/ false);
3806-
if (Previous.empty())
3807-
Actions.LazilyCreateBuiltin(II, II->getBuiltinID(), Actions.getCurScope(),
3808-
/*ForRedeclaration*/ true, Tok.getLocation());
3796+
38093797
PP.Lex(Tok);
38103798
if (Tok.isNot(tok::comma))
38113799
break;

clang/test/Sema/Inputs/builtin-system-header.h

Lines changed: 0 additions & 9 deletions
This file was deleted.

clang/test/Sema/builtin-pragma-intrinsic.c

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)