Incremental Analysis IR Object Mapping via Line Number Mediation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing incremental analysis tools face challenges in reusing analysis information for unchanged intermediate representation (IR) objects across different program versions due to changing IDs, leading to obstacles in mapping and ensuring correctness of the analysis information.
Innovation Solution
A method and system for mapping IR objects using line number-based and ID-based mappings, leveraging attributes like line number, object type, and name to match unchanged IR objects across versions, ensuring accurate and efficient reuse of analysis information.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If incremental analysis tools reuse analysis information for unchanged IR objects across versions, then analysis efficiency is improved, but the changing IDs of IR objects create obstacles to retrieving corresponding analysis information
Solution Approach 1:
The patent introduces a mapping mechanism that acts as an intermediary between the old ID and new ID of unchanged IR objects. This mapping stores the correspondence relationship, allowing the analysis tool to retrieve analysis information using the new ID while actually accessing data associated with the old ID. The mapping serves as a mediator that resolves the ID change problem without sacrificing either efficiency or correctness.
Solution Approach 2:
The patent performs preliminary actions by pre-computing and storing the mapping between old IDs and new IDs of IR objects before the actual incremental analysis begins. This preliminary mapping creation enables the analysis tool to efficiently retrieve analysis information during the incremental analysis process without having to deal with ID changes dynamically, thus maintaining both efficiency and correctness.
2Measurement precision
If ID-based mapping is used to match unchanged IR objects across versions, then mapping accuracy is improved, but the system complexity increases due to maintaining mapping information
Solution Approach 1:
The patent creates a simplified copy or representation of the ID mapping relationship in a dedicated data structure. Instead of maintaining complex mapping logic throughout the system, the mapping information is copied into a separate, easily manageable structure that can be queried efficiently. This copying approach maintains mapping accuracy while reducing system complexity by localizing the mapping management.
3Stability of the object's composition
If line number-based mapping is used to identify unchanged IR objects, then mapping robustness is improved, but the precision of object identification decreases due to line number changes
Solution Approach 1:
The patent merges two mapping approaches: line number-based mapping and ID-based mapping. By combining these two mechanisms, the system leverages the robustness of line number mapping (which remains stable for unchanged code) and the precision of ID mapping (which uniquely identifies objects). The combined approach resolves the limitation of using either method alone, achieving both robustness and precision in identifying unchanged IR objects.
Data Source
Figure 1~2
Figure 3
Figure 4
AI summary
For performing incremental analysis, analysis tools may reuse analysis information computed earlier for intermediate representation (IR) objects that remain unchanged between versions of program. But identification numbers (IDs) of unchanged IR objects change over versions due to changes with each run of incremental analysis, thereby making it difficult to reuse analysis information as tools require IDs of unchanged IR objects from previous versions. Present disclosure provides method and system for mapping IR objects for facilitating incremental analysis. The system first extracts attributes associated with each IR object present in previous version to create data structure for storing IR objects. The system then determines unchanged lines between versions to create line number map. Thereafter, system uses line number map to create ID-based IR mapping between ID of each unchanged IR object present in each unchanged line in current version and ID of each IR object stored in data structure.