1 //===-- UnresolvedSet.h - Unresolved sets of declarations ------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the WeakInfo class, which is used to store
11 // information about the target of a #pragma weak directive.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_SEMA_WEAK_H
16 #define LLVM_CLANG_SEMA_WEAK_H
18 #include "clang/Basic/SourceLocation.h"
24 /// \brief Captures information about a \#pragma weak directive.
26 IdentifierInfo *alias; // alias (optional)
27 SourceLocation loc; // for diagnostics
28 bool used; // identifier later declared?
31 : alias(nullptr), loc(SourceLocation()), used(false) {}
32 WeakInfo(IdentifierInfo *Alias, SourceLocation Loc)
33 : alias(Alias), loc(Loc), used(false) {}
34 inline IdentifierInfo * getAlias() const { return alias; }
35 inline SourceLocation getLocation() const { return loc; }
36 void setUsed(bool Used=true) { used = Used; }
37 inline bool getUsed() { return used; }
38 bool operator==(WeakInfo RHS) const {
39 return alias == RHS.getAlias() && loc == RHS.getLocation();
41 bool operator!=(WeakInfo RHS) const { return !(*this == RHS); }
44 } // end namespace clang
46 #endif // LLVM_CLANG_SEMA_WEAK_H