[PATCH] D14326: ASTImporter: expressions, pt.2

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 19 12:24:40 PDT 2016


Unit test ImportVAArgExpr fails on Windows. The source file:

void declToImport(__builtin_va_list list, ...) {

  (void)__builtin_va_arg(list, int);

}


When compiled on Windows it produces AST:


TranslationUnitDecl 0x638f150 <<invalid sloc>> <invalid sloc>

<skipped>

`-FunctionDecl 0x638f780 <test.cpp:1:1, line:3:1> line:1:6 declToImport
'void (__builtin_va_list, ...)'

  |-ParmVarDecl 0x638f6e0 <col:19, col:37> col:37 used list
'__builtin_va_list':'char *'

  `-CompoundStmt 0x638f880 <col:48, line:3:1>

    `-CStyleCastExpr 0x638f868 <line:2:3, col:35> 'void' <ToVoid>

      `-VAArgExpr 0x638f848 <col:9, col:35> 'int'

        `-DeclRefExpr 0x638f820 <col:26> '__builtin_va_list':'char *'
lvalue ParmVar 0x638f6e0 'list' '__builtin_va_list':'char *'

while on Linux 64 the result is:

TranslationUnitDecl 0x9fef870 <<invalid sloc>> <invalid sloc>
<skipped>
`-FunctionDecl 0xa046700 <test-imp.cpp:1:1, line:3:1> line:1:6 declToImport
'void (struct __va_list_tag *, ...)'
  |-ParmVarDecl 0xa046600 <col:19, col:37> col:37 used list 'struct
__va_list_tag *':'struct __va_list_tag *'
  `-CompoundStmt 0xa0468c8 <col:48, line:3:1>
    `-CStyleCastExpr 0xa0468a0 <line:2:3, col:35> 'void' <ToVoid>
      `-VAArgExpr 0xa046868 <col:9, col:35> 'int'
        `-ImplicitCastExpr 0xa046850 <col:26> 'struct __va_list_tag
*':'struct __va_list_tag *' <LValueToRValue>
          `-DeclRefExpr 0xa0467f0 <col:26> 'struct __va_list_tag *':'struct
__va_list_tag *' lvalue ParmVar 0xa046600 'list' 'struct __va_list_tag
*':'struct __va_list_tag *'

Maybe it can help.

Thanks,
--Serge

2016-07-18 16:33 GMT+06:00 Aleksei Sidorin <a.sidorin at samsung.com>:

> a.sidorin added a comment.
>
> > I don't think this small improvement in Importer is worth invasive
> changes in other components.
>
>
> Thanks, Serge. Is it OK to commit?
>
>
> https://reviews.llvm.org/D14326
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160720/feb3f2a9/attachment.html>


More information about the cfe-commits mailing list