[polly] r330292 - [RuntimeDebugBuilder] Print vectors passed without withspaces
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 18 13:28:26 PDT 2018
Author: grosser
Date: Wed Apr 18 13:28:26 2018
New Revision: 330292
URL: http://llvm.org/viewvc/llvm-project?rev=330292&view=rev
Log:
[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.
Modified:
polly/trunk/include/polly/CodeGen/RuntimeDebugBuilder.h
Modified: polly/trunk/include/polly/CodeGen/RuntimeDebugBuilder.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/CodeGen/RuntimeDebugBuilder.h?rev=330292&r1=330291&r2=330292&view=diff
==============================================================================
--- polly/trunk/include/polly/CodeGen/RuntimeDebugBuilder.h (original)
+++ polly/trunk/include/polly/CodeGen/RuntimeDebugBuilder.h Wed Apr 18 13:28:26 2018
@@ -87,14 +87,8 @@ private:
static void createPrinter(PollyIRBuilder &Builder, bool UseGPU,
std::vector<llvm::Value *> &Values,
llvm::ArrayRef<llvm::Value *> Array, Args... args) {
- if (Array.size() >= 2)
- createPrinter(Builder, Values, Array[0], " ",
- llvm::ArrayRef<llvm::Value *>(&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.
More information about the llvm-commits
mailing list