SugarC: scalable desugaring of real-world preprocessor usage into pure C

SugarC: scalable desugaring of real-world preprocessor usage into pure C
复制标题

SugarC:将现实世界的预处理器使用可扩展地脱糖为纯 C

DOI:
10.1145/3510003.3512763
复制
发表时间:
2022
期刊:
ICSE '22: Proceedings of the 44th International Conference on Software Engineering
影响因子:
--
通讯作者:
Gazzillo, Paul
Gazzillo, Paul
中科院分区:
--
文献类型:
--
作者:
Patterson, Zachary;Zhang, Zenong;Pappas, Brent;Wei, Shiyi;Gazzillo, Paul

文献摘要

相似文献

可变性感知分析是保证可配置C软件质量的关键。大规模开发可变性感知分析的一个重要步骤是将使用C和预处理器的真实C软件转换为纯C代码,通过用C的运行时可变性替换预处理器的编译时可变性。在这项工作中,我们设计并实现了一个去糖工具,SugarC,转换远离现实世界的预处理器的使用。SugarC通过翻译规则增强了C的形式语法规范,在去糖过程中同时执行类型检查,并引入了许多优化来解决实际预处理器使用中出现的挑战。在DesugarBench(一个由108个手工创建的程序组成的基准测试)上的实验表明,SugarC比两个现有的去糖工具支持更多的语言功能。当应用于三个真实世界的可配置C软件时,SugarC在三个程序中的813个文件中去除了774个文件,在最坏的情况下最多花费10分钟,95%的C文件不到2分钟。
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.