summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2018-04-18 20:28:26 +0000
committerTobias Grosser <tobias@grosser.es>2018-04-18 20:28:26 +0000
commitf4a3ff008d58fca4031f03644d96a634cd9815ba (patch)
tree56c5e3fbfd54515c5003d5be0aa436f9e47953f3
parent792547b348486deab172b0f95448add2dd5a933f (diff)
downloadbcm5719-llvm-f4a3ff008d58fca4031f03644d96a634cd9815ba.tar.gz
bcm5719-llvm-f4a3ff008d58fca4031f03644d96a634cd9815ba.zip
[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
-rw-r--r--polly/include/polly/CodeGen/RuntimeDebugBuilder.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/polly/include/polly/CodeGen/RuntimeDebugBuilder.h b/polly/include/polly/CodeGen/RuntimeDebugBuilder.h
index 3a4e60db09c..334030fd3c3 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<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.
OpenPOWER on IntegriCloud