1 //===-- llvm/ADT/VectorExtras.h - Helpers for std::vector -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains helper functions which are useful for working with the
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_ADT_VECTOREXTRAS_H
16 #define LLVM_ADT_VECTOREXTRAS_H
23 /// make_vector - Helper function which is useful for building temporary vectors
24 /// to pass into type construction of CallInst ctors. This turns a null
25 /// terminated list of pointers (or other value types) into a real live vector.
28 inline std::vector<T> make_vector(T A, ...) {
31 std::vector<T> Result;
33 while (T Val = va_arg(Args, T))
34 Result.push_back(Val);
39 } // End llvm namespace