paperbot · PL 论文追踪

全部论文 待读 收藏

P2 SugarC

SugarC:将真实世界 C 预处理器去糖为纯 C
ICSE Proceedings of the 44th International Conference on Software Engineering2022匹配度 3/10 · 该论文属于程序变换/预处理器去糖与可配置C软件分析,涉及形式语法、类型检查、真实代码与基准,与用户对“兼具理论与工程实现”和“工业落地”的偏好有边缘契合;但它不涉及LLM/Agent、ML系统、浮点程序分析或贝叶斯程序分析,核心研究方向没有直接交集。引用 36 inbox
Zachary Patterson, Zenong Zhang, Brent Pappas, Shiyi Wei, Paul Gazzillo
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:设计并实现 SugarC,将真实 C 预处理器的编译期可变性去糖为纯 C 的运行时可变性,并同步类型检查。

可配置 C 软件广泛使用预处理器表达编译期可变性,这给变异性感知分析带来挑战。SugarC 的目标是把同时使用 C 与预处理器的真实代码转换为纯 C,用运行时可变性替代预处理器的编译期可变性。该工具在 C 形式语法规范上增加翻译规则,在去糖过程中同步做类型检查,并针对真实预处理器用法引入多项优化。作者构建了含 108 个人工程序的 DesugarBench 进行评测,显示 SugarC 比两个已有去糖工具支持更多语言特性;在三个真实可配置 C 软件上,它在 813 个文件中成功去糖 774 个,最坏耗时约十分钟,95% 的 C 文件在两分钟内完成。

问题
可配置 C 软件中预处理器的编译期可变性使变异性感知分析难以规模化,而真实预处理器用法复杂,直接分析混合 C/preprocessor 代码很困难。
方法
SugarC 在 C 形式语法上增加翻译规则,在去糖过程中同时进行类型检查,并引入多种优化来处理真实世界预处理器用法。
评估
在含 108 个人工程序的 DesugarBench 上与两个现有去糖工具比较,并在三个真实可配置 C 软件上测试;SugarC 支持更多语言特性,且能去糖 813 个文件中的 774 个,最差约十分钟,95% 文件少于两分钟。
原文摘要(Abstract)

Variability-aware analysis is critical for ensuring the quality of configurable C software. An important step toward the development of variability-aware analysis at scale is to transform real-world C software that uses both C and preprocessor into pure C code, by replacing the preprocessor's compile-time variability with C's runtime-variability. In this work, we design and implement a desugaring tool, SugarC, that transforms away real-world preprocessor usage. SugarC augments C's formal grammar specification with translation rules, performs simultaneous type checking during desugaring, and introduces numerous optimizations to address challenges that appear in real-world preprocessor usage. The experiments on DesugarBench, a benchmark consisting of 108 manually-created programs, show that SugarC supports many more language features than two existing desugaring tools. When applied on three real-world configurable C software, SugarC desugared 774 out of 813 files in the three programs, taking at most ten minutes in the worst case and less than two minutes for 95% of the C files.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{PattersonZPWG22,
  title = {SugarC},
  author = {Zachary Patterson and Zenong Zhang and Brent Pappas and Shiyi Wei and Paul Gazzillo},
  booktitle = {ICSE},
  year = {2022},
  doi = {10.1145/3510003.3512763}
}