summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclPrinter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-03 15:50:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-03 15:50:00 +0000
commitadea16bd9e6d3383e289061ef1b24217758a5142 (patch)
treeea01777b972d45c61a04366809b15a599716f9bc /clang/lib/AST/DeclPrinter.cpp
parentb35a211f61c360b4758d79e8c156ac7c3f63df19 (diff)
downloadbcm5719-llvm-adea16bd9e6d3383e289061ef1b24217758a5142.tar.gz
bcm5719-llvm-adea16bd9e6d3383e289061ef1b24217758a5142.zip
Don't compute a patched/semantic storage class.
For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
Diffstat (limited to 'clang/lib/AST/DeclPrinter.cpp')
-rw-r--r--clang/lib/AST/DeclPrinter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index 54fa9ca5890..c3bf8f89b29 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/lib/AST/DeclPrinter.cpp
@@ -393,7 +393,7 @@ void DeclPrinter::VisitEnumConstantDecl(EnumConstantDecl *D) {
void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
CXXConstructorDecl *CDecl = dyn_cast<CXXConstructorDecl>(D);
if (!Policy.SuppressSpecifiers) {
- switch (D->getStorageClassAsWritten()) {
+ switch (D->getStorageClass()) {
case SC_None: break;
case SC_Extern: Out << "extern "; break;
case SC_Static: Out << "static "; break;
@@ -641,9 +641,9 @@ void DeclPrinter::VisitLabelDecl(LabelDecl *D) {
void DeclPrinter::VisitVarDecl(VarDecl *D) {
- StorageClass SCAsWritten = D->getStorageClassAsWritten();
- if (!Policy.SuppressSpecifiers && SCAsWritten != SC_None)
- Out << VarDecl::getStorageClassSpecifierString(SCAsWritten) << " ";
+ StorageClass SC = D->getStorageClass();
+ if (!Policy.SuppressSpecifiers && SC != SC_None)
+ Out << VarDecl::getStorageClassSpecifierString(SC) << " ";
if (!Policy.SuppressSpecifiers && D->isThreadSpecified())
Out << "__thread ";
OpenPOWER on IntegriCloud