[Lldb-commits] [lldb] r355684 - Make function definition in header inline

Benjamin Kramer via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 8 02:43:56 PST 2019


Author: d0k
Date: Fri Mar  8 02:43:56 2019
New Revision: 355684

URL: http://llvm.org/viewvc/llvm-project?rev=355684&view=rev
Log:
Make function definition in header inline

Otherwise including this header from more than one place will break
linking.

Modified:
    lldb/trunk/include/lldb/Utility/ReproducerInstrumentation.h

Modified: lldb/trunk/include/lldb/Utility/ReproducerInstrumentation.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/ReproducerInstrumentation.h?rev=355684&r1=355683&r2=355684&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Utility/ReproducerInstrumentation.h (original)
+++ lldb/trunk/include/lldb/Utility/ReproducerInstrumentation.h Fri Mar  8 02:43:56 2019
@@ -22,40 +22,40 @@
 
 template <typename T,
           typename std::enable_if<std::is_fundamental<T>::value, int>::type = 0>
-void log_append(llvm::raw_string_ostream &ss, const T &t) {
+inline void log_append(llvm::raw_string_ostream &ss, const T &t) {
   ss << t;
 }
 
 template <typename T, typename std::enable_if<!std::is_fundamental<T>::value,
                                               int>::type = 0>
-void log_append(llvm::raw_string_ostream &ss, const T &t) {
+inline void log_append(llvm::raw_string_ostream &ss, const T &t) {
   ss << &t;
 }
 
 template <typename T>
-void log_append(llvm::raw_string_ostream &ss, const T *t) {
+inline void log_append(llvm::raw_string_ostream &ss, const T *t) {
   ss << t;
 }
 
-inline template <>
-void log_append<char>(llvm::raw_string_ostream &ss, const char *t) {
+template <>
+inline void log_append<char>(llvm::raw_string_ostream &ss, const char *t) {
   ss << t;
 }
 
 template <typename Head>
-void log_helper(llvm::raw_string_ostream &ss, const Head &head) {
+inline void log_helper(llvm::raw_string_ostream &ss, const Head &head) {
   log_append(ss, head);
 }
 
 template <typename Head, typename... Tail>
-void log_helper(llvm::raw_string_ostream &ss, const Head &head,
-                const Tail &... tail) {
+inline void log_helper(llvm::raw_string_ostream &ss, const Head &head,
+                       const Tail &... tail) {
   log_append(ss, head);
   ss << ", ";
   log_helper(ss, tail...);
 }
 
-template <typename... Ts> std::string log_args(const Ts &... ts) {
+template <typename... Ts> inline std::string log_args(const Ts &... ts) {
   std::string buffer;
   llvm::raw_string_ostream ss(buffer);
   log_helper(ss, ts...);




More information about the lldb-commits mailing list