]> granicus.if.org Git - clang/commitdiff
Revert r112043, static volatiles are removed by the optimizer. Thanks Chris!
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 25 Aug 2010 23:42:51 +0000 (23:42 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 25 Aug 2010 23:42:51 +0000 (23:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112112 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
test/CodeGen/volatile.c

index e9ca7ddb488abbf3460ee88e7f63ea485e3fd829..37ef59cc36fc87d8b0fd8573372f0a2c29599aea 100644 (file)
@@ -5606,10 +5606,6 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
   if (VD->isThisDeclarationADefinition() == VarDecl::DeclarationOnly)
     return false;
 
-  // Always emit volatiles.
-  if (VD->getType().isVolatileQualified())
-    return true;
-
   // Structs that have non-trivial constructors or destructors are required.
 
   // FIXME: Handle references.
index a6c17b00419e2269dbe382ab484e960a497d5660..1a996defcf0107ed34fe502a20112add25905711 100644 (file)
@@ -1,7 +1,6 @@
 // RUN: %clang_cc1 -emit-llvm < %s -o %t
 // RUN: grep volatile %t | count 28
 // RUN: grep memcpy %t | count 7
-// RUN: %clang_cc1 %s -Wall -verify -emit-llvm -o - | FileCheck %s
 
 // The number 28 comes from the current codegen for volatile loads;
 // if this number changes, it's not necessarily something wrong, but
@@ -97,9 +96,5 @@ int main() {
   (void)vF2;
   vF2 = vF2;
   vF2 = vF2 = vF2;
-  vF2 = (vF2, vF2); // expected-warning {{expression result unused}}
+  vF2 = (vF2, vF2);
 }
-
-// Make sure this is emitted. rdar://8315219
-// CHECK: @gvx
-static volatile int gvx = 0;