From: Chris Lattner
For efficiency, we only track one level of macro instantions: if a token was +
For efficiency, we only track one level of macro instantiations: if a token was produced by multiple instantiations, we only track the source and ultimate destination. Though we could track the intermediate instantiation points, this would require extra bookkeeping and no known client would benefit substantially @@ -461,7 +461,7 @@ intended to live beyond them (for example, they should not live in the ASTs).
Tokens most often live on the stack (or some other location that is efficient to access) as the parser is running, but occasionally do get buffered up. For example, macro definitions are stored as a series of tokens, and the C++ -front-end will eventually need to buffer tokens up for tentative parsing and +front-end periodically needs to buffer tokens up for tentative parsing and various pieces of look-ahead. As such, the size of a Token matter. On a 32-bit system, sizeof(Token) is currently 16 bytes.
@@ -754,7 +754,7 @@ malloc'd objects are at least 8 byte aligned.The DeclarationName class represents the name of a
declaration in Clang. Declarations in the C family of languages can
- take several different forms. Most declarations are named by are
+ take several different forms. Most declarations are named by
simple identifiers, e.g., "f
" and "x
" in
the function declaration f(int x)
. In C++, declaration
names can also name class constructors ("Class
"
@@ -763,10 +763,10 @@ malloc'd objects are at least 8 byte aligned.
operator void const *
"). In
Objective-C, declaration names can refer to the names of Objective-C
methods, which involve the method name and the parameters,
- collectively called a selector, e.g..,
+ collectively called a selector, e.g.,
"setWidth:height:
". Since all of these kinds of
- entities--variables, functions, Objective-C methods, C++
- constructors, destructors, and operators---are represented as
+ entities - variables, functions, Objective-C methods, C++
+ constructors, destructors, and operators - are represented as
subclasses of Clang's common NamedDecl
class, DeclarationName
is designed to efficiently
represent any kind of name.