1894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===- Format.h - Efficient printf-style formatting for streams -*- C++ -*-===//
2894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
3894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//                     The LLVM Compiler Infrastructure
4894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
5894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// This file is distributed under the University of Illinois Open Source
6894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// License. See LICENSE.TXT for details.
7894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
8894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===----------------------------------------------------------------------===//
9894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
10894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// This file implements the format() function, which can be used with other
11894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// LLVM subsystems to provide printf-style formatting.  This gives all the power
12894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// and risk of printf.  This can be used like this (with raw_ostreams as an
13894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// example):
14894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
15894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//    OS << "mynumber: " << format("%4.5f", 1234.412) << '\n';
16894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
17894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// Or if you prefer:
18894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
19894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//  OS << format("mynumber: %4.5f\n", 1234.412);
20894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
21894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===----------------------------------------------------------------------===//
22894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
23894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#ifndef LLVM_SUPPORT_FORMAT_H
24894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#define LLVM_SUPPORT_FORMAT_H
25894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
26894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#include <cassert>
27894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#include <cstdio>
28894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#ifdef _MSC_VER
29894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// FIXME: This define is wrong:
30894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//  - _snprintf does not guarantee that trailing null is always added - if
31894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//    there is no space for null, it does not report any error.
32894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//  - According to C++ standard, snprintf should be visible in the 'std'
33894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//    namespace - this define makes this impossible.
34894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#define snprintf _snprintf
35894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#endif
36894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
37894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumannamespace llvm {
38894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
39894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// format_object_base - This is a helper class used for handling formatted
40894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// output.  It is the abstract base class of a templated derived class.
41894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanclass format_object_base {
42894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanprotected:
43894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  const char *Fmt;
44894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  virtual void home(); // Out of line virtual method.
45894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
46894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  /// snprint - Call snprintf() for this object, on the given buffer and size.
47894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  virtual int snprint(char *Buffer, unsigned BufferSize) const = 0;
48894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
49894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanpublic:
50894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  format_object_base(const char *fmt) : Fmt(fmt) {}
51894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  virtual ~format_object_base() {}
52894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
53894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  /// print - Format the object into the specified buffer.  On success, this
54894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  /// returns the length of the formatted string.  If the buffer is too small,
55894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  /// this returns a length to retry with, which will be larger than BufferSize.
56894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  unsigned print(char *Buffer, unsigned BufferSize) const {
57894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    assert(BufferSize && "Invalid buffer size!");
58894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
59894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    // Print the string, leaving room for the terminating null.
60894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    int N = snprint(Buffer, BufferSize);
61894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
62894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    // VC++ and old GlibC return negative on overflow, just double the size.
63894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    if (N < 0)
64894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      return BufferSize*2;
65894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
66894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    // Other impls yield number of bytes needed, not including the final '\0'.
67894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    if (unsigned(N) >= BufferSize)
68894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      return N+1;
69894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
70894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    // Otherwise N is the length of output (not including the final '\0').
71894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return N;
72894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
73894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman};
74894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
75894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// format_object1 - This is a templated helper class used by the format
76894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// function that captures the object to be formated and the format string. When
77894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// actually printed, this synthesizes the string into a temporary buffer
78894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// provided and returns whether or not it is big enough.
79894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumantemplate <typename T>
80894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanclass format_object1 : public format_object_base {
81894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  T Val;
82894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanpublic:
83894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  format_object1(const char *fmt, const T &val)
84894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    : format_object_base(fmt), Val(val) {
85894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
86894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
87894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  virtual int snprint(char *Buffer, unsigned BufferSize) const {
88894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return snprintf(Buffer, BufferSize, Fmt, Val);
89894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
90894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman};
91894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
92894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// format_object2 - This is a templated helper class used by the format
93894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// function that captures the object to be formated and the format string. When
94894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// actually printed, this synthesizes the string into a temporary buffer
95894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// provided and returns whether or not it is big enough.
96894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumantemplate <typename T1, typename T2>
97894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanclass format_object2 : public format_object_base {
98894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  T1 Val1;
99894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  T2 Val2;
100894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanpublic:
101894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  format_object2(const char *fmt, const T1 &val1, const T2 &val2)
102894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  : format_object_base(fmt), Val1(val1), Val2(val2) {
103894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
104894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
105894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  virtual int snprint(char *Buffer, unsigned BufferSize) const {
106894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return snprintf(Buffer, BufferSize, Fmt, Val1, Val2);
107894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
108894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman};
109894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
110894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// format_object3 - This is a templated helper class used by the format
111894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// function that captures the object to be formated and the format string. When
112894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// actually printed, this synthesizes the string into a temporary buffer
113894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// provided and returns whether or not it is big enough.
114894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumantemplate <typename T1, typename T2, typename T3>
115894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanclass format_object3 : public format_object_base {
116894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  T1 Val1;
117894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  T2 Val2;
118894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  T3 Val3;
119894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanpublic:
120894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  format_object3(const char *fmt, const T1 &val1, const T2 &val2,const T3 &val3)
121894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    : format_object_base(fmt), Val1(val1), Val2(val2), Val3(val3) {
122894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
123894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
124894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  virtual int snprint(char *Buffer, unsigned BufferSize) const {
125894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return snprintf(Buffer, BufferSize, Fmt, Val1, Val2, Val3);
126894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
127894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman};
128894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
12919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman/// format_object4 - This is a templated helper class used by the format
13019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman/// function that captures the object to be formated and the format string. When
13119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman/// actually printed, this synthesizes the string into a temporary buffer
13219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman/// provided and returns whether or not it is big enough.
13319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Baumantemplate <typename T1, typename T2, typename T3, typename T4>
13419bac1e08be200c31efd26f0f5fd144c9b3eefd3John Baumanclass format_object4 : public format_object_base {
13519bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  T1 Val1;
13619bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  T2 Val2;
13719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  T3 Val3;
13819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  T4 Val4;
13919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Baumanpublic:
14019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  format_object4(const char *fmt, const T1 &val1, const T2 &val2,
14119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman                 const T3 &val3, const T4 &val4)
14219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    : format_object_base(fmt), Val1(val1), Val2(val2), Val3(val3), Val4(val4) {
14319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  }
14419bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman
14519bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  virtual int snprint(char *Buffer, unsigned BufferSize) const {
14619bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    return snprintf(Buffer, BufferSize, Fmt, Val1, Val2, Val3, Val4);
14719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  }
14819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman};
14919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman
15019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman/// format_object5 - This is a templated helper class used by the format
15119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman/// function that captures the object to be formated and the format string. When
15219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman/// actually printed, this synthesizes the string into a temporary buffer
15319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman/// provided and returns whether or not it is big enough.
15419bac1e08be200c31efd26f0f5fd144c9b3eefd3John Baumantemplate <typename T1, typename T2, typename T3, typename T4, typename T5>
15519bac1e08be200c31efd26f0f5fd144c9b3eefd3John Baumanclass format_object5 : public format_object_base {
15619bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  T1 Val1;
15719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  T2 Val2;
15819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  T3 Val3;
15919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  T4 Val4;
16019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  T5 Val5;
16119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Baumanpublic:
16219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  format_object5(const char *fmt, const T1 &val1, const T2 &val2,
16319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman                 const T3 &val3, const T4 &val4, const T5 &val5)
16419bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    : format_object_base(fmt), Val1(val1), Val2(val2), Val3(val3), Val4(val4),
16519bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman      Val5(val5) {
16619bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  }
16719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman
16819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  virtual int snprint(char *Buffer, unsigned BufferSize) const {
16919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    return snprintf(Buffer, BufferSize, Fmt, Val1, Val2, Val3, Val4, Val5);
17019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  }
17119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman};
17219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman
173894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// format - This is a helper function that is used to produce formatted output.
174894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// This is typically used like:  OS << format("%0.4f", myfloat) << '\n';
175894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumantemplate <typename T>
176894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumaninline format_object1<T> format(const char *Fmt, const T &Val) {
177894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  return format_object1<T>(Fmt, Val);
178894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman}
179894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
180894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// format - This is a helper function that is used to produce formatted output.
181894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// This is typically used like:  OS << format("%0.4f", myfloat) << '\n';
182894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumantemplate <typename T1, typename T2>
183894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumaninline format_object2<T1, T2> format(const char *Fmt, const T1 &Val1,
184894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                                     const T2 &Val2) {
185894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  return format_object2<T1, T2>(Fmt, Val1, Val2);
186894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman}
187894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
188894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// format - This is a helper function that is used to produce formatted output.
189894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// This is typically used like:  OS << format("%0.4f", myfloat) << '\n';
190894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumantemplate <typename T1, typename T2, typename T3>
191894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  inline format_object3<T1, T2, T3> format(const char *Fmt, const T1 &Val1,
192894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                                           const T2 &Val2, const T3 &Val3) {
193894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  return format_object3<T1, T2, T3>(Fmt, Val1, Val2, Val3);
194894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman}
195894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
19619bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman/// format - This is a helper function that is used to produce formatted output.
19719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman/// This is typically used like:  OS << format("%0.4f", myfloat) << '\n';
19819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Baumantemplate <typename T1, typename T2, typename T3, typename T4>
19919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Baumaninline format_object4<T1, T2, T3, T4> format(const char *Fmt, const T1 &Val1,
20019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman                                             const T2 &Val2, const T3 &Val3,
20119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman                                             const T4 &Val4) {
20219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  return format_object4<T1, T2, T3, T4>(Fmt, Val1, Val2, Val3, Val4);
20319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman}
20419bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman
20519bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman/// format - This is a helper function that is used to produce formatted output.
20619bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman/// This is typically used like:  OS << format("%0.4f", myfloat) << '\n';
20719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Baumantemplate <typename T1, typename T2, typename T3, typename T4, typename T5>
20819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Baumaninline format_object5<T1, T2, T3, T4, T5> format(const char *Fmt,const T1 &Val1,
20919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman                                             const T2 &Val2, const T3 &Val3,
21019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman                                             const T4 &Val4, const T5 &Val5) {
21119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  return format_object5<T1, T2, T3, T4, T5>(Fmt, Val1, Val2, Val3, Val4, Val5);
21219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman}
21319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman
214894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman} // end namespace llvm
215894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
216894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#endif
217