IP Library › Granted Patent US 10,521,203
Granted Patent B2
US 10,521,203 · App. 15/909,951 · Granted Dec 31, 2019

Apparatus and method to facilitate extraction of unused symbols in a program source code

Inventor: Yuki Kawaguchi (Numadu, JP)
Assignee: FUJITSU LIMITED
G06F8/433G06F8/425G06F8/443G06F8/54G06F8/72
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,521,203
App. No.
15/909,951
Granted
Dec 31, 2019
Kind
B2
Abstract

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.

Claims (30)

1. A non-transitory, computer-readable recording medium having stored therein a compiler program that causes a computer to execute a process comprising:

in response to receiving a compilation command, performing a compilation process on a first source file including first attribute information that is added to a first symbol in the first source file, and using the first attribute information being used for the compilation process to output a notification indicating a warning about use of the first symbol;

generating a second source file by adding second attribute information to a second symbol in the first source file, and using the second attribute information in the compilation process to output use information indicating whether the second symbol is used in a process described in the first source file;

performing the compilation process on the second source file and recording the use information that has been outputted in a memory in association with the second symbol;

in response to the use information corresponding to the second symbol recorded in the memory indicating that the second symbol is not used, determining that the second symbol is an unused symbol which is not used in a process described in the first source file; and

outputting information of the unused symbol to a display device.

2. The non-transitory, computer-readable recording medium of claim 1 , wherein

the source code is divided into plural source files, and

in the determining of the unused symbol, each of the plural source files is individually compiled, plural output results of the information are acquired for the plural source files, and the unused symbol is decided based on the plural output results.

3. The non-transitory, computer-readable recording medium of claim 2 , wherein

a first output result of the information on a first source file is added to a first object file that is generated from the first source file,

a second output result of the information on a second source file is added to a second object file that is generated from the second source file, and

in the determining of the unused symbol, in a linking process that uses the first and second object files, the unused symbol is decided based on the first and second output results.

4. The non-transitory, computer-readable recording medium of claim 1 , wherein the process further comprising setting the unused symbol as a non-target of compilation based on the information.

5. The non-transitory, computer-readable recording medium of claim 1 , wherein

a deprecated attribute is used as the first attribute information and the second attribute information.

6. An apparatus comprising:

a memory; and

a processor coupled to the memory and configured to:

in response to receiving a compilation command, perform a compilation process on a first source file including first attribute information that is added to a first symbol in the first source file, and use the first attribute information being used for the compilation process to output a notification indicating a warning about use of the first symbol;

generate a second source file by adding second attribute information to a second symbol in the first source file, and use the second attribute information in the compilation process to output use information indicating whether the second symbol is used in a process described in the first source file;

perform the compilation process on the second source file and record the use information that has been outputted in a memory in association with the second symbol;

in response to the use information corresponding to the second symbol recorded in the memory indicating that the second symbol is not used, determine that the second symbol is an unused symbol which is not used in a process described in the first source file; and

output information of the unused symbol to a display device.

7. A method comprising:

in response to receiving a compilation command, performing a compilation process on a first source file including first attribute information that is added to a first symbol in the first source file, and using the first attribute information being used for the compilation process to output a notification indicating a warning about use of the first symbol;

generating a second source file by adding second attribute information to a second symbol in the source file, and using the second attribute information in the compilation process to output use information indicating whether the second symbol is used in a process described in the first source file;

performing the compilation process on the second source file and recording the use information that has been outputted in a memory in association with the second symbol;

in response to the use information corresponding to the second symbol recorded in the memory indicating that the second symbol is not used, determining that the second symbol is an unused symbol which is not used in a process described in the first source file; and

outputting information of the unused symbol to a display device.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 2, 2018
From: KAWAGUCHI, YUKI
To: FUJITSU LIMITED
Reel/Frame 045089/0862 →
Priority Claims (1)
JP 2017-049926 · Mar 15, 2017 · national
Continuity (1)
Related Publication 20180267783A1 · Sep 20, 2018