[cfe-commits] r44550 - in /cfe/trunk: Driver/ASTConsumers.cpp test/Sema/ast-print.c
Chris Lattner
sabre at nondot.org
Mon Dec 3 13:43:25 PST 2007
Author: lattner
Date: Mon Dec 3 15:43:25 2007
New Revision: 44550
URL: http://llvm.org/viewvc/llvm-project?rev=44550&view=rev
Log:
Fix an ast-print/ast-dump bug.
Added:
cfe/trunk/test/Sema/ast-print.c
Modified:
cfe/trunk/Driver/ASTConsumers.cpp
Modified: cfe/trunk/Driver/ASTConsumers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.cpp?rev=44550&r1=44549&r2=44550&view=diff
==============================================================================
--- cfe/trunk/Driver/ASTConsumers.cpp (original)
+++ cfe/trunk/Driver/ASTConsumers.cpp Mon Dec 3 15:43:25 2007
@@ -60,9 +60,9 @@
Out << "inline ";
std::string Proto = FD->getName();
- FunctionType *AFT = cast<FunctionType>(FD->getType());
+ const FunctionType *AFT = FD->getType()->getAsFunctionType();
- if (FunctionTypeProto *FT = dyn_cast<FunctionTypeProto>(AFT)) {
+ if (const FunctionTypeProto *FT = dyn_cast<FunctionTypeProto>(AFT)) {
Proto += "(";
for (unsigned i = 0, e = FD->getNumParams(); i != e; ++i) {
if (i) Proto += ", ";
Added: cfe/trunk/test/Sema/ast-print.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/ast-print.c?rev=44550&view=auto
==============================================================================
--- cfe/trunk/test/Sema/ast-print.c (added)
+++ cfe/trunk/test/Sema/ast-print.c Mon Dec 3 15:43:25 2007
@@ -0,0 +1,6 @@
+// RUN: clang %s -ast-print
+
+typedef void func_typedef();
+func_typedef xxx;
+
+
More information about the cfe-commits
mailing list