summaryrefslogtreecommitdiffstats
path: root/clang/Basic/SourceLocation.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-11-01 22:25:41 +0000
committerTed Kremenek <kremenek@apple.com>2007-11-01 22:25:41 +0000
commit5e2eb261af52fbf265311f3a71209c505cf20075 (patch)
tree9ead84c95e2deb286d3df3e73aca3da315632a16 /clang/Basic/SourceLocation.cpp
parent478c6982a8068605c63ee39512b2ebd0713a2714 (diff)
downloadbcm5719-llvm-5e2eb261af52fbf265311f3a71209c505cf20075.tar.gz
bcm5719-llvm-5e2eb261af52fbf265311f3a71209c505cf20075.zip
Simplified Serialization code for SourceLocation and SourceRange, and
updated it to the recently updated Serialization API. Changed clients of SourceLocation serialization to call the appropriate new methods. Updated Decl serialization code to put new skeleton serialization code in place that is much better than the older trait-specialization approach. llvm-svn: 43625
Diffstat (limited to 'clang/Basic/SourceLocation.cpp')
-rw-r--r--clang/Basic/SourceLocation.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/clang/Basic/SourceLocation.cpp b/clang/Basic/SourceLocation.cpp
index e39f6b7f644..75b4a99d45b 100644
--- a/clang/Basic/SourceLocation.cpp
+++ b/clang/Basic/SourceLocation.cpp
@@ -15,16 +15,23 @@
#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());
+void SourceLocation::Emit(llvm::Serializer& S) const {
+ S.EmitInt(getRawEncoding());
}
-SourceLocation SerializeTrait<SourceLocation>::ReadVal(Deserializer& D) {
+SourceLocation SourceLocation::ReadVal(llvm::Deserializer& D) {
return SourceLocation::getFromRawEncoding(D.ReadInt());
}
+
+void SourceRange::Emit(llvm::Serializer& S) const {
+ B.Emit(S);
+ E.Emit(S);
+}
+
+SourceRange SourceRange::ReadVal(llvm::Deserializer& D) {
+ SourceLocation A = SourceLocation::ReadVal(D);
+ SourceLocation B = SourceLocation::ReadVal(D);
+ return SourceRange(A,B);
+}
OpenPOWER on IntegriCloud