Skip to content

Conversation

@ChrisDodd
Copy link
Contributor

Generally the compiler is run via the p4c driver which sets up the include path properly, but sometimes one wants to run the executable directly. If it is installed in a bin directory somewhere, the standard include files will likely be in share/p4c/p4include, so this change looks there as well as where it was looking.

@fruffy fruffy added the core Topics concerning the core segments of the compiler (frontend, midend, parser) label Oct 24, 2024
std::vector<const char *> *ParserOptions::process(int argc, char *const argv[]) {
searchForIncludePath(p4includePath, {"p4include"_cs, "../p4include"_cs, "../../p4include"_cs},
searchForIncludePath(p4includePath,
{"p4include"_cs, "../p4include"_cs, "../../p4include"_cs,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe create a virtual function that returns this list? Then the list can be overridden by other back ends.

@ChrisDodd ChrisDodd force-pushed the cdodd-includepath branch 2 times, most recently from bae908b to 5aed5d6 Compare January 7, 2025 06:59
@ChrisDodd ChrisDodd force-pushed the cdodd-includepath branch from 5aed5d6 to 229ee61 Compare May 29, 2025 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Topics concerning the core segments of the compiler (frontend, midend, parser)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants