[llvm] r261250 - Restrict scope of variables [NFC]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 11:45:31 PST 2016


Author: reames
Date: Thu Feb 18 13:45:31 2016
New Revision: 261250

URL: http://llvm.org/viewvc/llvm-project?rev=261250&view=rev
Log:
Restrict scope of variables [NFC]


Modified:
    llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp

Modified: llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp?rev=261250&r1=261249&r2=261250&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp Thu Feb 18 13:45:31 2016
@@ -99,9 +99,9 @@ bool AtomicExpand::runOnFunction(Functio
     assert((LI || SI || RMWI || CASI || isa<FenceInst>(I)) &&
            "Unknown atomic instruction");
 
-    auto FenceOrdering = Monotonic;
-    bool IsStore, IsLoad;
     if (TLI->getInsertFencesForAtomic()) {
+      auto FenceOrdering = Monotonic;
+      bool IsStore, IsLoad;
       if (LI && isAtLeastAcquire(LI->getOrdering())) {
         FenceOrdering = LI->getOrdering();
         LI->setOrdering(Monotonic);




More information about the llvm-commits mailing list