John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 1 | //===--- Lookup.h - Classes for name lookup ---------------------*- 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 the LookupResult class, which is integral to |
| 11 | // Sema's name-lookup subsystem. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef LLVM_CLANG_SEMA_LOOKUP_H |
| 16 | #define LLVM_CLANG_SEMA_LOOKUP_H |
| 17 | |
| 18 | #include "Sema.h" |
| 19 | |
| 20 | namespace clang { |
| 21 | |
| 22 | /// @brief Represents the results of name lookup. |
| 23 | /// |
| 24 | /// An instance of the LookupResult class captures the results of a |
| 25 | /// single name lookup, which can return no result (nothing found), |
| 26 | /// a single declaration, a set of overloaded functions, or an |
| 27 | /// ambiguity. Use the getKind() method to determine which of these |
| 28 | /// results occurred for a given lookup. |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 29 | class LookupResult { |
| 30 | public: |
| 31 | enum LookupResultKind { |
| 32 | /// @brief No entity found met the criteria. |
| 33 | NotFound = 0, |
| 34 | |
| 35 | /// @brief Name lookup found a single declaration that met the |
John McCall | 51fa86f | 2009-12-02 08:47:38 +0000 | [diff] [blame] | 36 | /// criteria. getFoundDecl() will return this declaration. |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 37 | Found, |
| 38 | |
| 39 | /// @brief Name lookup found a set of overloaded functions that |
John McCall | 51fa86f | 2009-12-02 08:47:38 +0000 | [diff] [blame] | 40 | /// met the criteria. |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 41 | FoundOverloaded, |
| 42 | |
| 43 | /// @brief Name lookup found an unresolvable value declaration |
| 44 | /// and cannot yet complete. This only happens in C++ dependent |
| 45 | /// contexts with dependent using declarations. |
| 46 | FoundUnresolvedValue, |
| 47 | |
| 48 | /// @brief Name lookup results in an ambiguity; use |
| 49 | /// getAmbiguityKind to figure out what kind of ambiguity |
| 50 | /// we have. |
| 51 | Ambiguous |
| 52 | }; |
| 53 | |
| 54 | enum AmbiguityKind { |
| 55 | /// Name lookup results in an ambiguity because multiple |
| 56 | /// entities that meet the lookup criteria were found in |
| 57 | /// subobjects of different types. For example: |
| 58 | /// @code |
| 59 | /// struct A { void f(int); } |
| 60 | /// struct B { void f(double); } |
| 61 | /// struct C : A, B { }; |
| 62 | /// void test(C c) { |
| 63 | /// c.f(0); // error: A::f and B::f come from subobjects of different |
| 64 | /// // types. overload resolution is not performed. |
| 65 | /// } |
| 66 | /// @endcode |
| 67 | AmbiguousBaseSubobjectTypes, |
| 68 | |
| 69 | /// Name lookup results in an ambiguity because multiple |
| 70 | /// nonstatic entities that meet the lookup criteria were found |
| 71 | /// in different subobjects of the same type. For example: |
| 72 | /// @code |
| 73 | /// struct A { int x; }; |
| 74 | /// struct B : A { }; |
| 75 | /// struct C : A { }; |
| 76 | /// struct D : B, C { }; |
| 77 | /// int test(D d) { |
| 78 | /// return d.x; // error: 'x' is found in two A subobjects (of B and C) |
| 79 | /// } |
| 80 | /// @endcode |
| 81 | AmbiguousBaseSubobjects, |
| 82 | |
| 83 | /// Name lookup results in an ambiguity because multiple definitions |
| 84 | /// of entity that meet the lookup criteria were found in different |
| 85 | /// declaration contexts. |
| 86 | /// @code |
| 87 | /// namespace A { |
| 88 | /// int i; |
| 89 | /// namespace B { int i; } |
| 90 | /// int test() { |
| 91 | /// using namespace B; |
| 92 | /// return i; // error 'i' is found in namespace A and A::B |
| 93 | /// } |
| 94 | /// } |
| 95 | /// @endcode |
| 96 | AmbiguousReference, |
| 97 | |
| 98 | /// Name lookup results in an ambiguity because an entity with a |
| 99 | /// tag name was hidden by an entity with an ordinary name from |
| 100 | /// a different context. |
| 101 | /// @code |
| 102 | /// namespace A { struct Foo {}; } |
| 103 | /// namespace B { void Foo(); } |
| 104 | /// namespace C { |
| 105 | /// using namespace A; |
| 106 | /// using namespace B; |
| 107 | /// } |
| 108 | /// void test() { |
| 109 | /// C::Foo(); // error: tag 'A::Foo' is hidden by an object in a |
| 110 | /// // different namespace |
| 111 | /// } |
| 112 | /// @endcode |
| 113 | AmbiguousTagHiding |
| 114 | }; |
| 115 | |
| 116 | /// A little identifier for flagging temporary lookup results. |
| 117 | enum TemporaryToken { |
| 118 | Temporary |
| 119 | }; |
| 120 | |
| 121 | typedef llvm::SmallVector<NamedDecl*, 4> DeclsTy; |
| 122 | typedef DeclsTy::const_iterator iterator; |
| 123 | |
John McCall | 1d7c528 | 2009-12-18 10:40:03 +0000 | [diff] [blame^] | 124 | typedef bool (*ResultFilter)(NamedDecl*, unsigned IDNS); |
| 125 | |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 126 | LookupResult(Sema &SemaRef, DeclarationName Name, SourceLocation NameLoc, |
| 127 | Sema::LookupNameKind LookupKind, |
| 128 | Sema::RedeclarationKind Redecl = Sema::NotForRedeclaration) |
| 129 | : ResultKind(NotFound), |
| 130 | Paths(0), |
| 131 | SemaRef(SemaRef), |
| 132 | Name(Name), |
| 133 | NameLoc(NameLoc), |
| 134 | LookupKind(LookupKind), |
John McCall | 1d7c528 | 2009-12-18 10:40:03 +0000 | [diff] [blame^] | 135 | IsAcceptableFn(0), |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 136 | IDNS(0), |
| 137 | Redecl(Redecl != Sema::NotForRedeclaration), |
| 138 | HideTags(true), |
| 139 | Diagnose(Redecl == Sema::NotForRedeclaration) |
John McCall | 1d7c528 | 2009-12-18 10:40:03 +0000 | [diff] [blame^] | 140 | { |
| 141 | configure(); |
| 142 | } |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 143 | |
| 144 | /// Creates a temporary lookup result, initializing its core data |
| 145 | /// using the information from another result. Diagnostics are always |
| 146 | /// disabled. |
| 147 | LookupResult(TemporaryToken _, const LookupResult &Other) |
| 148 | : ResultKind(NotFound), |
| 149 | Paths(0), |
| 150 | SemaRef(Other.SemaRef), |
| 151 | Name(Other.Name), |
| 152 | NameLoc(Other.NameLoc), |
| 153 | LookupKind(Other.LookupKind), |
John McCall | 1d7c528 | 2009-12-18 10:40:03 +0000 | [diff] [blame^] | 154 | IsAcceptableFn(Other.IsAcceptableFn), |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 155 | IDNS(Other.IDNS), |
| 156 | Redecl(Other.Redecl), |
| 157 | HideTags(Other.HideTags), |
| 158 | Diagnose(false) |
| 159 | {} |
| 160 | |
| 161 | ~LookupResult() { |
| 162 | if (Diagnose) diagnose(); |
| 163 | if (Paths) deletePaths(Paths); |
| 164 | } |
| 165 | |
| 166 | /// Gets the name to look up. |
| 167 | DeclarationName getLookupName() const { |
| 168 | return Name; |
| 169 | } |
| 170 | |
| 171 | /// Gets the kind of lookup to perform. |
| 172 | Sema::LookupNameKind getLookupKind() const { |
| 173 | return LookupKind; |
| 174 | } |
| 175 | |
| 176 | /// True if this lookup is just looking for an existing declaration. |
| 177 | bool isForRedeclaration() const { |
| 178 | return Redecl; |
| 179 | } |
| 180 | |
| 181 | /// Sets whether tag declarations should be hidden by non-tag |
| 182 | /// declarations during resolution. The default is true. |
| 183 | void setHideTags(bool Hide) { |
| 184 | HideTags = Hide; |
| 185 | } |
| 186 | |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 187 | bool isAmbiguous() const { |
| 188 | return getResultKind() == Ambiguous; |
| 189 | } |
| 190 | |
John McCall | 6826314 | 2009-11-18 22:49:29 +0000 | [diff] [blame] | 191 | /// Determines if this names a single result which is not an |
| 192 | /// unresolved value using decl. If so, it is safe to call |
| 193 | /// getFoundDecl(). |
| 194 | bool isSingleResult() const { |
| 195 | return getResultKind() == Found; |
| 196 | } |
| 197 | |
John McCall | 7453ed4 | 2009-11-22 00:44:51 +0000 | [diff] [blame] | 198 | /// Determines if the results are overloaded. |
| 199 | bool isOverloadedResult() const { |
| 200 | return getResultKind() == FoundOverloaded; |
| 201 | } |
| 202 | |
John McCall | 129e2df | 2009-11-30 22:42:35 +0000 | [diff] [blame] | 203 | bool isUnresolvableResult() const { |
| 204 | return getResultKind() == FoundUnresolvedValue; |
| 205 | } |
| 206 | |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 207 | LookupResultKind getResultKind() const { |
| 208 | sanity(); |
| 209 | return ResultKind; |
| 210 | } |
| 211 | |
| 212 | AmbiguityKind getAmbiguityKind() const { |
| 213 | assert(isAmbiguous()); |
| 214 | return Ambiguity; |
| 215 | } |
| 216 | |
| 217 | iterator begin() const { return Decls.begin(); } |
| 218 | iterator end() const { return Decls.end(); } |
| 219 | |
| 220 | /// \brief Return true if no decls were found |
| 221 | bool empty() const { return Decls.empty(); } |
| 222 | |
| 223 | /// \brief Return the base paths structure that's associated with |
| 224 | /// these results, or null if none is. |
| 225 | CXXBasePaths *getBasePaths() const { |
| 226 | return Paths; |
| 227 | } |
| 228 | |
John McCall | 1d7c528 | 2009-12-18 10:40:03 +0000 | [diff] [blame^] | 229 | /// \brief Tests whether the given declaration is acceptable. |
| 230 | bool isAcceptableDecl(NamedDecl *D) const { |
| 231 | assert(IsAcceptableFn); |
| 232 | return IsAcceptableFn(D, IDNS); |
| 233 | } |
| 234 | |
| 235 | /// \brief Returns the identifier namespace mask for this lookup. |
| 236 | unsigned getIdentifierNamespace() const { |
| 237 | return IDNS; |
| 238 | } |
| 239 | |
| 240 | /// \brief Add a declaration to these results. Does not test the |
| 241 | /// acceptance criteria. |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 242 | void addDecl(NamedDecl *D) { |
| 243 | Decls.push_back(D); |
| 244 | ResultKind = Found; |
| 245 | } |
| 246 | |
| 247 | /// \brief Add all the declarations from another set of lookup |
| 248 | /// results. |
| 249 | void addAllDecls(const LookupResult &Other) { |
| 250 | Decls.append(Other.begin(), Other.end()); |
| 251 | ResultKind = Found; |
| 252 | } |
| 253 | |
| 254 | /// \brief Hides a set of declarations. |
| 255 | template <class NamedDeclSet> void hideDecls(const NamedDeclSet &Set) { |
| 256 | unsigned I = 0, N = Decls.size(); |
| 257 | while (I < N) { |
| 258 | if (Set.count(Decls[I])) |
| 259 | Decls[I] = Decls[--N]; |
| 260 | else |
| 261 | I++; |
| 262 | } |
| 263 | Decls.set_size(N); |
| 264 | } |
| 265 | |
John McCall | 6826314 | 2009-11-18 22:49:29 +0000 | [diff] [blame] | 266 | /// \brief Resolves the result kind of the lookup, possibly hiding |
| 267 | /// decls. |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 268 | /// |
| 269 | /// This should be called in any environment where lookup might |
| 270 | /// generate multiple lookup results. |
| 271 | void resolveKind(); |
| 272 | |
John McCall | 6826314 | 2009-11-18 22:49:29 +0000 | [diff] [blame] | 273 | /// \brief Re-resolves the result kind of the lookup after a set of |
| 274 | /// removals has been performed. |
| 275 | void resolveKindAfterFilter() { |
| 276 | if (Decls.empty()) |
| 277 | ResultKind = NotFound; |
| 278 | else { |
| 279 | ResultKind = Found; |
| 280 | resolveKind(); |
| 281 | } |
| 282 | } |
| 283 | |
John McCall | ba13543 | 2009-11-21 08:51:07 +0000 | [diff] [blame] | 284 | template <class DeclClass> |
| 285 | DeclClass *getAsSingle() const { |
| 286 | if (getResultKind() != Found) return 0; |
| 287 | return dyn_cast<DeclClass>(getFoundDecl()); |
| 288 | } |
| 289 | |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 290 | /// \brief Fetch the unique decl found by this lookup. Asserts |
| 291 | /// that one was found. |
| 292 | /// |
| 293 | /// This is intended for users who have examined the result kind |
| 294 | /// and are certain that there is only one result. |
| 295 | NamedDecl *getFoundDecl() const { |
| 296 | assert(getResultKind() == Found |
| 297 | && "getFoundDecl called on non-unique result"); |
| 298 | return Decls[0]->getUnderlyingDecl(); |
| 299 | } |
| 300 | |
John McCall | 6826314 | 2009-11-18 22:49:29 +0000 | [diff] [blame] | 301 | /// Fetches a representative decl. Useful for lazy diagnostics. |
| 302 | NamedDecl *getRepresentativeDecl() const { |
| 303 | assert(!Decls.empty() && "cannot get representative of empty set"); |
| 304 | return Decls[0]; |
| 305 | } |
| 306 | |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 307 | /// \brief Asks if the result is a single tag decl. |
| 308 | bool isSingleTagDecl() const { |
| 309 | return getResultKind() == Found && isa<TagDecl>(getFoundDecl()); |
| 310 | } |
| 311 | |
| 312 | /// \brief Make these results show that the name was found in |
| 313 | /// base classes of different types. |
| 314 | /// |
| 315 | /// The given paths object is copied and invalidated. |
| 316 | void setAmbiguousBaseSubobjectTypes(CXXBasePaths &P); |
| 317 | |
| 318 | /// \brief Make these results show that the name was found in |
| 319 | /// distinct base classes of the same type. |
| 320 | /// |
| 321 | /// The given paths object is copied and invalidated. |
| 322 | void setAmbiguousBaseSubobjects(CXXBasePaths &P); |
| 323 | |
| 324 | /// \brief Make these results show that the name was found in |
| 325 | /// different contexts and a tag decl was hidden by an ordinary |
| 326 | /// decl in a different context. |
| 327 | void setAmbiguousQualifiedTagHiding() { |
| 328 | setAmbiguous(AmbiguousTagHiding); |
| 329 | } |
| 330 | |
| 331 | /// \brief Clears out any current state. |
| 332 | void clear() { |
| 333 | ResultKind = NotFound; |
| 334 | Decls.clear(); |
| 335 | if (Paths) deletePaths(Paths); |
| 336 | Paths = NULL; |
| 337 | } |
| 338 | |
| 339 | /// \brief Clears out any current state and re-initializes for a |
| 340 | /// different kind of lookup. |
| 341 | void clear(Sema::LookupNameKind Kind) { |
| 342 | clear(); |
| 343 | LookupKind = Kind; |
John McCall | 1d7c528 | 2009-12-18 10:40:03 +0000 | [diff] [blame^] | 344 | configure(); |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 345 | } |
| 346 | |
| 347 | void print(llvm::raw_ostream &); |
| 348 | |
| 349 | /// Suppress the diagnostics that would normally fire because of this |
| 350 | /// lookup. This happens during (e.g.) redeclaration lookups. |
| 351 | void suppressDiagnostics() { |
| 352 | Diagnose = false; |
| 353 | } |
| 354 | |
| 355 | /// Sets a 'context' source range. |
| 356 | void setContextRange(SourceRange SR) { |
| 357 | NameContextRange = SR; |
| 358 | } |
| 359 | |
| 360 | /// Gets the source range of the context of this name; for C++ |
| 361 | /// qualified lookups, this is the source range of the scope |
| 362 | /// specifier. |
| 363 | SourceRange getContextRange() const { |
| 364 | return NameContextRange; |
| 365 | } |
| 366 | |
| 367 | /// Gets the location of the identifier. This isn't always defined: |
| 368 | /// sometimes we're doing lookups on synthesized names. |
| 369 | SourceLocation getNameLoc() const { |
| 370 | return NameLoc; |
| 371 | } |
| 372 | |
John McCall | 6826314 | 2009-11-18 22:49:29 +0000 | [diff] [blame] | 373 | /// A class for iterating through a result set and possibly |
| 374 | /// filtering out results. The results returned are possibly |
| 375 | /// sugared. |
| 376 | class Filter { |
| 377 | LookupResult &Results; |
| 378 | unsigned I; |
John McCall | f7a1a74 | 2009-11-24 19:00:30 +0000 | [diff] [blame] | 379 | bool Changed; |
John McCall | 6826314 | 2009-11-18 22:49:29 +0000 | [diff] [blame] | 380 | #ifndef NDEBUG |
| 381 | bool CalledDone; |
| 382 | #endif |
| 383 | |
| 384 | friend class LookupResult; |
| 385 | Filter(LookupResult &Results) |
John McCall | f7a1a74 | 2009-11-24 19:00:30 +0000 | [diff] [blame] | 386 | : Results(Results), I(0), Changed(false) |
John McCall | 6826314 | 2009-11-18 22:49:29 +0000 | [diff] [blame] | 387 | #ifndef NDEBUG |
| 388 | , CalledDone(false) |
| 389 | #endif |
| 390 | {} |
| 391 | |
| 392 | public: |
| 393 | #ifndef NDEBUG |
| 394 | ~Filter() { |
| 395 | assert(CalledDone && |
| 396 | "LookupResult::Filter destroyed without done() call"); |
| 397 | } |
| 398 | #endif |
| 399 | |
| 400 | bool hasNext() const { |
| 401 | return I != Results.Decls.size(); |
| 402 | } |
| 403 | |
| 404 | NamedDecl *next() { |
| 405 | assert(I < Results.Decls.size() && "next() called on empty filter"); |
| 406 | return Results.Decls[I++]; |
| 407 | } |
| 408 | |
| 409 | /// Erase the last element returned from this iterator. |
| 410 | void erase() { |
| 411 | Results.Decls[--I] = Results.Decls.back(); |
| 412 | Results.Decls.pop_back(); |
John McCall | f7a1a74 | 2009-11-24 19:00:30 +0000 | [diff] [blame] | 413 | Changed = true; |
| 414 | } |
| 415 | |
| 416 | void replace(NamedDecl *D) { |
| 417 | Results.Decls[I-1] = D; |
| 418 | Changed = true; |
John McCall | 6826314 | 2009-11-18 22:49:29 +0000 | [diff] [blame] | 419 | } |
| 420 | |
| 421 | void done() { |
| 422 | #ifndef NDEBUG |
| 423 | assert(!CalledDone && "done() called twice"); |
| 424 | CalledDone = true; |
| 425 | #endif |
| 426 | |
John McCall | f7a1a74 | 2009-11-24 19:00:30 +0000 | [diff] [blame] | 427 | if (Changed) |
John McCall | 6826314 | 2009-11-18 22:49:29 +0000 | [diff] [blame] | 428 | Results.resolveKindAfterFilter(); |
| 429 | } |
| 430 | }; |
| 431 | |
| 432 | /// Create a filter for this result set. |
| 433 | Filter makeFilter() { |
| 434 | return Filter(*this); |
| 435 | } |
| 436 | |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 437 | private: |
| 438 | void diagnose() { |
| 439 | if (isAmbiguous()) |
| 440 | SemaRef.DiagnoseAmbiguousLookup(*this); |
| 441 | } |
| 442 | |
| 443 | void setAmbiguous(AmbiguityKind AK) { |
| 444 | ResultKind = Ambiguous; |
| 445 | Ambiguity = AK; |
| 446 | } |
| 447 | |
| 448 | void addDeclsFromBasePaths(const CXXBasePaths &P); |
John McCall | 1d7c528 | 2009-12-18 10:40:03 +0000 | [diff] [blame^] | 449 | void configure(); |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 450 | |
| 451 | // Sanity checks. |
| 452 | void sanity() const { |
| 453 | assert(ResultKind != NotFound || Decls.size() == 0); |
| 454 | assert(ResultKind != Found || Decls.size() == 1); |
John McCall | 7453ed4 | 2009-11-22 00:44:51 +0000 | [diff] [blame] | 455 | assert(ResultKind != FoundOverloaded || Decls.size() > 1 || |
John McCall | 97d9e21 | 2009-11-22 20:57:36 +0000 | [diff] [blame] | 456 | (Decls.size() == 1 && |
| 457 | isa<FunctionTemplateDecl>(Decls[0]->getUnderlyingDecl()))); |
John McCall | 7453ed4 | 2009-11-22 00:44:51 +0000 | [diff] [blame] | 458 | assert(ResultKind != FoundUnresolvedValue || sanityCheckUnresolved()); |
| 459 | assert(ResultKind != Ambiguous || Decls.size() > 1 || |
| 460 | (Decls.size() == 1 && Ambiguity == AmbiguousBaseSubobjects)); |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 461 | assert((Paths != NULL) == (ResultKind == Ambiguous && |
| 462 | (Ambiguity == AmbiguousBaseSubobjectTypes || |
| 463 | Ambiguity == AmbiguousBaseSubobjects))); |
| 464 | } |
| 465 | |
John McCall | 7453ed4 | 2009-11-22 00:44:51 +0000 | [diff] [blame] | 466 | bool sanityCheckUnresolved() const { |
| 467 | for (DeclsTy::const_iterator I = Decls.begin(), E = Decls.end(); |
| 468 | I != E; ++I) |
| 469 | if (isa<UnresolvedUsingValueDecl>(*I)) |
| 470 | return true; |
| 471 | return false; |
| 472 | } |
| 473 | |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 474 | static void deletePaths(CXXBasePaths *); |
| 475 | |
| 476 | // Results. |
| 477 | LookupResultKind ResultKind; |
| 478 | AmbiguityKind Ambiguity; // ill-defined unless ambiguous |
| 479 | DeclsTy Decls; |
| 480 | CXXBasePaths *Paths; |
| 481 | |
| 482 | // Parameters. |
| 483 | Sema &SemaRef; |
| 484 | DeclarationName Name; |
| 485 | SourceLocation NameLoc; |
| 486 | SourceRange NameContextRange; |
| 487 | Sema::LookupNameKind LookupKind; |
John McCall | 1d7c528 | 2009-12-18 10:40:03 +0000 | [diff] [blame^] | 488 | ResultFilter IsAcceptableFn; // set by configure() |
| 489 | unsigned IDNS; // set by configure() |
| 490 | |
John McCall | 7d384dd | 2009-11-18 07:57:50 +0000 | [diff] [blame] | 491 | bool Redecl; |
| 492 | |
| 493 | /// \brief True if tag declarations should be hidden if non-tags |
| 494 | /// are present |
| 495 | bool HideTags; |
| 496 | |
| 497 | bool Diagnose; |
| 498 | }; |
| 499 | |
| 500 | } |
| 501 | |
| 502 | #endif |