diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2014-03-09 03:16:50 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2014-03-09 03:16:50 +0000 |
| commit | 2201e59542025cdce2d92988a40e9fc520340ef3 (patch) | |
| tree | cb46bc120d68429e1a8d7bef279254ba93766a6f /lib/CodeGen/CGException.cpp | |
| parent | df4c4c09eeb747af3a42734a895879ed0289fa1a (diff) | |
| download | clang-2201e59542025cdce2d92988a40e9fc520340ef3.tar.gz clang-2201e59542025cdce2d92988a40e9fc520340ef3.tar.bz2 clang-2201e59542025cdce2d92988a40e9fc520340ef3.tar.xz | |
[C++11] Update Clang for the change to LLVM's Use-Def chain iterators in
r203364: what was use_iterator is now user_iterator, and there is
a use_iterator for directly iterating over the uses.
This also switches to use the range-based APIs where appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGException.cpp')
| -rw-r--r-- | lib/CodeGen/CGException.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp index 97d9fbb06f..607566ca23 100644 --- a/lib/CodeGen/CGException.cpp +++ b/lib/CodeGen/CGException.cpp @@ -263,12 +263,9 @@ static llvm::Constant *getOpaquePersonalityFn(CodeGenModule &CGM, /// Check whether a personality function could reasonably be swapped /// for a C++ personality function. static bool PersonalityHasOnlyCXXUses(llvm::Constant *Fn) { - for (llvm::Constant::use_iterator - I = Fn->use_begin(), E = Fn->use_end(); I != E; ++I) { - llvm::User *User = *I; - + for (llvm::User *U : Fn->users()) { // Conditionally white-list bitcasts. - if (llvm::ConstantExpr *CE = dyn_cast<llvm::ConstantExpr>(User)) { + if (llvm::ConstantExpr *CE = dyn_cast<llvm::ConstantExpr>(U)) { if (CE->getOpcode() != llvm::Instruction::BitCast) return false; if (!PersonalityHasOnlyCXXUses(CE)) return false; @@ -276,7 +273,7 @@ static bool PersonalityHasOnlyCXXUses(llvm::Constant *Fn) { } // Otherwise, it has to be a landingpad instruction. - llvm::LandingPadInst *LPI = dyn_cast<llvm::LandingPadInst>(User); + llvm::LandingPadInst *LPI = dyn_cast<llvm::LandingPadInst>(U); if (!LPI) return false; for (unsigned I = 0, E = LPI->getNumClauses(); I != E; ++I) { |
