2007-10-26 00:02:43 +08:00
|
|
|
//==--- 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 namespace clang;
|
|
|
|
|
2007-11-02 06:25:41 +08:00
|
|
|
void SourceLocation::Emit(llvm::Serializer& S) const {
|
|
|
|
S.EmitInt(getRawEncoding());
|
2007-10-26 00:02:43 +08:00
|
|
|
}
|
|
|
|
|
2007-11-02 06:25:41 +08:00
|
|
|
SourceLocation SourceLocation::ReadVal(llvm::Deserializer& D) {
|
2007-10-26 00:02:43 +08:00
|
|
|
return SourceLocation::getFromRawEncoding(D.ReadInt());
|
|
|
|
}
|
2007-11-02 06:25:41 +08:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|