On Jul 27, 2012, at 7:30 AM, Timur Iskhodzhanov wrote:
> Attached is an updated patch which has slightly uglier code (due to
> code duplication) but better mangling.
> The "eta" mangling remains the same, "_E$$A6" has been replaced with
> "_E" everywhere.

+  QualType pointee = T->getPointeeType();
+  assert(isa<FunctionProtoType>(pointee));
+  mangleType(static_cast<const FunctionProtoType*>(pointee.getTypePtr()), 
NULL, false, false);

The easier way to do an assert-and-cast is like this:
  cast<FunctionProtoType>(pointee)

However, you can't actually do a cast here, because there could be a typedef in 
the way.  Test case:
  typedef void fn();
  void foo(fn^ block) { block(); }

So instead you need to do this:
  pointee->castAs<FunctionProtoType>()
This is like getAs<>, but asserting.

John.

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to