llvm.org GIT mirror llvm / c35146b
Sorry about that. MSVC seems to accept just about any random string you give it ;/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153979 91177308-0d34-0410-b5e6-96231b3b80d8 Michael J. Spencer 8 years ago
2 changed file(s) with 2 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
112112 };
113113
114114 Node(unsigned int Type, OwningPtr&, StringRef Anchor);
115 virtual ~Node();
116115
117116 /// @brief Get the value of the anchor attached to this node. If it does not
118117 /// have one, getAnchor().size() will be 0.
206205 , StringRef::size_type Start
207206 , SmallVectorImpl &Storage) const;
208207 };
209
210 static bool getAs(const ScalarNode *SN, bool &Result) {
211 SmallString<4> Storage;
212 StringRef Value = SN->getValue(Storage);
213 if (Value == "true")
214 Result = true;
215 else if (Value == "false")
216 Result = false;
217 else
218 return false;
219 return true;
220 }
221
222 template
223 typename enable_if_c::is_integer, bool>::type
224 getAs(const ScalarNode *SN, T &Result) {
225 SmallString<4> Storage;
226 return !SN->getValue(Storage).getAsInteger(0, Result);
227 }
228208
229209 /// @brief A key and value pair. While not technically a Node under the YAML
230210 /// representation graph, it is easier to treat them this way.
132132 }
133133 }
134134
135 namespace llvm {
135136 template<>
136137 struct ilist_sentinel_traits {
137138 Token *createSentinel() const {
162163
163164 BumpPtrAllocator Alloc;
164165 };
166 }
165167
166168 typedef ilist TokenQueueT;
167169
15631565 SourceRange = SMRange(Start, Start);
15641566 }
15651567
1566 Node::~Node() {}
1567
15681568 Token &Node::peekNext() {
15691569 return Doc->peekNext();
15701570 }