Always allow "#pragma region".

Summary:
Both MS and PS4 targets are capable of recognizing the
existence of:  #pragma region, #pragma endregion.

Since this pragma is only a hint for certain editors, and has no logic,
it seems helpful to permit this pragma in all cases, not just MS compatibility mode.



Reviewers: rnk, rsmith, majnemer

Reviewed By: majnemer

Subscribers: Quuxplusone, probinson, majnemer, cfe-commits

Differential Revision: https://reviews.llvm.org/D42248

llvm-svn: 323577
This commit is contained in:
Matt Davis 2018-01-27 00:25:29 +00:00
parent cff94627cf
commit 1edb905e82
2 changed files with 9 additions and 2 deletions

View File

@ -1776,13 +1776,15 @@ void Preprocessor::RegisterBuiltinPragmas() {
ModuleHandler->AddPragma(new PragmaModuleEndHandler());
ModuleHandler->AddPragma(new PragmaModuleBuildHandler());
ModuleHandler->AddPragma(new PragmaModuleLoadHandler());
// Add region pragmas.
AddPragmaHandler(new PragmaRegionHandler("region"));
AddPragmaHandler(new PragmaRegionHandler("endregion"));
// MS extensions.
if (LangOpts.MicrosoftExt) {
AddPragmaHandler(new PragmaWarningHandler());
AddPragmaHandler(new PragmaIncludeAliasHandler());
AddPragmaHandler(new PragmaRegionHandler("region"));
AddPragmaHandler(new PragmaRegionHandler("endregion"));
}
// Pragmas added by plugins

View File

@ -0,0 +1,5 @@
// RUN: %clang_cc1 -Wall -verify %s
// expected-no-diagnostics
#pragma region foo
#pragma endregion foo