Skip to content
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

search for includes in share/p4c #4978

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
search for includes in share/p4c
Signed-off-by: Chris Dodd <cdodd@nvidia.com>
  • Loading branch information
ChrisDodd committed Dec 5, 2024
commit 53e89e9e6dfefbaa678dd94152ab3170d7427ea9
7 changes: 5 additions & 2 deletions frontends/common/parser_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,13 @@ bool ParserOptions::searchForIncludePath(const char *&includePathOut,
}

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.

"../share/p4c/p4include"_cs},
exename(argv[0]));
searchForIncludePath(p4_14includePath,
{"p4_14include"_cs, "../p4_14include"_cs, "../../p4_14include"_cs},
{"p4_14include"_cs, "../p4_14include"_cs, "../../p4_14include"_cs,
"../share/p4c/p4_14include"_cs},
exename(argv[0]));

auto remainingOptions = Util::Options::process(argc, argv);
Expand Down
Loading