diff options
author | Kostya Serebryany <kcc@google.com> | 2012-05-02 13:12:19 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2012-05-02 13:12:19 +0000 |
commit | 37cb9acac54fdebdb833dc7e2f312d8e3bb33002 (patch) | |
tree | 933b5eea62b9f8434d5b00676cee303ad142a912 | |
parent | 55e7098bbc363473c01229517097d2a04e04e9b0 (diff) | |
download | external_llvm-37cb9acac54fdebdb833dc7e2f312d8e3bb33002.zip external_llvm-37cb9acac54fdebdb833dc7e2f312d8e3bb33002.tar.gz external_llvm-37cb9acac54fdebdb833dc7e2f312d8e3bb33002.tar.bz2 |
[tsan] typo and style (thanks to Nick Lewycky)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155986 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Instrumentation/ThreadSanitizer.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index 2f6c829..31af145 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<Instruction*> &Local, - SmallVectorImpl<Instruction*> &All); + void chooseInstructionsToInstrument(SmallVectorImpl<Instruction*> &Local, + SmallVectorImpl<Instruction*> &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<Instruction*> &Local, SmallVectorImpl<Instruction*> &All) { SmallSet<Value*, 8> WriteTargets; @@ -238,13 +238,13 @@ void ThreadSanitizer::choseInstructionsToInstrument( static bool isAtomic(Instruction *I) { if (LoadInst *LI = dyn_cast<LoadInst>(I)) return LI->isAtomic() && LI->getSynchScope() == CrossThread; - else if (StoreInst *SI = dyn_cast<StoreInst>(I)) + if (StoreInst *SI = dyn_cast<StoreInst>(I)) return SI->isAtomic() && SI->getSynchScope() == CrossThread; - else if (isa<AtomicRMWInst>(I)) + if (isa<AtomicRMWInst>(I)) return true; - else if (isa<AtomicCmpXchgInst>(I)) + if (isa<AtomicCmpXchgInst>(I)) return true; - else if (FenceInst *FI = dyn_cast<FenceInst>(I)) + if (FenceInst *FI = dyn_cast<FenceInst>(I)) return FI->getSynchScope() == CrossThread; return false; } @@ -273,10 +273,10 @@ bool ThreadSanitizer::runOnFunction(Function &F) { RetVec.push_back(BI); else if (isa<CallInst>(BI) || isa<InvokeInst>(BI)) { HasCalls = true; - choseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores); + chooseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores); } } - choseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores); + chooseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores); } // We have collected all loads and stores. |