Skip to content

bit-fields support added #383

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

Merged
merged 18 commits into from
Sep 2, 2022
Merged

bit-fields support added #383

merged 18 commits into from
Sep 2, 2022

Conversation

belous-dp
Copy link
Collaborator

No description provided.

@belous-dp belous-dp marked this pull request as ready for review August 24, 2022 11:45
@belous-dp belous-dp requested review from ladisgin and Lana243 August 24, 2022 11:45

#define print_sizeof(S) printf("size of %*s : %zu bytes\n", ALIGN, #S, sizeof((S){}))

//int main() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete unused code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -0,0 +1,118 @@
#include "bitfields.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move file to structures dir

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

for (size_t curPos = 0; curPos < arraySize; curPos += len) {
switch (typesHandler.getTypeKind(type)) {
for (size_t curPos = 0; curPos < arraySizeInBits; curPos += elementLenInBits) {
switch (typesHandler.getTypeKind(type)) { // tdm_todo copypaste
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

const MapAddressName &fromAddressToName,
std::vector<InitReference> &initReferences,
const std::optional<const Tests::MethodDescription> &testingMethod) {
EnumInfo enumInfo; // tdm_todo refactor so don't create useless variable. create it in switch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete todo, or use same as other // TODO

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

} else {
ABORT_F("type is not an integerType: %s", type.baseType().c_str());
}
bool isUnsigned = isUnsignedType(type);
if (size == 1) {
if (size == 8) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create enum for this sizes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed, left as is

if (Paths::getSourceLanguage(sourceFilePath) == utbot::Language::CXX) {
const clang::CXXRecordDecl *cppD = dynamic_cast<const clang::CXXRecordDecl *>(D);
const auto *cppD = llvm::dyn_cast<const clang::CXXRecordDecl>(D);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use auto

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed, left as is

@@ -66,7 +66,7 @@ std::string TypesResolver::getFullname(const clang::TagDecl *TD, const clang::Qu
fullname.insert(std::make_pair(id, currentStructName));

if (Paths::getSourceLanguage(sourceFilePath) == utbot::Language::C) {
if (const clang::RecordDecl *parentNode = llvm::dyn_cast<const clang::RecordDecl>(TD->getLexicalParent())) {
if (const auto *parentNode = llvm::dyn_cast<const clang::RecordDecl>(TD->getLexicalParent())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use auto

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed, left as is

@@ -6,6 +6,7 @@ on:
- '[1-9][0-9][0-9][0-9].[1]?[0-9].[0-9]+'
branches:
- main
- belous-dp/bitfields
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this before merge

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

# Conflicts:
#	server/src/Tests.cpp
#	server/src/Tests.h
#	server/src/printers/KleeConstraintsPrinter.cpp
#	server/src/types/Types.cpp
#	server/src/types/Types.h
#	server/src/types/TypesResolver.cpp
#	server/src/visitors/AbstractValueViewVisitor.cpp
@belous-dp belous-dp merged commit 69f5f2d into main Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Wrong link in to UTbot site in test header Support bit field in struct
3 participants