Skip to content

Commit 3c85903

Browse files
committed
move invocation of simplifyHeadersAndUnusedTemplates
1 parent 0e212e5 commit 3c85903

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
@@ -5720,8 +5720,6 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
57205720

57215721
simplifyFunctionTryCatch();
57225722

5723-
simplifyHeadersAndUnusedTemplates();
5724-
57255723
// Remove __asm..
57265724
simplifyAsm();
57275725

@@ -5749,6 +5747,8 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
57495747
// remove __attribute__((?))
57505748
simplifyAttribute();
57515749

5750+
simplifyHeadersAndUnusedTemplates();
5751+
57525752
validate();
57535753

57545754
// Bail out if code is garbage
@@ -6563,20 +6563,6 @@ void Tokenizer::simplifyHeadersAndUnusedTemplates()
65636563
} else {
65646564
Token *funcTok = closingBracket->next();
65656565
while (funcTok) {
6566-
if (Token::Match(funcTok, "__declspec|__attribute__ (")) {
6567-
funcTok = funcTok->linkAt(1);
6568-
if (funcTok) {
6569-
funcTok = funcTok->next();
6570-
}
6571-
continue;
6572-
}
6573-
if (Token::Match(funcTok, "[ [")) {
6574-
funcTok = funcTok->link();
6575-
if (funcTok) {
6576-
funcTok = funcTok->next();
6577-
}
6578-
continue;
6579-
}
65806566
if (Token::Match(funcTok, "static|inline|const|%type%|&|&&|*") && !Token::Match(funcTok, "%name% (")) {
65816567
funcTok = funcTok->next();
65826568
continue;
@@ -6592,20 +6578,13 @@ void Tokenizer::simplifyHeadersAndUnusedTemplates()
65926578
funcTok = funcTok->next();
65936579
}
65946580
while (funcTok) {
6595-
if (Token::Match(funcTok, "__declspec|__attribute__|throw|noexcept (")) {
6581+
if (Token::Match(funcTok, "throw|noexcept (")) {
65966582
funcTok = funcTok->linkAt(1);
65976583
if (funcTok) {
65986584
funcTok = funcTok->next();
65996585
}
66006586
continue;
66016587
}
6602-
if (Token::Match(funcTok, "[ [")) {
6603-
funcTok = funcTok->link();
6604-
if (funcTok) {
6605-
funcTok = funcTok->next();
6606-
}
6607-
continue;
6608-
}
66096588
if (Token::Match(funcTok, "const|volatile|&|&&")) {
66106589
funcTok = funcTok->next();
66116590
continue;

0 commit comments

Comments
 (0)