Sean McDirmid and Wilson C. Hsieh
This paper describes Splice, a system for writing aspects that perform static program analyses to direct program modiﬁcations. The power of an inter-procedural data-ﬂow analysis enables an aspect to examine the ﬂow of data around a program execution point when it determines what code to add or change at that point. For example, an aspect can change the target set of an iteration based on how elements are skipped during the iteration. Splice aspects are written in a rule-based logic programming language with features that help aspect programmers express analyses. We show how a prototype of Splice is used to write two useful aspects in the areas of domain-speciﬁc optimization and synchronization.