blob: 500d91778a65615797beb45b31b95bd99513e126 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include <willow/IR/Function.h>
namespace willow {
BasicBlock *Function::addBlock(std::unique_ptr<BasicBlock> block) {
auto p = block.get();
blocks.push_back(std::move(block));
p->setParent(this);
return p;
}
const BasicBlock *Function::entryBlock() const {
if (blocks.empty())
return nullptr;
else
return blocks.front().get();
}
BasicBlock *Function::entryBlock() {
if (blocks.empty())
return nullptr;
else
return blocks.front().get();
}
}; // namespace willow
|