forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Find loop #10
Closed
Closed
Find loop #10
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* first commit * remove redundant foreach * getting funcname shorter
Deprecated functions warning plugin.
* Create rename plugin
* first commit * make action * made tests more diversed and got rid of using namespace
* Task is ready! * Update! * Update for workflow * Update code * Update code * 1. The ASTContext *Context field was removed from the PrintClassVisitor class as unnecessary. 2. The CreateASTConsumer method of the PrintClassLASTAction class now returns make_unique, not new. 3. The help option for the plugin has been added and tested. * Update code for reload actions (windows-build failed).
Deprecated plugin
Fix return statement position
This code represents a plugin for Clang that allows outputting information about class members in C++. The program relies on using the Clang tooling and its Abstract Syntax Tree (AST) to analyze and output information about structures and classes in the source code. The program consists of several components: - **MemberInfoPrinter:** This class is responsible for printing information about class members, such as fields, methods, and static members. It accesses the Clang AST to retrieve information about each member and prints its name, type, and access specifier. - **UserTypePrinter:** This class is responsible for printing information about user-defined types, such as structures and classes. It determines the type of each user-defined type and prints the corresponding information. - **ClassMembersPrinter:** This class is a subclass of `clang::RecursiveASTVisitor` and traverses the AST to find and print information about class members. It uses `MemberInfoPrinter` and `UserTypePrinter` to print information about members and types. - **ClassMembersConsumer:** This class is an `ASTConsumer` that processes the AST and runs `ClassMembersPrinter` for each detected class or structure. - **ClassFieldPrinterAction:** This class represents the action of the Clang plugin. It creates an instance of `ClassMembersConsumer` to process the AST and output information about class members. The program allows analyzing C++ source code and outputting information about class members, their types, and access specifiers. Example: ``` // CHECK: TestClass (class) class TestClass { public: int publicInt; // CHECK-NEXT: |_ publicInt (int|public) static int publicStaticInt; // CHECK-NEXT: |_ publicStaticInt (int|public|static) void publicFunc() {} // CHECK-NEXT: |_ publicFunc (void (void)|public|method) private: int privateInt; // CHECK-NEXT: |_ privateInt (int|private) static int privateStaticInt; // CHECK-NEXT: |_ privateStaticInt (int|private|static) void privateFunc() {} // CHECK-NEXT: |_ privateFunc (void (void)|private|method) }; ``` In the provided example, a class `TestClass` is shown with various members, including public, private, static variables, and methods. The `CHECK` comments represent the expected output of the program in the format defined in the main code.
* warning plugin * fixed * add -i option * fix clang-tidy * fix CMakeLists * fix clang-tidy 2 --------- Co-authored-by: m-ly4 <mikelitch@gmail.com>
Add a plugin printing a warning on deprecated function.
…omplr-tech#18) * refactoring * refactoring * changes * changes2 * change * finish --------- Co-authored-by: root <root@DESKTOP-J78SGPM> Co-authored-by: m-ly4 <mikelitch@gmail.com>
A plugin that adds the attribute((always_inline)) to functions without condition.
The plugin allows all functions that don't have conditions (for example, if, do...while, etc.), add the always_inline attribute.
Struct fields printer plugin
Implemented identifier renaming (variable name, function name, class name).
I made a plugin that issues a warning if function contains 'deprecated' in its name --------- Co-authored-by: Alexseev Danila <user@DESKTOP-9FK8SDU.localdomain>
This plugin traverses the Abstract Syntax Tree (AST) of a codebase and prints the name and fields of each class.
This plugin implements the renaming of the identifier (variable name, function name, class name).
Plugin that adds attribute "always_inline" for all function that don't have conditions
Plugin that renames units(variables, functions, classes) with entered identificator to another entered identificator.
The plugin changes the identifiers of Functions, Variables, and Classes.
Print class fields names plugin.
In this work, a plugin is implemented to generate warnings if the function name contains the word “deprecated”. Implemented for different letter cases.
Implemented a plugin that inserts the instruction_start()/insrtuction_end() functions at the beginning and end of the function, respectively.
Реализован плагин Добавлены CMakeLists для подтягивания написанных плагинов в тесты
Added a pass for opt that adds loop_start()/loop_end() calls before the start and in the end of loops.
This plugin prints the names of all classes and their fields.
реализовал добавление атрибута inline всем функциям, в которых нет условий (if, for, while, switch).
Inserts instrument_start() and instrument_end() functions into the begining and end of every function in a module. Example: void func() {} will be turned into void func() { instrument_start(); instrument_end(); }
Plugin that replaces integer multiplication to bit shift, if it is possible
Let's call function that returns void and has no parameters "empty function". Let's say empty function has n blocks. In order to put this empty function in a place it's called, we split called function, create n blocks in calling function and create association list, which associate each created block with it's corresponding block from empty function. Next we copy all instructions from associated blocks. Also we change branch instructions so they send to correct block in called function. And we replace return statements to branch instruction that sends to block with instructions after empty function call.
Реализован плагин и тесты по задаче: Найти все циклы внутри функции и обернуть их в вызовы loop_start()/loop_end(). Можно использовать Loop Analysis.
Add a plugin inserting instrument_start()/instrument_end() calls.
In this lab, a pass was implemented that does the instrumentation of functions by adding instrument_start() to the beginning and instrument_end() to the end of each function.
A plugin that adds loop_start() and loop_end() functions to the beginning and end of loops.
* Tests * Tests 2 * Reduce win build
Function instrumentation plugin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Finds all loops inside functions and wraps them in calls to Loop_start()/loop_end(). Uses cyclic analysis.