Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/clang/include/clang/Sema/Weak.h
Line
Count
Source (jump to first uncovered line)
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
/// \brief 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
0
    : alias(nullptr), loc(SourceLocation()), used(false) {}
32
  WeakInfo(IdentifierInfo *Alias, SourceLocation Loc)
33
134
    : alias(Alias), loc(Loc), used(false) {}
34
139
  inline IdentifierInfo * getAlias() const { return alias; }
35
174
  inline SourceLocation getLocation() const { return loc; }
36
99
  void setUsed(bool Used=true) { used = Used; }
37
250
  inline bool getUsed() { return used; }
38
0
  bool operator==(WeakInfo RHS) const {
39
0
    return alias == RHS.getAlias() && loc == RHS.getLocation();
40
0
  }
41
0
  bool operator!=(WeakInfo RHS) const { return !(*this == RHS); }
42
};
43
44
} // end namespace clang
45
46
#endif // LLVM_CLANG_SEMA_WEAK_H