From f4a3ff008d58fca4031f03644d96a634cd9815ba Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Wed, 18 Apr 2018 20:28:26 +0000 Subject: [PATCH] [RuntimeDebugBuilder] Print vectors passed without withspaces Originally the RuntimeDebugBuilder printed vectors with withspaces between the elements. This historic use is meanwhile gone, but the functionality is still available. We now change the behavior to print elements just one after the other without adding white spaces in between. This is useful for D45743, an upcoming commmit, which also adds test coverage for this feature. In general, printing elements of a vector directly is more generic as it allows uses where no white-spaces are desired. Specifically, it allows the user to build vectors of items to be printed where their length is only known at run-time. llvm-svn: 330292 --- polly/include/polly/CodeGen/RuntimeDebugBuilder.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/polly/include/polly/CodeGen/RuntimeDebugBuilder.h b/polly/include/polly/CodeGen/RuntimeDebugBuilder.h index 3a4e60d..334030f 100644 --- a/polly/include/polly/CodeGen/RuntimeDebugBuilder.h +++ b/polly/include/polly/CodeGen/RuntimeDebugBuilder.h @@ -87,14 +87,8 @@ private: static void createPrinter(PollyIRBuilder &Builder, bool UseGPU, std::vector &Values, llvm::ArrayRef Array, Args... args) { - if (Array.size() >= 2) - createPrinter(Builder, Values, Array[0], " ", - llvm::ArrayRef(&Array[1], Array.size() - 1), - args...); - else if (Array.size() == 1) - createPrinter(Builder, UseGPU, Values, Array[0], args...); - else - createPrinter(Builder, UseGPU, Values, args...); + Values.insert(Values.end(), Array.begin(), Array.end()); + createPrinter(Builder, UseGPU, Values, args...); } /// Print a list of Values. -- 2.7.4