Skip to content

clang: Report CPU time used, use stdin/stdout to avoid temp files - #49

Merged
arthurfabre merged 2 commits into
masterfrom
afabre/clang
Aug 5, 2026
Merged

clang: Report CPU time used, use stdin/stdout to avoid temp files#49
arthurfabre merged 2 commits into
masterfrom
afabre/clang

Conversation

@arthurfabre

Copy link
Copy Markdown
Collaborator

This PR contains two changes to the clang package:

  1. A new CompileRes() method that returns a struct (so we could extend it in the future) with the total CPU time used by clang.
  2. Avoiding temporary files by using stdin / stdout, which is simpler (no need to create and clean up directories) and should be faster.

Expose the total system plus userspace time used by clang, to allow
users to monitor how much of their CPU use can be attributed to clang.

Add a new CompileRes() API to avoid breaking existing users.
If the opts.Output directory isn't set, use stdin to pass the source to
clang, and read the ELF from stdout.

This avoids needing to write to temporary files.
@arthurfabre
arthurfabre requested review from andsten and lmtcf August 4, 2026 16:00
@arthurfabre
arthurfabre merged commit 7ac485f into master Aug 5, 2026
10 checks passed
@arthurfabre
arthurfabre deleted the afabre/clang branch August 5, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants