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 | b50a088122875184c3dfc96337e631e2e854d2f7 (patch) | |
| tree | 261f329dec08b0d974e3401b647148747d080612 /clang/lib | |
| parent | 6ca6ba20bae79c8ded2383468b02ed45ab32431d (diff) | |
| download | bcm5719-llvm-b50a088122875184c3dfc96337e631e2e854d2f7.tar.gz bcm5719-llvm-b50a088122875184c3dfc96337e631e2e854d2f7.zip | |
Make sure volatile variables are emitted even if static. Fixes rdar://8315219
llvm-svn: 112043
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 37ef59cc36f..e9ca7ddb488 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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. |

