Basic support for volatile loads and stores. Stores the volatile 
qualifier in the lvalue, and changes lvalue loads/stores to honor 
the volatile flag.  Places which need some further attention are marked 
with FIXMEs.

Patch by Cédric Venet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52264 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index 78e02e4..e545fc1 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -222,6 +222,7 @@
     if (SelTypes == 0) {
       // If it's already cached, return it.
       if (UntypedSelectors[CName->getStringValue()]) {
+        // FIXME: Volatility
         return Builder.CreateLoad(UntypedSelectors[CName->getStringValue()]);
       }
       // If it isn't, cache it.
@@ -230,6 +231,7 @@
           llvm::GlobalValue::InternalLinkage, ".objc_untyped_selector_alias",
           NULL, &TheModule);
       UntypedSelectors[CName->getStringValue()] = Sel;
+      // FIXME: Volatility
       return Builder.CreateLoad(Sel);
     }
     // Typed selectors
@@ -238,6 +240,7 @@
           CTypes->getStringValue());
       // If it's already cached, return it.
       if (TypedSelectors[Selector]) {
+        // FIXME: Volatility
         return Builder.CreateLoad(TypedSelectors[Selector]);
       }
       // If it isn't, cache it.
@@ -246,6 +249,7 @@
           llvm::GlobalValue::InternalLinkage, ".objc_typed_selector_alias",
           NULL, &TheModule);
       TypedSelectors[Selector] = Sel;
+      // FIXME: Volatility
       return Builder.CreateLoad(Sel);
     }
   }
@@ -337,6 +341,7 @@
   llvm::StructType *ObjCSuperTy = llvm::StructType::get(Receiver->getType(),
       IdTy, NULL);
   llvm::Value *ObjCSuper = Builder.CreateAlloca(ObjCSuperTy);
+  // FIXME: volatility
   Builder.CreateStore(Receiver, Builder.CreateStructGEP(ObjCSuper, 0));
   Builder.CreateStore(ReceiverClass, Builder.CreateStructGEP(ObjCSuper, 1));