/usr/include/clang/Sema/ExternalSemaSource.h is in libclang-dev 3.0-6ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | //===--- ExternalSemaSource.h - External Sema 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 defines the ExternalSemaSource interface.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_SEMA_EXTERNAL_SEMA_SOURCE_H
#define LLVM_CLANG_SEMA_EXTERNAL_SEMA_SOURCE_H
#include "clang/AST/ExternalASTSource.h"
#include "clang/Sema/Weak.h"
#include <utility>
namespace clang {
class CXXConstructorDecl;
class CXXRecordDecl;
class DeclaratorDecl;
class LookupResult;
struct ObjCMethodList;
class Scope;
class Sema;
class TypedefNameDecl;
class ValueDecl;
class VarDecl;
/// \brief A simple structure that captures a vtable use for the purposes of
/// the \c ExternalSemaSource.
struct ExternalVTableUse {
CXXRecordDecl *Record;
SourceLocation Location;
bool DefinitionRequired;
};
/// \brief An abstract interface that should be implemented by
/// external AST sources that also provide information for semantic
/// analysis.
class ExternalSemaSource : public ExternalASTSource {
public:
ExternalSemaSource() {
ExternalASTSource::SemaSource = true;
}
~ExternalSemaSource();
/// \brief Initialize the semantic source with the Sema instance
/// being used to perform semantic analysis on the abstract syntax
/// tree.
virtual void InitializeSema(Sema &S) {}
/// \brief Inform the semantic consumer that Sema is no longer available.
virtual void ForgetSema() {}
/// \brief Load the contents of the global method pool for a given
/// selector.
///
/// \returns a pair of Objective-C methods lists containing the
/// instance and factory methods, respectively, with this selector.
virtual std::pair<ObjCMethodList,ObjCMethodList> ReadMethodPool(Selector Sel);
/// \brief Load the set of namespaces that are known to the external source,
/// which will be used during typo correction.
virtual void ReadKnownNamespaces(
SmallVectorImpl<NamespaceDecl *> &Namespaces);
/// \brief Do last resort, unqualified lookup on a LookupResult that
/// Sema cannot find.
///
/// \param R a LookupResult that is being recovered.
///
/// \param S the Scope of the identifier occurrence.
///
/// \return true to tell Sema to recover using the LookupResult.
virtual bool LookupUnqualified(LookupResult &R, Scope *S) { return false; }
/// \brief Read the set of tentative definitions known to the external Sema
/// source.
///
/// The external source should append its own tentative definitions to the
/// given vector of tentative definitions. Note that this routine may be
/// invoked multiple times; the external source should take care not to
/// introduce the same declarations repeatedly.
virtual void ReadTentativeDefinitions(
SmallVectorImpl<VarDecl *> &TentativeDefs) {}
/// \brief Read the set of unused file-scope declarations known to the
/// external Sema source.
///
/// The external source should append its own unused, filed-scope to the
/// given vector of declarations. Note that this routine may be
/// invoked multiple times; the external source should take care not to
/// introduce the same declarations repeatedly.
virtual void ReadUnusedFileScopedDecls(
SmallVectorImpl<const DeclaratorDecl *> &Decls) {}
/// \brief Read the set of delegating constructors known to the
/// external Sema source.
///
/// The external source should append its own delegating constructors to the
/// given vector of declarations. Note that this routine may be
/// invoked multiple times; the external source should take care not to
/// introduce the same declarations repeatedly.
virtual void ReadDelegatingConstructors(
SmallVectorImpl<CXXConstructorDecl *> &Decls) {}
/// \brief Read the set of ext_vector type declarations known to the
/// external Sema source.
///
/// The external source should append its own ext_vector type declarations to
/// the given vector of declarations. Note that this routine may be
/// invoked multiple times; the external source should take care not to
/// introduce the same declarations repeatedly.
virtual void ReadExtVectorDecls(SmallVectorImpl<TypedefNameDecl *> &Decls) {}
/// \brief Read the set of dynamic classes known to the external Sema source.
///
/// The external source should append its own dynamic classes to
/// the given vector of declarations. Note that this routine may be
/// invoked multiple times; the external source should take care not to
/// introduce the same declarations repeatedly.
virtual void ReadDynamicClasses(SmallVectorImpl<CXXRecordDecl *> &Decls) {}
/// \brief Read the set of locally-scoped external declarations known to the
/// external Sema source.
///
/// The external source should append its own locally-scoped external
/// declarations to the given vector of declarations. Note that this routine
/// may be invoked multiple times; the external source should take care not
/// to introduce the same declarations repeatedly.
virtual void ReadLocallyScopedExternalDecls(
SmallVectorImpl<NamedDecl *> &Decls) {}
/// \brief Read the set of referenced selectors known to the
/// external Sema source.
///
/// The external source should append its own referenced selectors to the
/// given vector of selectors. Note that this routine
/// may be invoked multiple times; the external source should take care not
/// to introduce the same selectors repeatedly.
virtual void ReadReferencedSelectors(
SmallVectorImpl<std::pair<Selector, SourceLocation> > &Sels) {}
/// \brief Read the set of weak, undeclared identifiers known to the
/// external Sema source.
///
/// The external source should append its own weak, undeclared identifiers to
/// the given vector. Note that this routine may be invoked multiple times;
/// the external source should take care not to introduce the same identifiers
/// repeatedly.
virtual void ReadWeakUndeclaredIdentifiers(
SmallVectorImpl<std::pair<IdentifierInfo *, WeakInfo> > &WI) {}
/// \brief Read the set of used vtables known to the external Sema source.
///
/// The external source should append its own used vtables to the given
/// vector. Note that this routine may be invoked multiple times; the external
/// source should take care not to introduce the same vtables repeatedly.
virtual void ReadUsedVTables(SmallVectorImpl<ExternalVTableUse> &VTables) {}
/// \brief Read the set of pending instantiations known to the external
/// Sema source.
///
/// The external source should append its own pending instantiations to the
/// given vector. Note that this routine may be invoked multiple times; the
/// external source should take care not to introduce the same instantiations
/// repeatedly.
virtual void ReadPendingInstantiations(
SmallVectorImpl<std::pair<ValueDecl *,
SourceLocation> > &Pending) {}
// isa/cast/dyn_cast support
static bool classof(const ExternalASTSource *Source) {
return Source->SemaSource;
}
static bool classof(const ExternalSemaSource *) { return true; }
};
} // end namespace clang
#endif
|