aboutsummaryrefslogtreecommitdiff
path: root/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
commit19a95bcf3561ed977c48d5f2a2793b60a8c8e573 (patch)
treeafde6a4e5f253ccd8fb725a11313983715e58203 /Basic/SourceLocation.cpp
parentcc326204dd97771c336b9aab3b9963ea30d69c29 (diff)
Implemented serialization of SourceLocation and SourceRange objects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43343 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Basic/SourceLocation.cpp')
-rw-r--r--Basic/SourceLocation.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/Basic/SourceLocation.cpp b/Basic/SourceLocation.cpp
new file mode 100644
index 0000000000..e39f6b7f64
--- /dev/null
+++ b/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());
+}