Token.h (198893) | Token.h (199482) |
---|---|
1//===--- Token.h - Token interface ------------------------------*- 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//===----------------------------------------------------------------------===// --- 234 unchanged lines hidden (view full) --- 243 /// an #else block or something. Only useful in Skipping blocks. 244 bool FoundNonSkip; 245 246 /// FoundElse - True if we've seen a #else in this block. If so, 247 /// #elif/#else directives are not allowed. 248 bool FoundElse; 249}; 250 | 1//===--- Token.h - Token interface ------------------------------*- 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//===----------------------------------------------------------------------===// --- 234 unchanged lines hidden (view full) --- 243 /// an #else block or something. Only useful in Skipping blocks. 244 bool FoundNonSkip; 245 246 /// FoundElse - True if we've seen a #else in this block. If so, 247 /// #elif/#else directives are not allowed. 248 bool FoundElse; 249}; 250 |
251/// TemplateIdAnnotation - Information about a template-id annotation 252/// token, which contains the template declaration, template 253/// arguments, whether those template arguments were types or 254/// expressions, and the source locations for important tokens. All of 255/// the information about template arguments is allocated directly 256/// after this structure. 257struct TemplateIdAnnotation { 258 /// TemplateNameLoc - The location of the template name within the 259 /// source. 260 SourceLocation TemplateNameLoc; 261 262 /// FIXME: Temporarily stores the name of a specialization 263 IdentifierInfo *Name; 264 265 /// FIXME: Temporarily stores the overloaded operator kind. 266 OverloadedOperatorKind Operator; 267 268 /// The declaration of the template corresponding to the 269 /// template-name. This is an Action::DeclTy*. 270 void *Template; 271 272 /// The kind of template that Template refers to. 273 TemplateNameKind Kind; 274 275 /// The location of the '<' before the template argument 276 /// list. 277 SourceLocation LAngleLoc; 278 279 /// The location of the '>' after the template argument 280 /// list. 281 SourceLocation RAngleLoc; 282 283 /// NumArgs - The number of template arguments. 284 unsigned NumArgs; 285 286 /// \brief Retrieves a pointer to the template arguments 287 void **getTemplateArgs() { return (void **)(this + 1); } 288 289 /// \brief Retrieves a pointer to the array of template argument 290 /// locations. 291 SourceLocation *getTemplateArgLocations() { 292 return (SourceLocation *)(getTemplateArgs() + NumArgs); 293 } 294 295 /// \brief Retrieves a pointer to the array of flags that states 296 /// whether the template arguments are types. 297 bool *getTemplateArgIsType() { 298 return (bool *)(getTemplateArgLocations() + NumArgs); 299 } 300 301 static TemplateIdAnnotation* Allocate(unsigned NumArgs) { 302 TemplateIdAnnotation *TemplateId 303 = (TemplateIdAnnotation *)std::malloc(sizeof(TemplateIdAnnotation) + 304 sizeof(void*) * NumArgs + 305 sizeof(SourceLocation) * NumArgs + 306 sizeof(bool) * NumArgs); 307 TemplateId->NumArgs = NumArgs; 308 return TemplateId; 309 } 310 311 void Destroy() { free(this); } 312}; 313 | |
314} // end namespace clang 315 316#endif | 251} // end namespace clang 252 253#endif |