summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-13 01:34:32 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-13 01:34:32 +0000
commit2847f3805ebeeb7787323b2b3a6aafa44022a908 (patch)
treeebbb2a3a9e008403adabc236def2f23a9b1b7d4b /llvm/lib/IR
parente146000565c86e7cd70d746a64084f1ea3a7528e (diff)
downloadbcm5719-llvm-2847f3805ebeeb7787323b2b3a6aafa44022a908.tar.gz
bcm5719-llvm-2847f3805ebeeb7787323b2b3a6aafa44022a908.zip
AsmWriter/Bitcode: MDTemplate{Type,Value}Parameter
llvm-svn: 229019
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/AsmWriter.cpp41
1 files changed, 31 insertions, 10 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 29de2f291d2..4e7bc8ded0c 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -1678,18 +1678,39 @@ static void writeMDNamespace(raw_ostream &Out, const MDNamespace *N,
Out << ")";
}
-static void writeMDTemplateTypeParameter(raw_ostream &,
- const MDTemplateTypeParameter *,
- TypePrinting *, SlotTracker *,
- const Module *) {
- llvm_unreachable("write not implemented");
+static void writeMDTemplateTypeParameter(raw_ostream &Out,
+ const MDTemplateTypeParameter *N,
+ TypePrinting *TypePrinter,
+ SlotTracker *Machine,
+ const Module *Context) {
+ Out << "!MDTemplateTypeParameter(";
+ FieldSeparator FS;
+ Out << FS << "scope: ";
+ writeMetadataAsOperand(Out, N->getScope(), TypePrinter, Machine, Context);
+ Out << FS << "name: \"" << N->getName() << "\"";
+ Out << FS << "type: ";
+ writeMetadataAsOperand(Out, N->getType(), TypePrinter, Machine, Context);
+ Out << ")";
}
-static void writeMDTemplateValueParameter(raw_ostream &,
- const MDTemplateValueParameter *,
- TypePrinting *, SlotTracker *,
- const Module *) {
- llvm_unreachable("write not implemented");
+
+static void writeMDTemplateValueParameter(raw_ostream &Out,
+ const MDTemplateValueParameter *N,
+ TypePrinting *TypePrinter,
+ SlotTracker *Machine,
+ const Module *Context) {
+ Out << "!MDTemplateValueParameter(";
+ FieldSeparator FS;
+ writeTag(Out, FS, N);
+ Out << FS << "scope: ";
+ writeMetadataAsOperand(Out, N->getScope(), TypePrinter, Machine, Context);
+ Out << FS << "name: \"" << N->getName() << "\"";
+ Out << FS << "type: ";
+ writeMetadataAsOperand(Out, N->getType(), TypePrinter, Machine, Context);
+ Out << FS << "value: ";
+ writeMetadataAsOperand(Out, N->getValue(), TypePrinter, Machine, Context);
+ Out << ")";
}
+
static void writeMDGlobalVariable(raw_ostream &, const MDGlobalVariable *,
TypePrinting *, SlotTracker *,
const Module *) {
OpenPOWER on IntegriCloud