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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43625 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Basic/SourceLocation.cpp b/Basic/SourceLocation.cpp
index e39f6b7..75b4a99 100644
--- a/Basic/SourceLocation.cpp
+++ b/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);
+}