diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-25 10:15:24 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-25 10:15:24 +0000 |
commit | f869d205c5985121b8134a9174ed8d3b136637b5 (patch) | |
tree | 17a38551654baccb38ece5d2cf71f392bab007f0 /lib | |
parent | 62c78d54bee499dd87f768f48b21c9b5ec15e516 (diff) |
Make sure volatile variables are emitted even if static. Fixes rdar://8315219
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112043 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/ASTContext.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 37ef59cc36..e9ca7ddb48 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -5606,6 +5606,10 @@ 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. |