//===-- Holder Class for manipulating va_lists ------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLVM_LIBC_SRC___SUPPORT_ARG_LIST_H #define LLVM_LIBC_SRC___SUPPORT_ARG_LIST_H #include "src/__support/common.h" #include "src/__support/macros/config.h" #include <stdarg.h> #include <stddef.h> #include <stdint.h> namespace LIBC_NAMESPACE_DECL { namespace internal { template <typename V, typename A> LIBC_INLINE constexpr V align_up(V val, A align) { … } class ArgList { … }; // Used for testing things that use an ArgList when it's impossible to know what // the arguments should be ahead of time. An example of this would be fuzzing, // since a function passed a random input could request unpredictable arguments. class MockArgList { … }; // Used by the GPU implementation to parse how many bytes need to be read from // the variadic argument buffer. template <bool packed> class DummyArgList { … }; // Used for the GPU implementation of `printf`. This models a variadic list as a // simple array of pointers that are built manually by the implementation. template <bool packed> class StructArgList { … }; } // namespace internal } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC___SUPPORT_ARG_LIST_H