Compiler Unused Symbol Extraction via Attribute Warnings

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for identifying unused symbols in source code are inefficient, as they require separate functions to search for symbol definitions and references, making it difficult to implement an extraction function for unused symbols effectively.

Innovation Solution

A compiler is enhanced with a function that adds attribute information to symbols in the source code to output warnings about non-recommended usage, allowing for the identification of unused symbols by determining whether a warning is output during compilation, thereby facilitating the extraction of unused symbols without a separate routine.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If separate functions are used to search for symbol definitions and references, then comprehensive symbol analysis can be achieved, but the complexity of the system increases and efficiency decreases

Engineering Contradiction:
Improvesymbol analysis accuracyVSAvoidsystem complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent combines multiple separate functions (symbol definition search, reference search, and unused symbol extraction) into a single integrated compiler function. The compiler simultaneously performs all these operations during the normal compilation process, eliminating the need for separate analysis routines and reducing system complexity while maintaining comprehensive symbol analysis capability.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The compiler is enhanced with multi-functionality to perform not only its traditional compilation tasks but also symbol definition searching, reference searching, and unused symbol extraction. This universal approach allows a single system to handle multiple functions that were previously required separate dedicated tools.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Measurement precision

If separate routines are implemented for extracting unused symbols, then thorough code analysis can be performed, but the time and effort required increases

Engineering Contradiction:
Improveunused symbol detection accuracyVSAvoidextraction time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent merges the unused symbol extraction process with the normal compilation process. The compiler performs symbol definition and reference tracking as part of its standard operation, and identifies unused symbols simultaneously without requiring a separate analysis pass, thereby eliminating additional time consumption.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The compiler performs preliminary tracking of symbol definitions and references during the compilation process itself, before the compilation is complete. This preliminary action allows unused symbols to be identified without requiring post-compilation analysis, saving time by doing the work in advance as part of the normal flow.

Inventive Principle:
Principle #10Preliminary action

3Ease of operation

If attribute information is added to all symbols, then unused symbols can be identified through warning absence, but the amount of information to be processed increases

Engineering Contradiction:
Improveextraction easeVSAvoidinformation quantity
Core Design Contradiction:
Ease of operationVSQuantity of substance

Solution Approach 1:

The patent extracts only the essential attribute information needed for unused symbol identification (definition status and reference status) from the full set of possible symbol attributes. By selecting and processing only these specific attributes, the system reduces the information quantity to be processed while maintaining the ease of identifying unused symbols through warning absence.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS10521203B2Apparatus and method to facilitate extraction of unused symbols in a program source code
Publication Date: 2019.12.31 FUJITSU LTD
  • US10521203B2 patent drawing
  • US10521203B2 patent drawing
  • US10521203B2 patent drawing

AI summary

An apparatus adds attribute information that is used for outputting a warning that use of a symbol is non-recommended to the symbol that is included in a source code. The apparatus determines whether or not the warning corresponding to the attribute information is output for the symbol in compilation of the source code, determines that the symbol is an unused symbol which is not used in a process which is described in the source code in a case where the warning is not output, and outputs information of the unused symbol.