diff options
author | Steve Naroff <snaroff@apple.com> | 2007-08-01 17:20:42 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2007-08-01 17:20:42 +0000 |
commit | 8d1a3b8ca1e5fcc4567b5a6f51d82be2e460de1c (patch) | |
tree | 01f613be2c7baff3e4f229bca50a1212489ca554 /AST/Type.cpp | |
parent | bf98651d4208f411b769a86976097683cbac36c3 (diff) |
Two typeof() related changes...
- Changed the name of ASTContext::getTypeOfType(Expr*)->getTypeOfExpr().
- Remove FIXME for TypeOfExpr::getAsStringInternal(). This will work fine for printing the AST. It isn't ideal
for error diagnostics (since it's more natural to display the expressions type).
One "random" (or at least delayed:-) change...
- Changed all "ext_typecheck_*" diagnostics from EXTENSION->WARNING. Reason: Since -pedantic is now
off (by default), these diagnostics were never being emitted (which is bad). With this change, clang will
emit the warning all the time. The only downside (wrt GCC compatibility) is -pedantic-errors will not turn
this diagnostics into errors (a "feature" of making tagging them with EXTENSION). When/if this becomes
an issue, we can revisit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'AST/Type.cpp')
-rw-r--r-- | AST/Type.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/AST/Type.cpp b/AST/Type.cpp index 15f0968b81..63a681a52c 100644 --- a/AST/Type.cpp +++ b/AST/Type.cpp @@ -18,6 +18,8 @@ #include "clang/Basic/TargetInfo.h" #include "llvm/Support/Streams.h" #include "llvm/ADT/StringExtras.h" +#include <sstream> + using namespace clang; Type::~Type() {} @@ -652,9 +654,9 @@ void OCUVectorType::getAsStringInternal(std::string &S) const { } void TypeOfExpr::getAsStringInternal(std::string &InnerString) const { - // FIXME: output expression, getUnderlyingExpr()->print(). - // At the moment, Stmt::print(std::ostream) doesn't work for us here. - InnerString = "typeof(<expr>) " + InnerString; + std::ostringstream s; + getUnderlyingExpr()->print(s); + InnerString = "typeof(" + s.str() + ") " + InnerString; } void TypeOfType::getAsStringInternal(std::string &S) const { |