Mark a variable as maybe-unused to prevent a -Wunused-but-set-variable warning in optimized builds where asserts are removed.Test/first commit to check setup and understand patch submission process.
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 20668 Build 20668: arc lint + arc unit
Event Timeline
oops, ok, looks I should not use git submodules? I thought arc asked if I wanted to skip submodule changes...
Definitely deal with the submodule stuff. We don't want a new file checked in for tools/clang.
In the commit message did you mean "unused-but-set" instead of "unused-by-set"?
lib/IR/SafepointIRVerifier.cpp | ||
---|---|---|
87 | Did you run clang-format on this? I think it belongs on the same line for LLVM coding style. |
lib/IR/SafepointIRVerifier.cpp | ||
---|---|---|
87 | Running $ clang-format -i lib/IR/SafepointIRVerifier.cpp makes quite a few changes to this file (and puts the attribute on the same line). Is that ok? I assume clang-format can find the .clang-format in the top of the tree (using the LLVM style, as opposed to whatever the defaults are)? |
lib/IR/SafepointIRVerifier.cpp | ||
---|---|---|
87 | You can run clang-format on only the changed lines, rather than the whole file. There's also the git-clang-format script that can format only the lines changed in a git branch. Though also, usually the way LLVM would fix these sort of issues is by including a separate statement "(void)Listed;" just before the assertion. (that way, if the assertion is removed hopefully someone would remove the void cast, which would allow the compiler to identify that the variable was unread, etc) |
Did you run clang-format on this? I think it belongs on the same line for LLVM coding style.