New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a 'preserve-routine' flag to clang_delta #43 #44
Conversation
Signed-off-by: Andrew V. Jones <andrewvaughanj@gmail.com>
Signed-off-by: Andrew V. Jones <andrewvaughanj@gmail.com>
I've just briefly looked at the
and so on. Note that all these steps are run in parallel. |
Hmm, I wasn't (actually) thinking about this being something that Were you thinking we'd integrate this into the top-level of For my use-case, I would be interested in running Given this:
|
And simplify the logic for --preserve-routine.
Well, I would not do a manual step as
If you want to start with I've added If you want to run it manually, it's fine. You will need to add
As mentioned, it seems to me as an extra step.
|
Your changes look great to me, and I have no issues with needing to specify a "from" and "to" value to get this to work! I think it is a good change that if you query and provide a |
Codecov Report
@@ Coverage Diff @@
## master #44 +/- ##
==========================================
+ Coverage 40.53% 40.59% +0.06%
==========================================
Files 179 179
Lines 16309 16331 +22
Branches 2068 2070 +2
==========================================
+ Hits 6611 6630 +19
- Misses 9104 9106 +2
- Partials 594 595 +1
Continue to review full report at Codecov.
|
Great, let's merge it now. |
I have one nit: would you be able to preserve a routine that can have a complex template name? Like for:
? |
Hmm, yes, you've got a good point. While mostly this won't be an issue, I can see why it might be nice to have this functionality. I played around, and couldn't find a good way to get either the "full" name or the mangled name from the LLVM API. If we know how to get that "full" name, then I'm totally fine to need to give that name. Currently, for
which isn't great, but also isn't entirely horrible ... |
I guess there must be a way how to get a mangled name from LLVM API. Anyway, we may want to leave it for the future. |
Interestingly, LLVM even has its own in-built regex class: I think the idea about getting the fully qualified names + using a regex sounds great. Personally, I would rather have the unmangled name (despite being more verbose), as I think that will be easier for a user. We may also want some way to use Shall I create a GitHub issue around these and I can take a look if I get some time? |
Yes, that should be a useful feature for the newly added |
This PR adds a new argument (
--preserve-routine=<string>
) toclang_delta
that allows forreplace-function-def-with-decl
to replace all routines apart from the one listed in<string>
.It also adds three test-cases to validate this new behaviour.
Signed-off-by: Andrew V. Jones andrewvaughanj@gmail.com