2011-05-02 19:39:53 +00:00
|
|
|
//===- ExternalASTSource.cpp - Abstract External AST Interface --*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file provides the default implementation of the ExternalASTSource
|
|
|
|
// interface, which enables construction of AST nodes from some external
|
|
|
|
// source.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "clang/AST/ExternalASTSource.h"
|
2014-11-24 09:15:30 +00:00
|
|
|
#include "clang/AST/ASTContext.h"
|
2011-05-02 19:39:53 +00:00
|
|
|
#include "clang/AST/DeclarationName.h"
|
2014-11-24 09:15:30 +00:00
|
|
|
#include "llvm/Support/ErrorHandling.h"
|
2011-05-02 19:39:53 +00:00
|
|
|
|
|
|
|
using namespace clang;
|
|
|
|
|
|
|
|
ExternalASTSource::~ExternalASTSource() { }
|
|
|
|
|
2014-11-24 09:15:30 +00:00
|
|
|
void ExternalASTSource::FindFileRegionDecls(FileID File, unsigned Offset,
|
|
|
|
unsigned Length,
|
|
|
|
SmallVectorImpl<Decl *> &Decls) {}
|
|
|
|
|
|
|
|
void ExternalASTSource::CompleteRedeclChain(const Decl *D) {}
|
|
|
|
|
|
|
|
void ExternalASTSource::CompleteType(TagDecl *Tag) {}
|
|
|
|
|
|
|
|
void ExternalASTSource::CompleteType(ObjCInterfaceDecl *Class) {}
|
|
|
|
|
|
|
|
void ExternalASTSource::ReadComments() {}
|
|
|
|
|
|
|
|
void ExternalASTSource::StartedDeserializing() {}
|
|
|
|
|
|
|
|
void ExternalASTSource::FinishedDeserializing() {}
|
|
|
|
|
|
|
|
void ExternalASTSource::StartTranslationUnit(ASTConsumer *Consumer) {}
|
|
|
|
|
2011-05-02 19:39:53 +00:00
|
|
|
void ExternalASTSource::PrintStats() { }
|
|
|
|
|
2014-11-24 09:15:30 +00:00
|
|
|
bool ExternalASTSource::layoutRecordType(
|
|
|
|
const RecordDecl *Record, uint64_t &Size, uint64_t &Alignment,
|
|
|
|
llvm::DenseMap<const FieldDecl *, uint64_t> &FieldOffsets,
|
|
|
|
llvm::DenseMap<const CXXRecordDecl *, CharUnits> &BaseOffsets,
|
|
|
|
llvm::DenseMap<const CXXRecordDecl *, CharUnits> &VirtualBaseOffsets) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-05-02 19:39:53 +00:00
|
|
|
Decl *ExternalASTSource::GetExternalDecl(uint32_t ID) {
|
2014-11-24 09:15:30 +00:00
|
|
|
return nullptr;
|
2011-05-02 19:39:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Selector ExternalASTSource::GetExternalSelector(uint32_t ID) {
|
|
|
|
return Selector();
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t ExternalASTSource::GetNumExternalSelectors() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
Stmt *ExternalASTSource::GetExternalDeclStmt(uint64_t Offset) {
|
2014-11-24 09:15:30 +00:00
|
|
|
return nullptr;
|
2011-05-02 19:39:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CXXBaseSpecifier *
|
|
|
|
ExternalASTSource::GetExternalCXXBaseSpecifiers(uint64_t Offset) {
|
2014-11-24 09:15:30 +00:00
|
|
|
return nullptr;
|
2011-05-02 19:39:53 +00:00
|
|
|
}
|
|
|
|
|
2013-04-08 18:45:10 +00:00
|
|
|
bool
|
2011-05-02 19:39:53 +00:00
|
|
|
ExternalASTSource::FindExternalVisibleDeclsByName(const DeclContext *DC,
|
|
|
|
DeclarationName Name) {
|
2013-04-08 18:45:10 +00:00
|
|
|
return false;
|
2011-05-02 19:39:53 +00:00
|
|
|
}
|
|
|
|
|
2012-05-03 16:53:59 +00:00
|
|
|
void ExternalASTSource::completeVisibleDeclsMap(const DeclContext *DC) {
|
|
|
|
}
|
|
|
|
|
|
|
|
ExternalLoadResult
|
2011-05-02 19:39:53 +00:00
|
|
|
ExternalASTSource::FindExternalLexicalDecls(const DeclContext *DC,
|
|
|
|
bool (*isKindWeWant)(Decl::Kind),
|
2011-10-20 21:14:49 +00:00
|
|
|
SmallVectorImpl<Decl*> &Result) {
|
2011-07-17 15:40:56 +00:00
|
|
|
return ELR_AlreadyLoaded;
|
2011-05-02 19:39:53 +00:00
|
|
|
}
|
2011-06-12 15:46:16 +00:00
|
|
|
|
|
|
|
void ExternalASTSource::getMemoryBufferSizes(MemoryBufferSizes &sizes) const { }
|
2014-11-24 09:15:30 +00:00
|
|
|
|
|
|
|
uint32_t ExternalASTSource::incrementGeneration(ASTContext &C) {
|
|
|
|
uint32_t OldGeneration = CurrentGeneration;
|
|
|
|
|
|
|
|
// Make sure the generation of the topmost external source for the context is
|
|
|
|
// incremented. That might not be us.
|
|
|
|
auto *P = C.getExternalSource();
|
|
|
|
if (P && P != this)
|
|
|
|
CurrentGeneration = P->incrementGeneration(C);
|
|
|
|
else {
|
|
|
|
// FIXME: Only bump the generation counter if the current generation number
|
|
|
|
// has been observed?
|
|
|
|
if (!++CurrentGeneration)
|
|
|
|
llvm::report_fatal_error("generation counter overflowed", false);
|
|
|
|
}
|
|
|
|
|
|
|
|
return OldGeneration;
|
|
|
|
}
|