diff options
-rw-r--r-- | lib/AST/ASTContext.cpp | 4 | ||||
-rw-r--r-- | test/CodeGen/volatile.c | 7 |
2 files changed, 1 insertions, 10 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index e9ca7ddb48..37ef59cc36 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -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. diff --git a/test/CodeGen/volatile.c b/test/CodeGen/volatile.c index a6c17b0041..1a996defcf 100644 --- a/test/CodeGen/volatile.c +++ b/test/CodeGen/volatile.c @@ -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; |