Make parse-ast-print print the storage class and inline
specifier of functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41416 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/ASTStreamers.cpp b/Driver/ASTStreamers.cpp
index 3b6138a..c819623 100644
--- a/Driver/ASTStreamers.cpp
+++ b/Driver/ASTStreamers.cpp
@@ -47,6 +47,18 @@
static void PrintFunctionDeclStart(FunctionDecl *FD) {
bool HasBody = FD->getBody();
+ fprintf(stderr, "\n");
+
+ switch (FD->getStorageClass()) {
+ default: assert(0 && "Unknown storage class");
+ case FunctionDecl::None: break;
+ case FunctionDecl::Extern: fprintf(stderr, "extern "); break;
+ case FunctionDecl::Static: fprintf(stderr, "static "); break;
+ }
+
+ if (FD->isInline())
+ fprintf(stderr, "inline ");
+
std::string Proto = FD->getName();
FunctionType *AFT = cast<FunctionType>(FD->getType());
@@ -72,7 +84,7 @@
}
AFT->getResultType().getAsStringInternal(Proto);
- fprintf(stderr, "\n%s", Proto.c_str());
+ fprintf(stderr, "%s", Proto.c_str());
if (!FD->getBody())
fprintf(stderr, ";\n");