From d7708773288c4f33bf98c724f7a486b5973b8cc6 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Fri, 24 Jun 2016 04:05:21 +0000 Subject: Switch more loops to be range-based This makes the code a little more concise, no functional change is intended. llvm-svn: 273644 --- llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp') diff --git a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index 287d5bfa260..a23b1ddf825 100644 --- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -326,9 +326,7 @@ void ThreadSanitizer::chooseInstructionsToInstrument( const DataLayout &DL) { SmallSet WriteTargets; // Iterate from the end. - for (SmallVectorImpl::reverse_iterator It = Local.rbegin(), - E = Local.rend(); It != E; ++It) { - Instruction *I = *It; + for (Instruction *I : reverse(Local)) { if (StoreInst *Store = dyn_cast(I)) { Value *Addr = Store->getPointerOperand(); if (!shouldInstrumentReadWriteFromAddress(Addr)) -- cgit v1.2.3