[cfe-dev] clang does not support register variable ?
Sean Silva
silvas at purdue.edu
Sat Jan 5 12:50:06 PST 2013
On Sat, Jan 5, 2013 at 9:55 AM, kevinlynx <kevinlynx at gmail.com> wrote:
> If i defined a variable with `register` qualifier:
>
> register int a = 0
>
> and variable `a` does not get a qualifier, how to tell if `a` has `register`
> qualifier ?
>
> VarDecl *var = cast<VarDecl>(decl);
> QualType t = var->getType();
> t.hasQualifiers(); // false
I don't think that "qualifier" is not the right terminology for
`register` in this situation. VarDecl::getStorageClass() [1] seems to
be what you are looking for.
[1] <http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html#aabdb595f049bd0ce4703ca3a97dd2445>
More information about the cfe-dev
mailing list