Simplify __attribute__ earlier (#7462)

This commit is contained in:
PKEuS 2016-05-04 13:51:34 +02:00
parent 17ccb0fbe6
commit f0fb7a8245
2 changed files with 5 additions and 3 deletions

View File

@ -3377,6 +3377,9 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
// Remove [[deprecated]] // Remove [[deprecated]]
simplifyDeprecated(); simplifyDeprecated();
// remove __attribute__((?))
simplifyAttribute();
// Simplify the C alternative tokens (and, or, etc.) // Simplify the C alternative tokens (and, or, etc.)
simplifyCAlternativeTokens(); simplifyCAlternativeTokens();
@ -3470,9 +3473,6 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
// That call here fixes #7190 // That call here fixes #7190
validate(); validate();
// remove __attribute__((?))
simplifyAttribute();
// remove unnecessary member qualification.. // remove unnecessary member qualification..
removeUnnecessaryQualification(); removeUnnecessaryQualification();

View File

@ -4755,6 +4755,8 @@ private:
ASSERT_EQUALS("short array [ 3 ] ;", tokenizeAndStringify("short array[3] __attribute ((aligned));")); ASSERT_EQUALS("short array [ 3 ] ;", tokenizeAndStringify("short array[3] __attribute ((aligned));"));
ASSERT_EQUALS("int x [ 2 ] ;", tokenizeAndStringify("int x[2] __attribute ((packed));")); ASSERT_EQUALS("int x [ 2 ] ;", tokenizeAndStringify("int x[2] __attribute ((packed));"));
ASSERT_EQUALS("int vecint ;", tokenizeAndStringify("int __attribute((mode(SI))) __attribute((vector_size (16))) vecint;")); ASSERT_EQUALS("int vecint ;", tokenizeAndStringify("int __attribute((mode(SI))) __attribute((vector_size (16))) vecint;"));
ASSERT_EQUALS("struct Payload_IR_config { uint8_t tap [ 16 ] ; } ;", tokenizeAndStringify("struct __attribute__((packed, gcc_struct)) Payload_IR_config { uint8_t tap[16]; };"));
} }
void functionAttributeBefore() { void functionAttributeBefore() {