Ted Kremenek | 4914209 | 2007-12-05 19:06:15 +0000 | [diff] [blame^] | 1 | //===--- SourceManager.cpp - Track and cache source files -----------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by Ted Kremenek and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 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); |
| 33 | S.EmitBool((bool) ObjC2); |
| 34 | S.EmitBool((bool) PascalStrings); |
| 35 | S.EmitBool((bool) Boolean); |
| 36 | S.EmitBool((bool) WritableStrings); |
| 37 | S.EmitBool((bool) LaxVectorConversions); |
| 38 | } |
| 39 | |
| 40 | void LangOptions::Read(llvm::Deserializer& D) { |
| 41 | Trigraphs = D.ReadBool() ? 1 : 0; |
| 42 | BCPLComment = D.ReadBool() ? 1 : 0; |
| 43 | DollarIdents = D.ReadBool() ? 1 : 0; |
| 44 | Digraphs = D.ReadBool() ? 1 : 0; |
| 45 | HexFloats = D.ReadBool() ? 1 : 0; |
| 46 | C99 = D.ReadBool() ? 1 : 0; |
| 47 | Microsoft = D.ReadBool() ? 1 : 0; |
| 48 | CPlusPlus = D.ReadBool() ? 1 : 0; |
| 49 | CPlusPlus0x = D.ReadBool() ? 1 : 0; |
| 50 | NoExtensions = D.ReadBool() ? 1 : 0; |
| 51 | CXXOperatorNames = D.ReadBool() ? 1 : 0; |
| 52 | ObjC1 = D.ReadBool() ? 1 : 0; |
| 53 | ObjC2 = D.ReadBool() ? 1 : 0; |
| 54 | PascalStrings = D.ReadBool() ? 1 : 0; |
| 55 | Boolean = D.ReadBool() ? 1 : 0; |
| 56 | WritableStrings = D.ReadBool() ? 1 : 0; |
| 57 | LaxVectorConversions = D.ReadBool() ? 1 : 0; |
| 58 | } |