14#include "llvm/Support/Capacity.h"
28 CondDirectiveLocsTy::const_iterator low = llvm::lower_bound(
30 if (low == CondDirectiveLocs.end())
36 CondDirectiveLocsTy::const_iterator
37 upp = std::upper_bound(low, CondDirectiveLocs.end(),
40 if (upp != CondDirectiveLocs.end())
41 uppRegion = upp->getRegionLoc();
43 return low->getRegionLoc() != uppRegion;
50 if (CondDirectiveLocs.empty())
55 return CondDirectiveStack.back();
57 CondDirectiveLocsTy::const_iterator low = llvm::lower_bound(
59 assert(low != CondDirectiveLocs.end());
60 return low->getRegionLoc();
63void PPConditionalDirectiveRecord::addCondDirectiveLoc(
64 CondDirectiveLoc DirLoc) {
69 assert(CondDirectiveLocs.empty() ||
72 CondDirectiveLocs.push_back(DirLoc);
77 ConditionValueKind ConditionValue) {
78 addCondDirectiveLoc(CondDirectiveLoc(
Loc, CondDirectiveStack.back()));
79 CondDirectiveStack.push_back(
Loc);
83 const Token &MacroNameTok,
85 addCondDirectiveLoc(CondDirectiveLoc(
Loc, CondDirectiveStack.back()));
86 CondDirectiveStack.push_back(
Loc);
90 const Token &MacroNameTok,
92 addCondDirectiveLoc(CondDirectiveLoc(
Loc, CondDirectiveStack.back()));
93 CondDirectiveStack.push_back(
Loc);
98 ConditionValueKind ConditionValue,
100 addCondDirectiveLoc(CondDirectiveLoc(
Loc, CondDirectiveStack.back()));
101 CondDirectiveStack.back() =
Loc;
106 addCondDirectiveLoc(CondDirectiveLoc(
Loc, CondDirectiveStack.back()));
107 CondDirectiveStack.back() =
Loc;
111 addCondDirectiveLoc(CondDirectiveLoc(
Loc, CondDirectiveStack.back()));
112 CondDirectiveStack.back() =
Loc;
117 addCondDirectiveLoc(CondDirectiveLoc(
Loc, CondDirectiveStack.back()));
118 CondDirectiveStack.back() =
Loc;
122 addCondDirectiveLoc(CondDirectiveLoc(
Loc, CondDirectiveStack.back()));
123 CondDirectiveStack.back() =
Loc;
128 addCondDirectiveLoc(CondDirectiveLoc(
Loc, CondDirectiveStack.back()));
129 CondDirectiveStack.back() =
Loc;
134 addCondDirectiveLoc(CondDirectiveLoc(
Loc, CondDirectiveStack.back()));
135 assert(!CondDirectiveStack.empty());
136 CondDirectiveStack.pop_back();
140 return llvm::capacity_in_bytes(CondDirectiveLocs);
A description of the current definition of a macro.
size_t getTotalMemory() const
PPConditionalDirectiveRecord(SourceManager &SM)
Construct a new preprocessing record.
bool rangeIntersectsConditionalDirective(SourceRange Range) const
Returns true if the given range intersects with a conditional directive.
SourceLocation findConditionalDirectiveRegionLoc(SourceLocation Loc) const
Encodes a location in the source.
This class handles loading and caching of source files into memory.
bool isInSystemHeader(SourceLocation Loc) const
Returns if a SourceLocation is in a system header.
bool isBeforeInTranslationUnit(SourceLocation LHS, SourceLocation RHS) const
Determines the order of 2 source locations in the translation unit.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
Token - This structure provides full information about a lexed token.
The JSON file list parser is used to communicate input to InstallAPI.