Changeset 366f5cd for src/CodeGen


Ignore:
Timestamp:
Jun 23, 2026, 1:57:51 PM (2 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
9d7a19f
Parents:
45d0e65
Message:

differentiate between C _Alignof and gcc alignof

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cpp

    r45d0e65 r366f5cd  
    1010// Created On       : Tue Oct 17 15:54:00 2023
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar 11 11:13:10 2026
    13 // Update Count     : 28
     12// Last Modified On : Tue Jun 23 13:42:15 2026
     13// Update Count     : 34
    1414//
    1515
     
    778778
    779779void CodeGenerator::postvisit( ast::AlignofExpr const * expr ) {
    780         // Using the GCC extension to avoid changing the std to C11.
    781         extension( expr );
    782         output << "__alignof__(";
     780        extension( expr );
     781        output << (expr->kind ? "__alignof__(" : "_Alignof(");
    783782        if ( auto type = expr->type.as<ast::TypeofType>() ) {
    784783                type->expr->accept( *visitor );
     
    790789
    791790void CodeGenerator::postvisit( ast::CountofExpr const * expr ) {
    792         assertf( !options.genC, "CountofExpr should not reach code generation." );
     791        assertf( ! options.genC, "CountofExpr should not reach code generation." );
    793792        extension( expr );
    794793        output << "countof(";
Note: See TracChangeset for help on using the changeset viewer.