Chris Lattner | f62aea3 | 2007-12-13 05:02:35 +0000 | [diff] [blame] | 1 | //===--- LangOptions.cpp - Language feature info --------------------------===// |
Ted Kremenek | 4914209 | 2007-12-05 19:06:15 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 0bc735f | 2007-12-29 19:59:25 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Ted Kremenek | 4914209 | 2007-12-05 19:06:15 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the methods for LangOptions. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "clang/Basic/LangOptions.h" |
| 15 | #include "llvm/Bitcode/Serialize.h" |
| 16 | #include "llvm/Bitcode/Deserialize.h" |
| 17 | |
| 18 | using namespace clang; |
| 19 | |
| 20 | void LangOptions::Emit(llvm::Serializer& S) const { |
| 21 | S.EmitBool((bool) Trigraphs); |
| 22 | S.EmitBool((bool) BCPLComment); |
| 23 | S.EmitBool((bool) DollarIdents); |
| 24 | S.EmitBool((bool) Digraphs); |
| 25 | S.EmitBool((bool) HexFloats); |
| 26 | S.EmitBool((bool) C99); |
| 27 | S.EmitBool((bool) Microsoft); |
| 28 | S.EmitBool((bool) CPlusPlus); |
| 29 | S.EmitBool((bool) CPlusPlus0x); |
| 30 | S.EmitBool((bool) NoExtensions); |
| 31 | S.EmitBool((bool) CXXOperatorNames); |
| 32 | S.EmitBool((bool) ObjC1); |
Ted Kremenek | 01d9dbf | 2008-04-29 04:37:03 +0000 | [diff] [blame] | 33 | S.EmitBool((bool) ObjC2); |
| 34 | S.EmitBool((unsigned) GC); |
Ted Kremenek | 4914209 | 2007-12-05 19:06:15 +0000 | [diff] [blame] | 35 | S.EmitBool((bool) PascalStrings); |
| 36 | S.EmitBool((bool) Boolean); |
| 37 | S.EmitBool((bool) WritableStrings); |
| 38 | S.EmitBool((bool) LaxVectorConversions); |
| 39 | } |
| 40 | |
| 41 | void LangOptions::Read(llvm::Deserializer& D) { |
| 42 | Trigraphs = D.ReadBool() ? 1 : 0; |
| 43 | BCPLComment = D.ReadBool() ? 1 : 0; |
| 44 | DollarIdents = D.ReadBool() ? 1 : 0; |
| 45 | Digraphs = D.ReadBool() ? 1 : 0; |
| 46 | HexFloats = D.ReadBool() ? 1 : 0; |
| 47 | C99 = D.ReadBool() ? 1 : 0; |
| 48 | Microsoft = D.ReadBool() ? 1 : 0; |
| 49 | CPlusPlus = D.ReadBool() ? 1 : 0; |
| 50 | CPlusPlus0x = D.ReadBool() ? 1 : 0; |
| 51 | NoExtensions = D.ReadBool() ? 1 : 0; |
| 52 | CXXOperatorNames = D.ReadBool() ? 1 : 0; |
| 53 | ObjC1 = D.ReadBool() ? 1 : 0; |
| 54 | ObjC2 = D.ReadBool() ? 1 : 0; |
Ted Kremenek | 01d9dbf | 2008-04-29 04:37:03 +0000 | [diff] [blame] | 55 | GC = D.ReadInt(); |
Ted Kremenek | 4914209 | 2007-12-05 19:06:15 +0000 | [diff] [blame] | 56 | PascalStrings = D.ReadBool() ? 1 : 0; |
| 57 | Boolean = D.ReadBool() ? 1 : 0; |
| 58 | WritableStrings = D.ReadBool() ? 1 : 0; |
| 59 | LaxVectorConversions = D.ReadBool() ? 1 : 0; |
| 60 | } |