diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-05-27 11:36:04 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-05-27 11:36:04 +0000 |
commit | 3e9a5d346828e8310a45d770928d4e51c5b929e4 (patch) | |
tree | e5e4d99c9e3ec524581552e77774e85f24caeaed /llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp | |
parent | 4ec6e9d50c05e80730c5b25da4849d7bc723dbac (diff) | |
download | llvm-3e9a5d346828e8310a45d770928d4e51c5b929e4.zip llvm-3e9a5d346828e8310a45d770928d4e51c5b929e4.tar.gz llvm-3e9a5d346828e8310a45d770928d4e51c5b929e4.tar.bz2 |
Apply clang-tidy's misc-static-assert where it makes sense.
Also fold conditions into assert(0) where it makes sense. No functional
change intended.
llvm-svn: 270982
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp b/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp index 4d77b9d..0350c35 100644 --- a/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp +++ b/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp @@ -522,12 +522,9 @@ void SIScheduleBlock::addPred(SIScheduleBlock *Pred) { } Preds.push_back(Pred); -#ifndef NDEBUG - for (SIScheduleBlock* S : Succs) { - if (PredID == S->getID()) - assert(!"Loop in the Block Graph!\n"); - } -#endif + assert(none_of(Succs, + [=](SIScheduleBlock *S) { return PredID == S->getID(); }) && + "Loop in the Block Graph!"); } void SIScheduleBlock::addSucc(SIScheduleBlock *Succ) { @@ -541,12 +538,9 @@ void SIScheduleBlock::addSucc(SIScheduleBlock *Succ) { if (Succ->isHighLatencyBlock()) ++NumHighLatencySuccessors; Succs.push_back(Succ); -#ifndef NDEBUG - for (SIScheduleBlock* P : Preds) { - if (SuccID == P->getID()) - assert(!"Loop in the Block Graph!\n"); - } -#endif + assert(none_of(Preds, + [=](SIScheduleBlock *P) { return SuccID == P->getID(); }) && + "Loop in the Block Graph!"); } #ifndef NDEBUG |