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

Reject -o flag when using -verilog #357

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/comp/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,7 @@ data ErrMsg =
| EVPIFilesWithNoABin [String]
| EGenNamesForLinking [String]
| EEntryForCodeGen String
| WOFileWithVerilogBackend

| EUnknownSrcExt String
| ENoSrcExt String
Expand Down Expand Up @@ -4410,6 +4411,10 @@ getErrorText (WNonDemotableErrors tags) =
in s2par ("Cannot demote the following error" ++ s ++ ":") $$
nest 2 (sepList (map text tags) comma))

getErrorText (WOFileWithVerilogBackend) =
(System 95, empty,
s2par ("The -o flag is incompatible with -verilog."))

-- Runtime errors
getErrorText (EMutuallyExclusiveRulesFire r1 r2) =
(Runtime 1, empty,
Expand Down
6 changes: 5 additions & 1 deletion src/comp/FlagsDecode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,11 @@ externalFlags = [
"maximum stack depth for fundep and SAT analysis in typecheck", Hidden)),

("o",
(Arg "name" (\f s -> Left (f {oFile = s})) (Just (FRTString oFile)),
(Arg "name"
(\f s -> if (backend f /= Just Verilog)
then Left (f {oFile = s})
else Right (cmdPosition, WOFileWithVerilogBackend))
(Just (FRTString oFile)),
"name of generated executable", Visible)),

("O",
Expand Down