]> granicus.if.org Git - clang/commitdiff
Add missing PCH support for -fstack-protector.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 21 Sep 2009 04:16:19 +0000 (04:16 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 21 Sep 2009 04:16:19 +0000 (04:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82435 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticFrontendKinds.td
lib/Frontend/PCHReader.cpp
lib/Frontend/PCHWriter.cpp

index 30193f1a875638e576ecce003324a98056167380..b4e7f1093b581c7ebc7fc7134a2d0abfe8404b8f 100644 (file)
@@ -73,7 +73,7 @@ def warn_pch_altivec : Error<
 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_thread_safe_statics : Error<
 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">;
index cd08b13547127d91bc20e5b528115a28186a619f..9c855eb26f1d6289ab2b1970dd6b130b6ff85d31 100644 (file)
@@ -106,9 +106,11 @@ PCHValidator::ReadLanguageOptions(const LangOptions &LangOpts) {
     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 @@ bool PCHReader::ParseLanguageOptions(
     ++Idx;
     LangOpts.setVisibilityMode((LangOptions::VisibilityMode)Record[Idx]);
     ++Idx;
+    LangOpts.setStackProtectorMode((LangOptions::StackProtectorMode)
+                                   Record[Idx]);
+    ++Idx;
     PARSE_LANGOPT(InstantiationDepth);
     PARSE_LANGOPT(OpenCL);
   #undef PARSE_LANGOPT
index a6918e4c850aee00f74a8b472d4a562ff1b1f87b..531c6f7818452c144c672f7824843b012642d430 100644 (file)
@@ -625,6 +625,7 @@ void PCHWriter::WriteLanguageOptions(const LangOptions &LangOpts) {
                                            // 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);