|
@@ -563,8 +563,9 @@ void LoopInfo::finish() {
|
|
|
|
|
|
void LoopInfoStack::push(BasicBlock *Header, const llvm::DebugLoc &StartLoc,
|
|
void LoopInfoStack::push(BasicBlock *Header, const llvm::DebugLoc &StartLoc,
|
|
const llvm::DebugLoc &EndLoc) {
|
|
const llvm::DebugLoc &EndLoc) {
|
|
- Active.push_back(LoopInfo(Header, StagedAttrs, StartLoc, EndLoc,
|
|
|
|
- Active.empty() ? nullptr : &Active.back()));
|
|
|
|
|
|
+ Active.emplace_back(
|
|
|
|
+ new LoopInfo(Header, StagedAttrs, StartLoc, EndLoc,
|
|
|
|
+ Active.empty() ? nullptr : Active.back().get()));
|
|
// Clear the attributes so nested loops do not inherit them.
|
|
// Clear the attributes so nested loops do not inherit them.
|
|
StagedAttrs.clear();
|
|
StagedAttrs.clear();
|
|
}
|
|
}
|
|
@@ -756,16 +757,16 @@ void LoopInfoStack::push(BasicBlock *Header, clang::ASTContext &Ctx,
|
|
|
|
|
|
void LoopInfoStack::pop() {
|
|
void LoopInfoStack::pop() {
|
|
assert(!Active.empty() && "No active loops to pop");
|
|
assert(!Active.empty() && "No active loops to pop");
|
|
- Active.back().finish();
|
|
|
|
|
|
+ Active.back()->finish();
|
|
Active.pop_back();
|
|
Active.pop_back();
|
|
}
|
|
}
|
|
|
|
|
|
void LoopInfoStack::InsertHelper(Instruction *I) const {
|
|
void LoopInfoStack::InsertHelper(Instruction *I) const {
|
|
if (I->mayReadOrWriteMemory()) {
|
|
if (I->mayReadOrWriteMemory()) {
|
|
SmallVector<Metadata *, 4> AccessGroups;
|
|
SmallVector<Metadata *, 4> AccessGroups;
|
|
- for (const LoopInfo &AL : Active) {
|
|
|
|
|
|
+ for (const auto &AL : Active) {
|
|
// Here we assume that every loop that has an access group is parallel.
|
|
// Here we assume that every loop that has an access group is parallel.
|
|
- if (MDNode *Group = AL.getAccessGroup())
|
|
|
|
|
|
+ if (MDNode *Group = AL->getAccessGroup())
|
|
AccessGroups.push_back(Group);
|
|
AccessGroups.push_back(Group);
|
|
}
|
|
}
|
|
MDNode *UnionMD = nullptr;
|
|
MDNode *UnionMD = nullptr;
|