summaryrefslogtreecommitdiffstats
path: root/clang/Basic/SourceLocation.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-10-25 16:02:43 +0000
committerTed Kremenek <kremenek@apple.com>2007-10-25 16:02:43 +0000
commit4edcb4d676bd7d512d927c9a1fc9e30beb904d80 (patch)
treeaa56d67023c7f2d6e0768e1c0c61df30ef947d6a /clang/Basic/SourceLocation.cpp
parent6e64c3f8ec1af3417758a1ecdef40aca8f5b525f (diff)
downloadbcm5719-llvm-4edcb4d676bd7d512d927c9a1fc9e30beb904d80.tar.gz
bcm5719-llvm-4edcb4d676bd7d512d927c9a1fc9e30beb904d80.zip
Implemented serialization of SourceLocation and SourceRange objects.
llvm-svn: 43343
Diffstat (limited to 'clang/Basic/SourceLocation.cpp')
-rw-r--r--clang/Basic/SourceLocation.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/Basic/SourceLocation.cpp b/clang/Basic/SourceLocation.cpp
new file mode 100644
index 00000000000..e39f6b7f644
--- /dev/null
+++ b/clang/Basic/SourceLocation.cpp
@@ -0,0 +1,30 @@
+//==--- SourceLocation.cpp - Compact identifier for Source Files -*- C++ -*-==//
+//
+// 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 defines serialization methods for the SourceLocation class.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Basic/SourceLocation.h"
+#include "llvm/Bitcode/Serialize.h"
+#include "llvm/Bitcode/Deserialize.h"
+
+using llvm::Serializer;
+using llvm::Deserializer;
+using llvm::SerializeTrait;
+using namespace clang;
+
+void SerializeTrait<SourceLocation>::Emit(Serializer& S, SourceLocation L) {
+ // FIXME: Add code for abbreviation.
+ S.EmitInt(L.getRawEncoding());
+}
+
+SourceLocation SerializeTrait<SourceLocation>::ReadVal(Deserializer& D) {
+ return SourceLocation::getFromRawEncoding(D.ReadInt());
+}
OpenPOWER on IntegriCloud