summaryrefslogtreecommitdiffstats
path: root/clang/Basic/LangOptions.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-12-05 19:06:15 +0000
committerTed Kremenek <kremenek@apple.com>2007-12-05 19:06:15 +0000
commitae492c4f0ce0233cffc973c79dde61e48f0f1d85 (patch)
tree908a17990449dc4f809e829513cd73ab3d641000 /clang/Basic/LangOptions.cpp
parent3b8a6744699ed627aed422f6516ed00c5d23c089 (diff)
downloadbcm5719-llvm-ae492c4f0ce0233cffc973c79dde61e48f0f1d85.tar.gz
bcm5719-llvm-ae492c4f0ce0233cffc973c79dde61e48f0f1d85.zip
Implemented serialization of LangOptions.
llvm-svn: 44624
Diffstat (limited to 'clang/Basic/LangOptions.cpp')
-rw-r--r--clang/Basic/LangOptions.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/clang/Basic/LangOptions.cpp b/clang/Basic/LangOptions.cpp
new file mode 100644
index 00000000000..f12c77dbc46
--- /dev/null
+++ b/clang/Basic/LangOptions.cpp
@@ -0,0 +1,58 @@
+//===--- SourceManager.cpp - Track and cache source files -----------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Ted Kremenek and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the methods for LangOptions.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Basic/LangOptions.h"
+#include "llvm/Bitcode/Serialize.h"
+#include "llvm/Bitcode/Deserialize.h"
+
+using namespace clang;
+
+void LangOptions::Emit(llvm::Serializer& S) const {
+ S.EmitBool((bool) Trigraphs);
+ S.EmitBool((bool) BCPLComment);
+ S.EmitBool((bool) DollarIdents);
+ S.EmitBool((bool) Digraphs);
+ S.EmitBool((bool) HexFloats);
+ S.EmitBool((bool) C99);
+ S.EmitBool((bool) Microsoft);
+ S.EmitBool((bool) CPlusPlus);
+ S.EmitBool((bool) CPlusPlus0x);
+ S.EmitBool((bool) NoExtensions);
+ S.EmitBool((bool) CXXOperatorNames);
+ S.EmitBool((bool) ObjC1);
+ S.EmitBool((bool) ObjC2);
+ S.EmitBool((bool) PascalStrings);
+ S.EmitBool((bool) Boolean);
+ S.EmitBool((bool) WritableStrings);
+ S.EmitBool((bool) LaxVectorConversions);
+}
+
+void LangOptions::Read(llvm::Deserializer& D) {
+ Trigraphs = D.ReadBool() ? 1 : 0;
+ BCPLComment = D.ReadBool() ? 1 : 0;
+ DollarIdents = D.ReadBool() ? 1 : 0;
+ Digraphs = D.ReadBool() ? 1 : 0;
+ HexFloats = D.ReadBool() ? 1 : 0;
+ C99 = D.ReadBool() ? 1 : 0;
+ Microsoft = D.ReadBool() ? 1 : 0;
+ CPlusPlus = D.ReadBool() ? 1 : 0;
+ CPlusPlus0x = D.ReadBool() ? 1 : 0;
+ NoExtensions = D.ReadBool() ? 1 : 0;
+ CXXOperatorNames = D.ReadBool() ? 1 : 0;
+ ObjC1 = D.ReadBool() ? 1 : 0;
+ ObjC2 = D.ReadBool() ? 1 : 0;
+ PascalStrings = D.ReadBool() ? 1 : 0;
+ Boolean = D.ReadBool() ? 1 : 0;
+ WritableStrings = D.ReadBool() ? 1 : 0;
+ LaxVectorConversions = D.ReadBool() ? 1 : 0;
+}
OpenPOWER on IntegriCloud