[cfe-commits] r82435 - in /cfe/trunk: include/clang/Basic/DiagnosticFrontendKinds.td lib/Frontend/PCHReader.cpp lib/Frontend/PCHWriter.cpp

Daniel Dunbar daniel at zuster.org
Sun Sep 20 21:16:20 PDT 2009


Author: ddunbar
Date: Sun Sep 20 23:16:19 2009
New Revision: 82435

URL: http://llvm.org/viewvc/llvm-project?rev=82435&view=rev
Log:
Add missing PCH support for -fstack-protector.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
    cfe/trunk/lib/Frontend/PCHReader.cpp
    cfe/trunk/lib/Frontend/PCHWriter.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=82435&r1=82434&r2=82435&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Sun Sep 20 23:16:19 2009
@@ -73,7 +73,7 @@
 def warn_pch_opencl : Error<
     "OpenCL language extensions were %select{disabled|enabled}0 in PCH file "
     "but are currently %select{disabled|enabled}1">;
-    def warn_elide_constructors : Error<
+def warn_pch_elide_constructors : Error<
     "Elidable copy constructors were %select{disabled|enabled}0 in PCH file "
     "but are currently %select{disabled|enabled}1">;
 def warn_pch_exceptions : Error<
@@ -95,6 +95,9 @@
 def warn_pch_posix_threads : Error<
     "PCH file was compiled %select{without|with}0 POSIX thread support but "
     "POSIX threads are currently %select{disabled|enabled}1">;
+def warn_pch_stack_protector : Error<
+    "stack protector was %select{off|on|required}0 in PCH file but "
+    "is currently %select{off|on|required}1">;
 def warn_pch_blocks : Error<
     "blocks were %select{disabled|enabled}0 in PCH file but "
     "are currently %select{disabled|enabled}1">;

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=82435&r1=82434&r2=82435&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Sun Sep 20 23:16:19 2009
@@ -106,9 +106,11 @@
     return true;
   }
   PARSE_LANGOPT_BENIGN(getVisibilityMode());
+  PARSE_LANGOPT_IMPORTANT(getStackProtectorMode(),
+                          diag::warn_pch_stack_protector);
   PARSE_LANGOPT_BENIGN(InstantiationDepth);
   PARSE_LANGOPT_IMPORTANT(OpenCL, diag::warn_pch_opencl);
-  PARSE_LANGOPT_IMPORTANT(ElideConstructors, diag::warn_elide_constructors);
+  PARSE_LANGOPT_IMPORTANT(ElideConstructors, diag::warn_pch_elide_constructors);
 #undef PARSE_LANGOPT_IRRELEVANT
 #undef PARSE_LANGOPT_BENIGN
 
@@ -1720,6 +1722,9 @@
     ++Idx;
     LangOpts.setVisibilityMode((LangOptions::VisibilityMode)Record[Idx]);
     ++Idx;
+    LangOpts.setStackProtectorMode((LangOptions::StackProtectorMode)
+                                   Record[Idx]);
+    ++Idx;
     PARSE_LANGOPT(InstantiationDepth);
     PARSE_LANGOPT(OpenCL);
   #undef PARSE_LANGOPT

Modified: cfe/trunk/lib/Frontend/PCHWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriter.cpp?rev=82435&r1=82434&r2=82435&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriter.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriter.cpp Sun Sep 20 23:16:19 2009
@@ -625,6 +625,7 @@
                                            // unsigned type
   Record.push_back(LangOpts.getGCMode());
   Record.push_back(LangOpts.getVisibilityMode());
+  Record.push_back(LangOpts.getStackProtectorMode());
   Record.push_back(LangOpts.InstantiationDepth);
   Record.push_back(LangOpts.OpenCL);
   Record.push_back(LangOpts.ElideConstructors);





More information about the cfe-commits mailing list