[PATCH] D42248: Always allow "#pragma region".

Matt Davis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 18 17:19:03 PST 2018

mattd updated this revision to Diff 130523.
mattd retitled this revision from "[LangOpts] Add a LangOpt to represent "#pragma region" support." to "Always allow "#pragma region".".
mattd edited the summary of this revision.
mattd added a comment.

I'm certainly fine with always allowing this pragma.   I can see it useful for other editors that might wish to utilize the hint.



Index: test/Frontend/region-pragmas.c
--- test/Frontend/region-pragmas.c
+++ test/Frontend/region-pragmas.c
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -Wall -verify %s
+// expected-no-diagnostics
+#pragma region foo
+#pragma endregion foo
Index: lib/Lex/Pragma.cpp
--- lib/Lex/Pragma.cpp
+++ lib/Lex/Pragma.cpp
@@ -1776,13 +1776,15 @@
   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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42248.130523.patch
Type: text/x-patch
Size: 1112 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180119/38123f99/attachment.bin>

More information about the cfe-commits mailing list