[cfe-dev] how does clang tackle DeclContext, like ForContext

Eric Lu eirc.lew at gmail.com
Fri May 8 10:09:20 PDT 2015


Hi,

In a C for loop like:
int a[10];
for(int i = 0; i < 10; i++){
   a[i] = i + 1;
}

The variable "i" is declared in the ForContext in ParseForStatement(), and
then when parse body, I.E., the expression "a[i]" later, how does it know
that "i" is declared?

In other words, how does the ForContext affect the later parsing of
variable "i" ?

-- 
Best Regards!
Eric Lew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150509/c2537b19/attachment.html>


More information about the cfe-dev mailing list