This repository was archived by the owner on Jan 19, 2025. It is now read-only.
forked from NN-complr-tech/llvm
-
Notifications
You must be signed in to change notification settings - Fork 57
Bodrov Daniil. Lab 1. Task 1 #21
Merged
m-ly4
merged 18 commits into
NN-complr-tech:course-spring-2024
from
overinvest:dev-lab1
Mar 18, 2024
Merged
Bodrov Daniil. Lab 1. Task 1 #21
m-ly4
merged 18 commits into
NN-complr-tech:course-spring-2024
from
overinvest:dev-lab1
Mar 18, 2024
Conversation
This file contains hidden or 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
fixed clang-format?
Could I get some feedback on what I need to fix in the code? I'm not quite understanding why clang-format is throwing an error |
m-ly4
approved these changes
Mar 18, 2024
I'm glad that you fixed format errors on your own. For the future, you can just execute clang-format tool on diff of your patch and automatically apply all it's suggestions. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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 usesMemberInfoPrinter
andUserTypePrinter
to print information about members and types.ClassMembersConsumer: This class is an
ASTConsumer
that processes the AST and runsClassMembersPrinter
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:
In the provided example, a class
TestClass
is shown with various members, including public, private, static variables, and methods. TheCHECK
comments represent the expected output of the program in the format defined in the main code.