clang 8.0.0

Weak.h
Go to the documentation of this file.
1 //===-- UnresolvedSet.h - Unresolved sets of declarations ------*- 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 WeakInfo class, which is used to store
11 // information about the target of a #pragma weak directive.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CLANG_SEMA_WEAK_H
16 #define LLVM_CLANG_SEMA_WEAK_H
17
18 #include "clang/Basic/SourceLocation.h"
19
20 namespace clang {
21
22 class IdentifierInfo;
23
24 /// Captures information about a \#pragma weak directive.
25 class WeakInfo {
26 IdentifierInfo *alias; // alias (optional)
27 SourceLocation loc; // for diagnostics
28 bool used; // identifier later declared?
29 public:
30 WeakInfo()
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();
40 }
41 bool operator!=(WeakInfo RHS) const { return !(*this == RHS); }
42 };
43
44 } // end namespace clang
45
46 #endif // LLVM_CLANG_SEMA_WEAK_H
clang::WeakInfo::getAlias
IdentifierInfo * getAlias() const
Definition: Weak.h:34
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition: IdentifierTable.h:58
clang::WeakInfo::operator==
bool operator==(WeakInfo RHS) const
Definition: Weak.h:38
Used
Definition: ObjCUnusedIVarsChecker.cpp:30
clang::WeakInfo
Captures information about a #pragma weak directive.
Definition: Weak.h:25
clang::WeakInfo::getLocation
SourceLocation getLocation() const
Definition: Weak.h:35
false
#define false
Definition: stdbool.h:33
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:88
clang::WeakInfo::setUsed
void setUsed(bool Used=true)
Definition: Weak.h:36
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::WeakInfo::WeakInfo
WeakInfo()
Definition: Weak.h:30
clang::WeakInfo::WeakInfo
WeakInfo(IdentifierInfo *Alias, SourceLocation Loc)
Definition: Weak.h:32
clang::WeakInfo::getUsed
bool getUsed()
Definition: Weak.h:37
SourceLocation.h
Defines the clang::SourceLocation class and associated facilities.
clang::WeakInfo::operator!=
bool operator!=(WeakInfo RHS) const
Definition: Weak.h:41