Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 1 | //===--- MultiplexExternalSemaSource.h - External Sema Interface-*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines ExternalSemaSource interface, dispatching to all clients |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame^] | 13 | #ifndef LLVM_CLANG_SEMA_MULTIPLEXEXTERNALSEMASOURCE_H |
| 14 | #define LLVM_CLANG_SEMA_MULTIPLEXEXTERNALSEMASOURCE_H |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 15 | |
| 16 | #include "clang/Sema/ExternalSemaSource.h" |
| 17 | #include "clang/Sema/Weak.h" |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 18 | #include "llvm/ADT/SmallVector.h" |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 19 | #include <utility> |
| 20 | |
| 21 | namespace clang { |
| 22 | |
| 23 | class CXXConstructorDecl; |
| 24 | class CXXRecordDecl; |
| 25 | class DeclaratorDecl; |
| 26 | struct ExternalVTableUse; |
| 27 | class LookupResult; |
| 28 | class NamespaceDecl; |
| 29 | class Scope; |
| 30 | class Sema; |
| 31 | class TypedefNameDecl; |
| 32 | class ValueDecl; |
| 33 | class VarDecl; |
| 34 | |
| 35 | |
| 36 | /// \brief An abstract interface that should be implemented by |
| 37 | /// external AST sources that also provide information for semantic |
| 38 | /// analysis. |
| 39 | class MultiplexExternalSemaSource : public ExternalSemaSource { |
| 40 | |
| 41 | private: |
Dmitri Gribenko | cfa88f8 | 2013-01-12 19:30:44 +0000 | [diff] [blame] | 42 | SmallVector<ExternalSemaSource *, 2> Sources; // doesn't own them. |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 43 | |
| 44 | public: |
| 45 | |
| 46 | ///\brief Constructs a new multiplexing external sema source and appends the |
| 47 | /// given element to it. |
| 48 | /// |
| 49 | ///\param[in] s1 - A non-null (old) ExternalSemaSource. |
| 50 | ///\param[in] s2 - A non-null (new) ExternalSemaSource. |
| 51 | /// |
| 52 | MultiplexExternalSemaSource(ExternalSemaSource& s1, ExternalSemaSource& s2); |
| 53 | |
| 54 | ~MultiplexExternalSemaSource(); |
| 55 | |
| 56 | ///\brief Appends new source to the source list. |
| 57 | /// |
| 58 | ///\param[in] source - An ExternalSemaSource. |
| 59 | /// |
| 60 | void addSource(ExternalSemaSource &source); |
| 61 | |
| 62 | //===--------------------------------------------------------------------===// |
| 63 | // ExternalASTSource. |
| 64 | //===--------------------------------------------------------------------===// |
| 65 | |
| 66 | /// \brief Resolve a declaration ID into a declaration, potentially |
| 67 | /// building a new declaration. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 68 | Decl *GetExternalDecl(uint32_t ID) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 69 | |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 70 | /// \brief Complete the redeclaration chain if it's been extended since the |
| 71 | /// previous generation of the AST source. |
| 72 | void CompleteRedeclChain(const Decl *D) override; |
| 73 | |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 74 | /// \brief Resolve a selector ID into a selector. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 75 | Selector GetExternalSelector(uint32_t ID) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 76 | |
| 77 | /// \brief Returns the number of selectors known to the external AST |
| 78 | /// source. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 79 | uint32_t GetNumExternalSelectors() override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 80 | |
| 81 | /// \brief Resolve the offset of a statement in the decl stream into |
| 82 | /// a statement. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 83 | Stmt *GetExternalDeclStmt(uint64_t Offset) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 84 | |
| 85 | /// \brief Resolve the offset of a set of C++ base specifiers in the decl |
| 86 | /// stream into an array of specifiers. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 87 | CXXBaseSpecifier *GetExternalCXXBaseSpecifiers(uint64_t Offset) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 88 | |
Richard Smith | 3646c68 | 2013-02-07 03:30:24 +0000 | [diff] [blame] | 89 | /// \brief Find all declarations with the given name in the |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 90 | /// given context. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 91 | bool |
| 92 | FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 93 | |
| 94 | /// \brief Ensures that the table of all visible declarations inside this |
| 95 | /// context is up to date. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 96 | void completeVisibleDeclsMap(const DeclContext *DC) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 97 | |
| 98 | /// \brief Finds all declarations lexically contained within the given |
| 99 | /// DeclContext, after applying an optional filter predicate. |
| 100 | /// |
| 101 | /// \param isKindWeWant a predicate function that returns true if the passed |
| 102 | /// declaration kind is one we are looking for. If NULL, all declarations |
| 103 | /// are returned. |
| 104 | /// |
| 105 | /// \return an indication of whether the load succeeded or failed. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 106 | ExternalLoadResult FindExternalLexicalDecls(const DeclContext *DC, |
| 107 | bool (*isKindWeWant)(Decl::Kind), |
| 108 | SmallVectorImpl<Decl*> &Result) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 109 | |
| 110 | /// \brief Finds all declarations lexically contained within the given |
| 111 | /// DeclContext. |
| 112 | /// |
| 113 | /// \return true if an error occurred |
| 114 | ExternalLoadResult FindExternalLexicalDecls(const DeclContext *DC, |
| 115 | SmallVectorImpl<Decl*> &Result) { |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 116 | return FindExternalLexicalDecls(DC, nullptr, Result); |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | template <typename DeclTy> |
| 120 | ExternalLoadResult FindExternalLexicalDeclsBy(const DeclContext *DC, |
| 121 | SmallVectorImpl<Decl*> &Result) { |
| 122 | return FindExternalLexicalDecls(DC, DeclTy::classofKind, Result); |
| 123 | } |
| 124 | |
| 125 | /// \brief Get the decls that are contained in a file in the Offset/Length |
| 126 | /// range. \p Length can be 0 to indicate a point at \p Offset instead of |
| 127 | /// a range. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 128 | void FindFileRegionDecls(FileID File, unsigned Offset,unsigned Length, |
| 129 | SmallVectorImpl<Decl *> &Decls) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 130 | |
| 131 | /// \brief Gives the external AST source an opportunity to complete |
| 132 | /// an incomplete type. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 133 | void CompleteType(TagDecl *Tag) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 134 | |
| 135 | /// \brief Gives the external AST source an opportunity to complete an |
| 136 | /// incomplete Objective-C class. |
| 137 | /// |
| 138 | /// This routine will only be invoked if the "externally completed" bit is |
| 139 | /// set on the ObjCInterfaceDecl via the function |
| 140 | /// \c ObjCInterfaceDecl::setExternallyCompleted(). |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 141 | void CompleteType(ObjCInterfaceDecl *Class) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 142 | |
| 143 | /// \brief Loads comment ranges. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 144 | void ReadComments() override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 145 | |
| 146 | /// \brief Notify ExternalASTSource that we started deserialization of |
| 147 | /// a decl or type so until FinishedDeserializing is called there may be |
| 148 | /// decls that are initializing. Must be paired with FinishedDeserializing. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 149 | void StartedDeserializing() override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 150 | |
| 151 | /// \brief Notify ExternalASTSource that we finished the deserialization of |
| 152 | /// a decl or type. Must be paired with StartedDeserializing. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 153 | void FinishedDeserializing() override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 154 | |
| 155 | /// \brief Function that will be invoked when we begin parsing a new |
| 156 | /// translation unit involving this external AST source. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 157 | void StartTranslationUnit(ASTConsumer *Consumer) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 158 | |
| 159 | /// \brief Print any statistics that have been gathered regarding |
| 160 | /// the external AST source. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 161 | void PrintStats() override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 162 | |
| 163 | |
| 164 | /// \brief Perform layout on the given record. |
| 165 | /// |
| 166 | /// This routine allows the external AST source to provide an specific |
| 167 | /// layout for a record, overriding the layout that would normally be |
| 168 | /// constructed. It is intended for clients who receive specific layout |
| 169 | /// details rather than source code (such as LLDB). The client is expected |
| 170 | /// to fill in the field offsets, base offsets, virtual base offsets, and |
| 171 | /// complete object size. |
| 172 | /// |
| 173 | /// \param Record The record whose layout is being requested. |
| 174 | /// |
| 175 | /// \param Size The final size of the record, in bits. |
| 176 | /// |
| 177 | /// \param Alignment The final alignment of the record, in bits. |
| 178 | /// |
| 179 | /// \param FieldOffsets The offset of each of the fields within the record, |
| 180 | /// expressed in bits. All of the fields must be provided with offsets. |
| 181 | /// |
| 182 | /// \param BaseOffsets The offset of each of the direct, non-virtual base |
| 183 | /// classes. If any bases are not given offsets, the bases will be laid |
| 184 | /// out according to the ABI. |
| 185 | /// |
| 186 | /// \param VirtualBaseOffsets The offset of each of the virtual base classes |
| 187 | /// (either direct or not). If any bases are not given offsets, the bases will |
| 188 | /// be laid out according to the ABI. |
| 189 | /// |
| 190 | /// \returns true if the record layout was provided, false otherwise. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 191 | bool |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 192 | layoutRecordType(const RecordDecl *Record, |
| 193 | uint64_t &Size, uint64_t &Alignment, |
| 194 | llvm::DenseMap<const FieldDecl *, uint64_t> &FieldOffsets, |
| 195 | llvm::DenseMap<const CXXRecordDecl *, CharUnits> &BaseOffsets, |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 196 | llvm::DenseMap<const CXXRecordDecl *, |
| 197 | CharUnits> &VirtualBaseOffsets) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 198 | |
| 199 | /// Return the amount of memory used by memory buffers, breaking down |
| 200 | /// by heap-backed versus mmap'ed memory. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 201 | void getMemoryBufferSizes(MemoryBufferSizes &sizes) const override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 202 | |
| 203 | //===--------------------------------------------------------------------===// |
| 204 | // ExternalSemaSource. |
| 205 | //===--------------------------------------------------------------------===// |
| 206 | |
| 207 | /// \brief Initialize the semantic source with the Sema instance |
| 208 | /// being used to perform semantic analysis on the abstract syntax |
| 209 | /// tree. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 210 | void InitializeSema(Sema &S) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 211 | |
| 212 | /// \brief Inform the semantic consumer that Sema is no longer available. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 213 | void ForgetSema() override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 214 | |
| 215 | /// \brief Load the contents of the global method pool for a given |
| 216 | /// selector. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 217 | void ReadMethodPool(Selector Sel) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 218 | |
| 219 | /// \brief Load the set of namespaces that are known to the external source, |
| 220 | /// which will be used during typo correction. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 221 | void |
| 222 | ReadKnownNamespaces(SmallVectorImpl<NamespaceDecl*> &Namespaces) override; |
Nick Lewycky | 01a4114 | 2013-01-26 00:35:08 +0000 | [diff] [blame] | 223 | |
Nick Lewycky | cd0655b | 2013-02-01 08:13:20 +0000 | [diff] [blame] | 224 | /// \brief Load the set of used but not defined functions or variables with |
| 225 | /// internal linkage, or used but not defined inline functions. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 226 | void ReadUndefinedButUsed( |
| 227 | llvm::DenseMap<NamedDecl*, SourceLocation> &Undefined) override; |
| 228 | |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 229 | /// \brief Do last resort, unqualified lookup on a LookupResult that |
| 230 | /// Sema cannot find. |
| 231 | /// |
| 232 | /// \param R a LookupResult that is being recovered. |
| 233 | /// |
| 234 | /// \param S the Scope of the identifier occurrence. |
| 235 | /// |
| 236 | /// \return true to tell Sema to recover using the LookupResult. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 237 | bool LookupUnqualified(LookupResult &R, Scope *S) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 238 | |
| 239 | /// \brief Read the set of tentative definitions known to the external Sema |
| 240 | /// source. |
| 241 | /// |
| 242 | /// The external source should append its own tentative definitions to the |
| 243 | /// given vector of tentative definitions. Note that this routine may be |
| 244 | /// invoked multiple times; the external source should take care not to |
| 245 | /// introduce the same declarations repeatedly. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 246 | void ReadTentativeDefinitions(SmallVectorImpl<VarDecl*> &Defs) override; |
| 247 | |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 248 | /// \brief Read the set of unused file-scope declarations known to the |
| 249 | /// external Sema source. |
| 250 | /// |
| 251 | /// The external source should append its own unused, filed-scope to the |
| 252 | /// given vector of declarations. Note that this routine may be |
| 253 | /// invoked multiple times; the external source should take care not to |
| 254 | /// introduce the same declarations repeatedly. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 255 | void ReadUnusedFileScopedDecls( |
| 256 | SmallVectorImpl<const DeclaratorDecl*> &Decls) override; |
| 257 | |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 258 | /// \brief Read the set of delegating constructors known to the |
| 259 | /// external Sema source. |
| 260 | /// |
| 261 | /// The external source should append its own delegating constructors to the |
| 262 | /// given vector of declarations. Note that this routine may be |
| 263 | /// invoked multiple times; the external source should take care not to |
| 264 | /// introduce the same declarations repeatedly. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 265 | void ReadDelegatingConstructors( |
| 266 | SmallVectorImpl<CXXConstructorDecl*> &Decls) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 267 | |
| 268 | /// \brief Read the set of ext_vector type declarations known to the |
| 269 | /// external Sema source. |
| 270 | /// |
| 271 | /// The external source should append its own ext_vector type declarations to |
| 272 | /// the given vector of declarations. Note that this routine may be |
| 273 | /// invoked multiple times; the external source should take care not to |
| 274 | /// introduce the same declarations repeatedly. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 275 | void ReadExtVectorDecls(SmallVectorImpl<TypedefNameDecl*> &Decls) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 276 | |
| 277 | /// \brief Read the set of dynamic classes known to the external Sema source. |
| 278 | /// |
| 279 | /// The external source should append its own dynamic classes to |
| 280 | /// the given vector of declarations. Note that this routine may be |
| 281 | /// invoked multiple times; the external source should take care not to |
| 282 | /// introduce the same declarations repeatedly. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 283 | void ReadDynamicClasses(SmallVectorImpl<CXXRecordDecl*> &Decls) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 284 | |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame^] | 285 | /// \brief Read the set of potentially unused typedefs known to the source. |
| 286 | /// |
| 287 | /// The external source should append its own potentially unused local |
| 288 | /// typedefs to the given vector of declarations. Note that this routine may |
| 289 | /// be invoked multiple times; the external source should take care not to |
| 290 | /// introduce the same declarations repeatedly. |
| 291 | void ReadUnusedLocalTypedefNameCandidates( |
| 292 | llvm::SmallSetVector<const TypedefNameDecl *, 4> &Decls) override; |
| 293 | |
Richard Smith | 5ea6ef4 | 2013-01-10 23:43:47 +0000 | [diff] [blame] | 294 | /// \brief Read the set of locally-scoped extern "C" declarations known to the |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 295 | /// external Sema source. |
| 296 | /// |
| 297 | /// The external source should append its own locally-scoped external |
Richard Smith | 5ea6ef4 | 2013-01-10 23:43:47 +0000 | [diff] [blame] | 298 | /// declarations to the given vector of declarations. Note that this routine |
| 299 | /// may be invoked multiple times; the external source should take care not |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 300 | /// to introduce the same declarations repeatedly. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 301 | void ReadLocallyScopedExternCDecls( |
| 302 | SmallVectorImpl<NamedDecl*> &Decls) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 303 | |
| 304 | /// \brief Read the set of referenced selectors known to the |
| 305 | /// external Sema source. |
| 306 | /// |
| 307 | /// The external source should append its own referenced selectors to the |
| 308 | /// given vector of selectors. Note that this routine |
| 309 | /// may be invoked multiple times; the external source should take care not |
| 310 | /// to introduce the same selectors repeatedly. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 311 | void ReadReferencedSelectors(SmallVectorImpl<std::pair<Selector, |
| 312 | SourceLocation> > &Sels) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 313 | |
| 314 | /// \brief Read the set of weak, undeclared identifiers known to the |
| 315 | /// external Sema source. |
| 316 | /// |
| 317 | /// The external source should append its own weak, undeclared identifiers to |
| 318 | /// the given vector. Note that this routine may be invoked multiple times; |
| 319 | /// the external source should take care not to introduce the same identifiers |
| 320 | /// repeatedly. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 321 | void ReadWeakUndeclaredIdentifiers( |
| 322 | SmallVectorImpl<std::pair<IdentifierInfo*, WeakInfo> > &WI) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 323 | |
| 324 | /// \brief Read the set of used vtables known to the external Sema source. |
| 325 | /// |
| 326 | /// The external source should append its own used vtables to the given |
| 327 | /// vector. Note that this routine may be invoked multiple times; the external |
| 328 | /// source should take care not to introduce the same vtables repeatedly. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 329 | void ReadUsedVTables(SmallVectorImpl<ExternalVTableUse> &VTables) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 330 | |
| 331 | /// \brief Read the set of pending instantiations known to the external |
| 332 | /// Sema source. |
| 333 | /// |
| 334 | /// The external source should append its own pending instantiations to the |
| 335 | /// given vector. Note that this routine may be invoked multiple times; the |
| 336 | /// external source should take care not to introduce the same instantiations |
| 337 | /// repeatedly. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 338 | void ReadPendingInstantiations( |
| 339 | SmallVectorImpl<std::pair<ValueDecl*, SourceLocation> >& Pending) override; |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 340 | |
Richard Smith | ac32d90 | 2013-08-07 21:41:30 +0000 | [diff] [blame] | 341 | /// \brief Read the set of late parsed template functions for this source. |
| 342 | /// |
| 343 | /// The external source should insert its own late parsed template functions |
| 344 | /// into the map. Note that this routine may be invoked multiple times; the |
| 345 | /// external source should take care not to introduce the same map entries |
| 346 | /// repeatedly. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 347 | void ReadLateParsedTemplates( |
| 348 | llvm::DenseMap<const FunctionDecl *, |
| 349 | LateParsedTemplate *> &LPTMap) override; |
Richard Smith | ac32d90 | 2013-08-07 21:41:30 +0000 | [diff] [blame] | 350 | |
Kaelyn Uhrain | 70571f4 | 2013-08-12 19:54:38 +0000 | [diff] [blame] | 351 | /// \copydoc ExternalSemaSource::CorrectTypo |
| 352 | /// \note Returns the first nonempty correction. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 353 | TypoCorrection CorrectTypo(const DeclarationNameInfo &Typo, |
| 354 | int LookupKind, Scope *S, CXXScopeSpec *SS, |
| 355 | CorrectionCandidateCallback &CCC, |
| 356 | DeclContext *MemberContext, |
| 357 | bool EnteringContext, |
| 358 | const ObjCObjectPointerType *OPT) override; |
Kaelyn Uhrain | 70571f4 | 2013-08-12 19:54:38 +0000 | [diff] [blame] | 359 | |
Kaelyn Uhrain | 5d937b3 | 2013-08-12 22:11:14 +0000 | [diff] [blame] | 360 | /// \brief Produces a diagnostic note if one of the attached sources |
| 361 | /// contains a complete definition for \p T. Queries the sources in list |
| 362 | /// order until the first one claims that a diagnostic was produced. |
| 363 | /// |
| 364 | /// \param Loc the location at which a complete type was required but not |
| 365 | /// provided |
| 366 | /// |
| 367 | /// \param T the \c QualType that should have been complete at \p Loc |
| 368 | /// |
| 369 | /// \return true if a diagnostic was produced, false otherwise. |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 370 | bool MaybeDiagnoseMissingCompleteType(SourceLocation Loc, |
| 371 | QualType T) override; |
Kaelyn Uhrain | 5d937b3 | 2013-08-12 22:11:14 +0000 | [diff] [blame] | 372 | |
Axel Naumann | 0ec56b7 | 2012-10-18 19:05:02 +0000 | [diff] [blame] | 373 | // isa/cast/dyn_cast support |
| 374 | static bool classof(const MultiplexExternalSemaSource*) { return true; } |
| 375 | //static bool classof(const ExternalSemaSource*) { return true; } |
| 376 | }; |
| 377 | |
| 378 | } // end namespace clang |
| 379 | |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame^] | 380 | #endif |