[cfe-commits] r112112 - in /cfe/trunk: lib/AST/ASTContext.cpp test/CodeGen/volatile.c

Argyrios Kyrtzidis akyrtzi at gmail.com
Wed Aug 25 16:42:51 PDT 2010


Author: akirtzidis
Date: Wed Aug 25 18:42:51 2010
New Revision: 112112

URL: http://llvm.org/viewvc/llvm-project?rev=112112&view=rev
Log:
Revert r112043, static volatiles are removed by the optimizer. Thanks Chris!

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/test/CodeGen/volatile.c

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=112112&r1=112111&r2=112112&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Wed Aug 25 18:42:51 2010
@@ -5606,10 +5606,6 @@
   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.

Modified: cfe/trunk/test/CodeGen/volatile.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/volatile.c?rev=112112&r1=112111&r2=112112&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/volatile.c (original)
+++ cfe/trunk/test/CodeGen/volatile.c Wed Aug 25 18:42:51 2010
@@ -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 @@
   (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;





More information about the cfe-commits mailing list