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