Skip to content

Driver doesn't resemble cc #194

@remexre

Description

@remexre

@willcro needs to be able to use ableC as a drop-in replacement for $CC, and in general it'd be nice if people could do this, at least for the flags that autotools, cmake, meson, etc. require to function. I suspect this isn't much more than what's in POSIX in terms of argument parsing.

The existing argument parsing is kind of terrible; we can't even handle ableC.sh -o main main.c at the moment! It looks like this might've gotten started as edu:umn:cs:melt:ableC:drivers:compile; but this looks to be a copy of parseAndPrint with an extra comment at the top at the moment?

I think the plan forward looks something like:

  • Parse the arguments specified in POSIX for c99, plus -x (and --, which isn't specified here but we ought to support)
  • For any specified file with a .xc extension not specified after a -x flag, or specified after -x xc, parseAndPrint it to a temporary .c file
  • Invoke ${ABLEC_BACKEND_CC:-clang} with the remainder of the arguments, with the .c files substituted for the .xc files, and -x c substituted for -x xc.

@krame505, any chance this is something you'd have time for in the next week or so? I'm pretty swamped at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions