diff --git a/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index 2f6c829e890..31af145e79b 100644 --- a/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -71,8 +71,8 @@ struct ThreadSanitizer : public FunctionPass { private: bool instrumentLoadOrStore(Instruction *I); bool instrumentAtomic(Instruction *I); - void choseInstructionsToInstrument(SmallVectorImpl &Local, - SmallVectorImpl &All); + void chooseInstructionsToInstrument(SmallVectorImpl &Local, + SmallVectorImpl &All); bool addrPointsToConstantData(Value *Addr); int getMemoryAccessFuncIndex(Value *Addr); @@ -207,7 +207,7 @@ bool ThreadSanitizer::addrPointsToConstantData(Value *Addr) { // // 'Local' is a vector of insns within the same BB (no calls between). // 'All' is a vector of insns that will be instrumented. -void ThreadSanitizer::choseInstructionsToInstrument( +void ThreadSanitizer::chooseInstructionsToInstrument( SmallVectorImpl &Local, SmallVectorImpl &All) { SmallSet WriteTargets; @@ -238,13 +238,13 @@ void ThreadSanitizer::choseInstructionsToInstrument( static bool isAtomic(Instruction *I) { if (LoadInst *LI = dyn_cast(I)) return LI->isAtomic() && LI->getSynchScope() == CrossThread; - else if (StoreInst *SI = dyn_cast(I)) + if (StoreInst *SI = dyn_cast(I)) return SI->isAtomic() && SI->getSynchScope() == CrossThread; - else if (isa(I)) + if (isa(I)) return true; - else if (isa(I)) + if (isa(I)) return true; - else if (FenceInst *FI = dyn_cast(I)) + if (FenceInst *FI = dyn_cast(I)) return FI->getSynchScope() == CrossThread; return false; } @@ -273,10 +273,10 @@ bool ThreadSanitizer::runOnFunction(Function &F) { RetVec.push_back(BI); else if (isa(BI) || isa(BI)) { HasCalls = true; - choseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores); + chooseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores); } } - choseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores); + chooseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores); } // We have collected all loads and stores.