Skip to content

Commit 41671ba

Browse files
committed
move invocation of simplifyHeadersAndUnusedTemplates
1 parent e1d7867 commit 41671ba

1 file changed

Lines changed: 3 additions & 24 deletions

File tree

lib/tokenize.cpp

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5725,8 +5725,6 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
57255725

57265726
simplifyFunctionTryCatch();
57275727

5728-
simplifyHeadersAndUnusedTemplates();
5729-
57305728
// Remove __asm..
57315729
simplifyAsm();
57325730

@@ -5754,6 +5752,8 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
57545752
// remove __attribute__((?))
57555753
simplifyAttribute();
57565754

5755+
simplifyHeadersAndUnusedTemplates();
5756+
57575757
validate();
57585758

57595759
// Bail out if code is garbage
@@ -6568,20 +6568,6 @@ void Tokenizer::simplifyHeadersAndUnusedTemplates()
65686568
} else {
65696569
Token *funcTok = closingBracket->next();
65706570
while (funcTok) {
6571-
if (Token::Match(funcTok, "__declspec|__attribute__ (")) {
6572-
funcTok = funcTok->linkAt(1);
6573-
if (funcTok) {
6574-
funcTok = funcTok->next();
6575-
}
6576-
continue;
6577-
}
6578-
if (Token::Match(funcTok, "[ [")) {
6579-
funcTok = funcTok->link();
6580-
if (funcTok) {
6581-
funcTok = funcTok->next();
6582-
}
6583-
continue;
6584-
}
65856571
if (Token::Match(funcTok, "static|inline|const|%type%|&|&&|*") && !Token::Match(funcTok, "%name% (")) {
65866572
funcTok = funcTok->next();
65876573
continue;
@@ -6597,20 +6583,13 @@ void Tokenizer::simplifyHeadersAndUnusedTemplates()
65976583
funcTok = funcTok->next();
65986584
}
65996585
while (funcTok) {
6600-
if (Token::Match(funcTok, "__declspec|__attribute__|throw|noexcept (")) {
6586+
if (Token::Match(funcTok, "throw|noexcept (")) {
66016587
funcTok = funcTok->linkAt(1);
66026588
if (funcTok) {
66036589
funcTok = funcTok->next();
66046590
}
66056591
continue;
66066592
}
6607-
if (Token::Match(funcTok, "[ [")) {
6608-
funcTok = funcTok->link();
6609-
if (funcTok) {
6610-
funcTok = funcTok->next();
6611-
}
6612-
continue;
6613-
}
66146593
if (Token::Match(funcTok, "const|volatile|&|&&")) {
66156594
funcTok = funcTok->next();
66166595
continue;

0 commit comments

Comments
 (0)