-
Notifications
You must be signed in to change notification settings - Fork 54
Шишкарев Андрей. Лабораторная работа 1. Clang AST. Вариант 3. #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: course-spring-2025
Are you sure you want to change the base?
Шишкарев Андрей. Лабораторная работа 1. Clang AST. Вариант 3. #43
Conversation
// CHECK-NEXT: float -> int: 1 | ||
// CHECK-NEXT: float -> double: 1 | ||
// CHECK-NEXT: double -> int: 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, extend these tests with your own ones
if (PtrPos != std::string::npos) { | ||
Normalized.erase(PtrPos, 3); // Удаляем "(*)" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that needed?
} | ||
|
||
int mul(float a, float b) { | ||
return a + sum(a, b); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return a + sum(a, b); | |
return a + sum(a, (int)b); |
|
||
int mul(float a, float b) { | ||
return a + sum(a, b); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a new line at the end of file everywhere please.
} | |
} | |
Плагин для Clang, который анализирует код и выводит количество неявных преобразований типов для каждой функции. Плагин состоит из двух основных компонентов:
ImplicitConversionVisitor:
Function имя_функции
исходный_тип -> конечный_тип: количество
FunctionDumpVisitor:
Порядок работы: