Ted Kremenek | 19a95bc | 2007-10-25 16:02:43 +0000 | [diff] [blame^] | 1 | //==--- SourceLocation.cpp - Compact identifier for Source Files -*- C++ -*-==// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by Ted Kremenek and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines serialization methods for the SourceLocation class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "clang/Basic/SourceLocation.h" |
| 15 | #include "llvm/Bitcode/Serialize.h" |
| 16 | #include "llvm/Bitcode/Deserialize.h" |
| 17 | |
| 18 | using llvm::Serializer; |
| 19 | using llvm::Deserializer; |
| 20 | using llvm::SerializeTrait; |
| 21 | using namespace clang; |
| 22 | |
| 23 | void SerializeTrait<SourceLocation>::Emit(Serializer& S, SourceLocation L) { |
| 24 | // FIXME: Add code for abbreviation. |
| 25 | S.EmitInt(L.getRawEncoding()); |
| 26 | } |
| 27 | |
| 28 | SourceLocation SerializeTrait<SourceLocation>::ReadVal(Deserializer& D) { |
| 29 | return SourceLocation::getFromRawEncoding(D.ReadInt()); |
| 30 | } |