Make the StackProtector bitfield use enums instead of obscure numbers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74414 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h
index 9b308e1..aed8822 100644
--- a/include/clang/Basic/LangOptions.h
+++ b/include/clang/Basic/LangOptions.h
@@ -84,16 +84,16 @@
 
   unsigned OpenCL            : 1; // OpenCL C99 language extensions.
 
-  unsigned StackProtector    : 2; // Whether stack protectors are on:
-                                  //   0 - None
-                                  //   1 - On
-                                  //   2 - All
-
 private:
-  unsigned GC : 2; // Objective-C Garbage Collection modes.  We declare
-                   // this enum as unsigned because MSVC insists on making enums
-                   // signed.  Set/Query this value using accessors.  
+  unsigned GC : 2;                // Objective-C Garbage Collection modes.  We
+                                  // declare this enum as unsigned because MSVC
+                                  // insists on making enums signed.  Set/Query
+                                  // this value using accessors.
   unsigned SymbolVisibility  : 3; // Symbol's visibility.
+  unsigned StackProtector    : 2; // Whether stack protectors are on. We declare
+                                  // this enum as unsigned because MSVC insists
+                                  // on making enums signed.  Set/Query this
+                                  // value using accessors.
 
   /// The user provided name for the "main file", if non-null. This is
   /// useful in situations where the input file name does not match
@@ -104,6 +104,7 @@
   unsigned InstantiationDepth;    // Maximum template instantiation depth.
 
   enum GCMode { NonGC, GCOnly, HybridGC };
+  enum StackProtectorMode { SSPOff, SSPOn, SSPReq };
   enum VisibilityMode { 
     Default, 
     Protected, 
@@ -156,6 +157,13 @@
   GCMode getGCMode() const { return (GCMode) GC; }
   void setGCMode(GCMode m) { GC = (unsigned) m; }
 
+  StackProtectorMode getStackProtectorMode() const {
+    return static_cast<StackProtectorMode>(StackProtector);
+  }
+  void setStackProtectorMode(StackProtectorMode m) {
+    StackProtector = static_cast<unsigned>(m);
+  }
+
   const char *getMainFileName() const { return MainFileName; }
   void setMainFileName(const char *Name) { MainFileName = Name; }