diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-29 04:37:03 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-29 04:37:03 +0000 |
commit | 01d9dbf4ae627e2ba42fc23485789a33fa296516 (patch) | |
tree | 12276e949a344ec33f1a1712bf5a497ba0496eaa /include/clang | |
parent | 274f4334f6dd35239e5c3d4b86198f7f5804b059 (diff) |
Add -fobjc-gc and -fobjc-gc-only options to the driver.
Add corresponding enum in LangOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50387 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Basic/LangOptions.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h index 3975c51b9f..589153f47e 100644 --- a/include/clang/Basic/LangOptions.h +++ b/include/clang/Basic/LangOptions.h @@ -21,6 +21,7 @@ namespace clang { /// LangOptions - This class keeps track of the various options that can be /// enabled, which controls the dialect of C that is accepted. struct LangOptions { + unsigned Trigraphs : 1; // Trigraphs in source files. unsigned BCPLComment : 1; // BCPL-style '//' comments. unsigned DollarIdents : 1; // '$' allowed in identifiers. @@ -34,23 +35,34 @@ struct LangOptions { unsigned NoExtensions : 1; // All extensions are disabled, strict mode. unsigned CXXOperatorNames : 1; // Treat C++ operator names as keywords. - unsigned ObjC1 : 1; // Objective C 1 support enabled. - unsigned ObjC2 : 1; // Objective C 2 support enabled. - + unsigned ObjC1 : 1; // Objective-C 1 support enabled. + unsigned ObjC2 : 1; // Objective-C 2 support enabled. + unsigned PascalStrings : 1; // Allow Pascal strings unsigned Boolean : 1; // Allow bool/true/false unsigned WritableStrings : 1; // Allow writable strings unsigned LaxVectorConversions : 1; - + +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. +public: + + enum GCMode { NonGC, GCOnly, HybridGC }; + LangOptions() { Trigraphs = BCPLComment = DollarIdents = ImplicitInt = Digraphs = 0; HexFloats = 0; - ObjC1 = ObjC2 = 0; + GC = ObjC1 = ObjC2 = 0; C99 = Microsoft = CPlusPlus = CPlusPlus0x = NoExtensions = 0; CXXOperatorNames = PascalStrings = Boolean = WritableStrings = 0; LaxVectorConversions = 0; } + GCMode getGCMode() const { return (GCMode) GC; } + void setGCMode(GCMode m) { GC = (unsigned) m; } + /// Emit - Emit this LangOptions object to bitcode. void Emit(llvm::Serializer& S) const; |