Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is still WiP. Especially wrt testing, I have only added one test. Will add more and update soon.
I will be making another update with either a .md document or detailed inline comments. I don't intend to extend the functionality anymore in this patch.
libc/include/CMakeLists.txt | ||
---|---|---|
126–127 | I just notice that we have both *-* and *_* here. We should update to use just 1 style at some point. | |
libc/src/__support/File/file.cpp | ||
171 | Shouldn't you only need: if (own_buf) free(this->buf); | |
libc/src/__support/File/file.h | ||
145 | comment ended early. | |
libc/test/src/__support/File/file_test.cpp | ||
21 | I feel like this class will be useful beyond this test and could be factored to a standalone util. Feel free to ignore this suggestion. |
libc/src/__support/File/file.h | ||
---|---|---|
68 | ownded -> owned | |
89–90 | I think (mode & (static_cast<ModeFlags>(OpenMode::WRITE) | static_cast<ModeFlags>(OpenMode::APPEND))); is clearer. | |
libc/test/src/__support/File/CMakeLists.txt | ||
2 | this needs to be conditioned on malloc being available, which currently means if(LLVM_LIBC_INCLUDE_SCUDO OR NOT LLVM_LIBC_FULL_BUILD). I will go look into making a single variable that can encompass that in a cleanup patch. |
libc/include/CMakeLists.txt | ||
---|---|---|
126–127 | Agreed. I will make another pass to fix this. | |
libc/src/__support/File/file.cpp | ||
171 | The memory for the File data structure itself will be created by a malloc call so it has to be free-d at closing time. But, thanks for pointing out about the buffer. I have now added what you have suggested. | |
libc/src/__support/File/file.h | ||
145 | This is not it the correct place anymore, but I think I have addressed this comment. | |
libc/test/src/__support/File/CMakeLists.txt | ||
2 | Not required anymore after your fix from last week. | |
libc/test/src/__support/File/file_test.cpp | ||
21 | SGTM. I will move it to a common place as we start reusing it in other tests. |
libc/src/__support/File/file.cpp | ||
---|---|---|
168 | Do we need to add a check at the beginning of all other accessing methods to make sure that close has not been called? |
libc/src/__support/File/file.cpp | ||
---|---|---|
168 | Couple of things:
|
I just notice that we have both *-* and *_* here. We should update to use just 1 style at some point.