blob: 6119afc79061baf484c04eb9521886bec0b08fd4 [file] [log] [blame]
Chris Lattnerf62aea32007-12-13 05:02:35 +00001//===--- LangOptions.cpp - Language feature info --------------------------===//
Ted Kremenek49142092007-12-05 19:06:15 +00002//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner0bc735f2007-12-29 19:59:25 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Ted Kremenek49142092007-12-05 19:06:15 +00007//
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
18using namespace clang;
19
20void 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 Kremenek01d9dbf2008-04-29 04:37:03 +000033 S.EmitBool((bool) ObjC2);
34 S.EmitBool((unsigned) GC);
Ted Kremenek49142092007-12-05 19:06:15 +000035 S.EmitBool((bool) PascalStrings);
36 S.EmitBool((bool) Boolean);
37 S.EmitBool((bool) WritableStrings);
38 S.EmitBool((bool) LaxVectorConversions);
39}
40
41void 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 Kremenek01d9dbf2008-04-29 04:37:03 +000055 GC = D.ReadInt();
Ted Kremenek49142092007-12-05 19:06:15 +000056 PascalStrings = D.ReadBool() ? 1 : 0;
57 Boolean = D.ReadBool() ? 1 : 0;
58 WritableStrings = D.ReadBool() ? 1 : 0;
59 LaxVectorConversions = D.ReadBool() ? 1 : 0;
60}