blob: f7fd91fbda55eab91fbd0eaaa490d9763e6d2d98 [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);
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
40void 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}