Skip to content
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

Clang-tidy and indentation fix #13

Closed
wants to merge 7 commits into from
Closed

Conversation

mfdorst
Copy link
Contributor

@mfdorst mfdorst commented Jul 31, 2019

Warning! This branch has a huge number of changes because I fixed the indentation on every source file in the project. Basically anyone who's working on anything right now is going to have trouble merging after this commit.

#9

mfdorst added 5 commits July 30, 2019 17:10
Add fixme annotations for clang-tidy violations
Fix clang-tidy warnings in sched_basic_data.cpp
Fix clang-tidy warnings in sched_basic_data.h

Fix comment indentation in sched_basic_data.h
@mfdorst
Copy link
Contributor Author

mfdorst commented Jul 31, 2019

For whatever reason when I fix the indentation of files it sometimes leaves comments completely unindented. I don't have the patience to search through every file for that so if people could fix those issues when they find them that'd be cool

@kerbowa
Copy link
Member

kerbowa commented Jul 31, 2019

This is incorrect indentation and doesn't follow the LLVM conventions.

Try: https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/blob/master/lib/comgr/.clang-tidy

@mfdorst
Copy link
Contributor Author

mfdorst commented Jul 31, 2019

I can't seem to get clang-tidy working on this project. My editor provides contextual clang-tidy warnings, but I can't figure out how to run the command on its own.
clang-format works, but I don't know if the default format rules are the right ones - do you have a configuration file for clang-format too?

@kerbowa
Copy link
Member

kerbowa commented Jul 31, 2019

There is a clang-format config file in the same repo. I just use 'clang-format -style=llvm'. Can you just copy the dot file to the reop and run clang-tidy from the command line?

@mfdorst
Copy link
Contributor Author

mfdorst commented Jul 31, 2019

clang-tidy works by basically compiling the whole source tree. So in general you have to pass it the same commands you give your compiler. CMake obviously complicates that, but you can have CMake generate a "compilation database" which tells clang-tidy how to compile your code. I tried generating a compilation database for just the OptSched target, but it doesn't seem to like that. For now I'm just gonna switch to clang-format until I can figure out how to work with clang-tidy.

@kerbowa
Copy link
Member

kerbowa commented Jul 31, 2019

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

I added compilation db by default already. I'm pretty sure llvm does the same. I think maybe it's your ide that's wonky, can't really help you there.

@mfdorst
Copy link
Contributor Author

mfdorst commented Jul 31, 2019

Hold up don't merge this just yet, I managed to delete aco.cpp

Its contents were accidentally deleted 2d9d72
@kerbowa
Copy link
Member

kerbowa commented Jul 31, 2019

Was going to ask :)

I think I will take a closer look tomorrow. Why is it marking some class methods as static?

@mfdorst
Copy link
Contributor Author

mfdorst commented Jul 31, 2019

Is clang-format doing that? Or are you asking about the earlier clang-tidy commits?

@mfdorst
Copy link
Contributor Author

mfdorst commented Jul 31, 2019

clang-tidy does sometimes recommend a method be static - I think I only made that change once though - I'll take a closer look in case that was a bad idea.

@kerbowa
Copy link
Member

kerbowa commented Jul 31, 2019

I think some things from clang-tidy are still here like, adding override for example.

@mfdorst
Copy link
Contributor Author

mfdorst commented Jul 31, 2019

The last two commits have no clang-tidy fixes. The previous ones do, with the exception of 'Fix indentation project-wide'.

@mfdorst
Copy link
Contributor Author

mfdorst commented Jul 31, 2019

Do you want me to make a pull request with only clang-format changes, and a different one for clang-tidy changes?

@mfdorst
Copy link
Contributor Author

mfdorst commented Jul 31, 2019

Actually I like that idea. I will do that tomorrow - I have math homework to do right now.

@mfdorst
Copy link
Contributor Author

mfdorst commented Jul 31, 2019

Closing this. #18 runs clang-format for the whole project. If that gets merged, I'll rebase these changes on top of those which should make everything cleaner and easier to follow.

@mfdorst mfdorst closed this Jul 31, 2019
@mfdorst mfdorst deleted the clang-tidy branch August 1, 2019 07:03
@mfdorst mfdorst mentioned this pull request Aug 1, 2019
balinck pushed a commit that referenced this pull request Nov 25, 2023
* Evaluate metrics and keep the best schedule.

* Add extra temp debug printouts.

* Add more simple cost function.
jrbyrnes added a commit that referenced this pull request Aug 15, 2024
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.

2 participants