This patch adds functionality to compare for the equality between InterfaceFiles based on attributes specific to linking.
Details
Diff Detail
Event Timeline
llvm/lib/TextAPI/MachO/InterfaceFile.cpp | ||
---|---|---|
111 | can we use llvm::lower_bound instead? it supports passing a range instead of boilerplate iterators. |
Good in general. Suggestions in line.
llvm/include/llvm/TextAPI/MachO/InterfaceFile.h | ||
---|---|---|
441 | you don't need {} for one line of body. | |
llvm/lib/TextAPI/MachO/InterfaceFile.cpp | ||
131 | Again, omit {} | |
llvm/unittests/TextAPI/TextStubV3Tests.cpp | ||
918 | Rather than spell out all the transform and reset back to equal, I will just create a wrapper that takes a function that transform one of the input, make sure they are different, transform the other, make sure they are equal now. It would be a lot cleaner and easy to read. Same as below which you recreates the TBDFile from inputs again and again, I will create a wrapper to avoid duplicated code. Same as TBDv4 tests. |
refactored tests to implement wrapper, removed single line {}, changed Document.insert to Document.emplace
llvm/unittests/TextAPI/TextStubV4Tests.cpp | ||
---|---|---|
1120 | These functions are the same except variable name between these files, we have a TextStubHelpers.h file in the unit tests, can we just move these there? | |
1133 | If this is refactoring the multiple times we use this, it should just be a variable we can call not a function. | |
1138 | how about updateAttributeThenReset? |
Looks good. with a small comment inline.
llvm/unittests/TextAPI/TextStubV3Tests.cpp | ||
---|---|---|
908 | NIT: You can redo this function as a lambda in the test function so it only takes the transform function as parameter. FileA and FileB is freshly created from TBD file in the beginning and the TBDv3File can just be a lambda capture. |
moved transform wrapper to TextStubHelpers, refactored inequality tests for both v3 and v4.
you don't need {} for one line of body.