sirit/src/insts/annotation.cpp

32 lines
931 B
C++
Raw Normal View History

2018-10-23 09:45:56 +02:00
/* This file is part of the sirit project.
* Copyright (c) 2018 ReinUsesLisp
* This software may be used and distributed according to the terms of the GNU
* Lesser General Public License version 2.1 or any later version.
*/
#include "insts.h"
#include "sirit/sirit.h"
namespace Sirit {
Ref Module::Decorate(Ref target, spv::Decoration decoration,
const std::vector<Operand*>& literals) {
2018-10-23 10:05:40 +02:00
auto op{new Op(spv::Op::OpDecorate)};
2018-10-23 09:45:56 +02:00
op->Add(target);
AddEnum(op, decoration);
2018-10-23 10:02:18 +02:00
op->Sink(literals);
2018-10-23 09:45:56 +02:00
return AddAnnotation(op);
}
2018-10-28 09:38:10 +01:00
Ref Module::MemberDecorate(Ref structure_type, Operand* member, spv::Decoration decoration,
const std::vector<Operand*>& literals) {
auto op{new Op(spv::Op::OpMemberDecorate)};
op->Add(structure_type);
op->Sink(member);
AddEnum(op, decoration);
op->Sink(literals);
return AddAnnotation(op);
}
2018-10-23 09:45:56 +02:00
} // namespace Sirit