summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/AsmWriter.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2018-08-14 01:49:33 +0000
committerTeresa Johnson <tejohnson@google.com>2018-08-14 01:49:33 +0000
commitc7816800d87f848907b1c86d6fc614ad03585c46 (patch)
treeabacefb3e72eb04f6753b5def1fd1d0d13d39c79 /llvm/lib/IR/AsmWriter.cpp
parent40e7663b1fca58b099c1cb1d5278f368494ea46d (diff)
downloadbcm5719-llvm-c7816800d87f848907b1c86d6fc614ad03585c46.tar.gz
bcm5719-llvm-c7816800d87f848907b1c86d6fc614ad03585c46.zip
[ThinLTO] Handle optional args in assembly format for ConstVCalls
Summary: The AsmWriter was only writing the Args for a ConstVCall if it was non-empty, however, the LLParser was always expecting it. To aid in making it optional, surround the ConstVCall VFuncId and Args in parentheses when writing, then make the Args optional when reading. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D49960 llvm-svn: 339637
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r--llvm/lib/IR/AsmWriter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 99a25a723b4..e19c7c20a5d 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -2955,11 +2955,13 @@ void AssemblyWriter::printConstVCalls(
FieldSeparator FS;
for (auto &ConstVCall : VCallList) {
Out << FS;
+ Out << "(";
printVFuncId(ConstVCall.VFunc);
if (!ConstVCall.Args.empty()) {
Out << ", ";
printArgs(ConstVCall.Args);
}
+ Out << ")";
}
Out << ")";
}
OpenPOWER on IntegriCloud