<commit_before>//===--- TypeSerialization.cpp - Serialization of Decls ---------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by <NAME> and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//  This files defines methods that implement bitcode serialization for Types.
//
//===----------------------------------------------------------------------===//

#include "clang/AST/Type.h"
#include "clang/AST/Expr.h"
#include "llvm/Bitcode/Serialize.h"
#include "llvm/Bitcode/Deserialize.h"

using namespace clang;

void QualType::Emit(llvm::Serializer& S) const {
  S.EmitPtr(getAsOpaquePtr());
  S.EmitInt(getQualifiers());
}

void QualType::Read(llvm::Deserializer& D) {
  D.ReadUIntPtr(ThePtr);
  ThePtr |= D.ReadInt();
}

void QualType::EmitOwned(llvm::Serializer& S) const {
  S.EmitInt(getQualifiers());
  S.EmitOwnedPtr(cast<BuiltinType>(getTypePtr()));
}

void QualType::ReadOwned(llvm::Deserializer& D) {
  ThePtr = D.ReadInt();
  ThePtr |= reinterpret_cast<uintptr_t>(D.ReadOwnedPtr<BuiltinType>());
}

/*  FIXME: Either remove this method or complete it.

void Type::Emit(llvm::Serializer& S) {
  switch (getTypeClass()) {
    default:
      assert (false && "Serialization for type class not implemented.");
      break;
      
    case Type::Builtin:
      cast<BuiltinType>(this)->Emit(S);<commit_msg>QualType deserialization now requires that the underlying pointer type must be deserialized without requiring backpatching.<commit_after>//===--- TypeSerialization.cpp - Serialization of Decls ---------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by <NAME> and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//  This files defines methods that implement bitcode serialization for Types.
//
//===----------------------------------------------------------------------===//

#include "clang/AST/Type.h"
#include "clang/AST/Expr.h"
#include "llvm/Bitcode/Serialize.h"
#include "llvm/Bitcode/Deserialize.h"

using namespace clang;

void QualType::Emit(llvm::Serializer& S) const {
  S.EmitPtr(getAsOpaquePtr());
  S.EmitInt(getQualifiers());
}

void QualType::Read(llvm::Deserializer& D) {
  D.ReadUIntPtr(ThePtr,false);
  ThePtr |= D.ReadInt();
}

void QualType::EmitOwned(llvm::Serializer& S) const {
  S.EmitInt(getQualifiers());
  S.EmitOwnedPtr(cast<BuiltinType>(getTypePtr()));
}

void QualType::ReadOwned(llvm::Deserializer& D) {
  ThePtr = D.ReadInt();
  ThePtr |= reinterpret_cast<uintptr_t>(D.ReadOwnedPtr<BuiltinType>());
}

/*  FIXME: Either remove this method or complete it.

void Type::Emit(llvm::Serializer& S) {
  switch (getTypeClass()) {
    default:
      assert (false && "Serialization for type class not implemented.");
      break;
      
    case Type::Builtin:
      cast<BuiltinType>(this)->Emit(S);
{'fraction_non_alphanumeric': 0.2391304347826087, 'fraction_numerical': 0.0, 'mean_word_length': 2.5965517241379312, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '780773', 'n_tokens_mistral': 910, 'n_tokens_neox': 931, 'n_words': 219}