Patent ID: 9619215
Date: 2017-04-11
CPC Classifications: G06F

Claim:
1. A method for reducing a compile time of a source program, the method comprising: receiving, by a compiler hosted on a computer, the source program; analyzing the source program to construct an Abstract Syntax Tree (AST) representation of the source program before compilation, wherein the nodes of the AST represent one or more of language constructs, statements, expressions, types, and function definitions of the source program; traversing the AST node-by-node to identify splitting points and define splitting regions of a source function in the AST of the source program in a single pass of the AST; identifying a defined splitting region as a candidate splitting region of the source function in the AST of the source program before compilation, wherein identifying the defined splitting region as the candidate splitting region includes determining a complexity of the defined splitting region, assessing an impact of the complexity of the defined splitting region on reducing compile time of the source program and identifying the defined splitting region as the candidate splitting region only if the complexity of the defined splitting region is less than an upper splitting region complexity level and only if an overhead associated with a target function does not negate a goal of reducing compile time of the source program, wherein a complexity measure is a count of lines of code in the defined splitting region or a weighted count of nodes in the defined splitting region; extracting the candidate splitting region of the source function before compilation to form the target function; transforming the AST of the source program before compilation by inserting nodes corresponding to the target function in the AST; and using the transformed AST to generate a machine-executable target program.