[PATCH] D81905: Enhance Itanium demangler interface.

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 15:39:39 PDT 2020


hfinkel added a comment.

In D81905#2115449 <https://reviews.llvm.org/D81905#2115449>, @kbobrovs wrote:

> > Please upload the patch with full context.
>
> Done. Sorry for missing that procedure detail.


Thanks. Regarding this patch itself, did you explain how this API is to be used?

> 
> 
>> I'm inclined to say that we should just enhance Clang to support templated builtins, and then in CGBulitin, just generate the correct LLVM intrinsic directly. No IR pre-processing pass required.
> 
> I agree that that would be useful feature - C++ templated built-ins. But this seems like pretty big infrastructural effort. I don't feel myself familiar with Clang builtin ifra enough to do that. I'll be happy to re-implement intrinsic lowering once the Clang support is available.
>  **Until then, does current approach with using IR pass seem reasonable work-around?**

No. We should actually implement the features that we need. That having been said, did you try declaring the builtin and then declaring it as a function template in the header file? I just spent a few minutes looking through all of the places where `BuiltinID` appears in clang/lib/Sema, etc., and I didn't see any obvious place where this breaks (especially if you use custom type checking for the builtin -- if you don't, there's one place that checks the declaration return type against the builtin return type that would need to be changed). In short, I don't actually think that it's a large infrastructure change.

> For the record: using existing non-templated built-ins mechanism would require separate built-in per each template parameters combination, which does not seem practical.

Agreed.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81905/new/

https://reviews.llvm.org/D81905





More information about the llvm-commits mailing list