This class is intended to be used in cases where a class is being used
on a va_list. It provides destruction and copy semantics with small
overhead. This is intended to be used in printf.
Details
- Reviewers
sivachandra lntue - Commits
- rG5561ab3495a4: [libc] Add holder class for va_lists
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
rename to ArgList and fix formatting
libc/src/__support/vlist_holder.h | ||
---|---|---|
17 | I went with ArgList since it's shorter. | |
libc/test/src/__support/vlist_holder_test.cpp | ||
15 | The class handles its own va_end, but I don't think it can handle the va_start since its constructor is a new function and you can only create a va_list for the scope of the current function. I could probably create a macro to handle this invisibly, but that's as close as we can get, I think. | |
20 | I don't think an iterator works here, since the iterator needs to have a type, and the values may be of various types. In addition, there's no end marker or length in a va_list, meaning that a for loop won't know when to end. |
Maybe VaListHolder is a bit clearer?