Apparatus and method to compile a variadic template function

US10013244B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-10013244-B2
Application numberUS-201715485852-A
CountryUS
Kind codeB2
Filing dateApr 12, 2017
Priority dateMay 12, 2016
Publication dateJul 3, 2018
Grant dateJul 3, 2018

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

An apparatus duplicates a process code of a variadic template function that has a variable number of parameters in a source code, in association with each of actual arguments in an actual-argument list corresponding to a variadic parameter defined by a variadic operator that packs the variable number of parameters of the variadic template function. The apparatus substitutes another parameter in each duplicated process code with a prepared parameter that accepts the actual argument associated with the each duplicated process code. The apparatus firstly inserts, into a recursive call part in a process code of the variadic template function, a first duplicated process code that is associated with an actual argument at a head of the actual-argument list, and repeats inserting, into a recursive call part in the previously inserted duplicated process code, a next duplicated process code associated with a subsequent actual argument.

First claim

Opening claim text (preview).

What is claimed is: 1. An apparatus comprising a memory; and a processor coupled to the memory and configured to: duplicate a process code of a variadic template function that has a variable number of parameters included in a source code, in association with each of actual arguments included in an actual-argument list corresponding to a variadic parameter defined by a variadic operator that packs the variable number of parameters of the variadic template function; perform a substitution process including substituting, in each of the duplicated process codes, another parameter that is one of parameters of the variadic template function and different from the variadic parameter, with a prepared parameter that is prepared to accept an actual argument, in the actual-argument list, that is associated with the each duplicated process code; in a case where the another parameter in each process code becomes an actual argument of another function different from the variadic template function, execute a search process of searching for a first function which matches a type of the another parameter or a generation process of generating the first function, based on a template function included in the source code, and substitute a first code for calling the another function with a second code for calling the first function which is acquired through the search process or the generation process; and perform a function parameter-pack expansion process including: firstly inserting, into a recursive call part in a process code of the variadic template function, a first one of the duplicated process codes that is associated with an actual argument at a head of the actual-argument list, and repeating an insertion process of inserting, into a recursive call part in a previously inserted one of the duplicated process codes, a next one of the duplicated process codes associated with an actual argument that is subsequent, in the actual-argument list, to an actual argument associated with the previously inserted one of the duplicated codes. 2. The apparatus of claim 1 , wherein the source code includes a second function that includes no parameters and has a name identical to a name of the variadic template function, and the processor inserts a process code of the second function into a recursive call part of the duplicated process code associated with the actual argument at an end of the actual-argument list. 3. The apparatus of claim 1 , wherein the substitution process further includes substituting a character string for unpacking the variable number of parameters, included in each of the duplicated process codes, with a sequence of the prepared parameters which respectively accept the actual arguments that are positioned, in the actual-argument list, behind the actual argument associated with the each duplicated process code. 4. The apparatus of claim 3 , wherein the source code includes a second function that includes no parameters and has a name identical to a name of the variadic template function, and a third function that includes one parameter and has a name identical to the name of the variadic template function; and the processor inserts, into a recursive call part of the duplicated process code associated with the actual argument at an end of the actual-argument list, a process code of one of the second and third functions that is determined based on an actual argument of the recursive call part. 5. A method comprising: duplicating a process code of a variadic template function that has a variable number of parameters included in a source code, in association with each of actual arguments included in an actual-argument list corresponding to a variadic parameter defined by a variadic operator that packs the variable number of parameters of the variadic template function; performing a substitution process including substituting, in each of the duplicated process codes, another parameter that is one of parameters of the variadic template function and different from the variadic parameter, with a prepared parameter that is prepared to accept an actual argument, in the actual-argument list, that is associated with the each duplicated process code; in a case where the another parameter in each process code becomes an actual argument of another function different from the variadic template function, executing a search process of searching for a first function which matches a type of the another parameter or a generation process of generating the first function, based on a template function included in the source code, and substitute a first code for calling the another function with a second code for calling the first function which is acquired through the search process or the generation process; and performing a function parameter-pack expansion process including: firstly inserting, into a recursive call part in a process code of the variadic template function, a first one of the duplicated process codes that is associated with an actual argument at a head of the actual-argument list, and repeating an insertion process of inserting, into a recursive call part in a previously inserted one of the duplicated process codes, a next one of the duplicated process codes associated with an actual argument that is subsequent, in the actual-argument list, to an actual argument associated with the previously inserted one of the duplicated codes. 6. A non-transitory, computer-readable recording medium having stored therein a program causing a computer to perform a process comprising: duplicating a process code of a variadic template function that has a variable number of parameters included in a source code, in association with each of actual arguments included in an actual-argument list corresponding to a variadic parameter defined by a variadic operator that packs the variable number of parameters of the variadic template function; performing a substitution process including substituting, in each of the duplicated process codes, another parameter that is one of parameters of the variadic template function and different from the variadic parameter, with a prepared parameter that is prepared to accept an actual argument, in the actual-argument list, that is associated with the each duplicated process code; in a case where the another parameter in each process code becomes an actual argument of another function different from the variadic template function, executing a search process of searching for a first function which matches a type of the another parameter or a generation process of generating the first function, based on a template function included in the source code, and substitute a first code for calling the another function with a second code for calling the first function which is acquired through the search process or the generation process; and performing a function parameter-pack expansion process including: firstly inserting, into a recursive call part in a process code of the variadic template function, a first one of the duplicated process codes that is associated with an actual argument at a head of the actual-argument list, and repeating an insertion process of inserting, into a recursive call part in a previously inserted one of the duplicated process codes, a next one of the duplicated process codes associated with an actual argument that is subsequent, in the actual-argument list, to an actual argument associated with the previously inserted one of the duplicated codes.

Assignees

Inventors

Classifications

  • Reducing the execution time required by the program code · CPC title

  • Detection or removal of dead or redundant code · CPC title

  • G06F8/447Primary

    Target code generation · CPC title

  • G06F8/311Primary

    Functional or applicative languages; Rewrite languages · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US10013244B2 cover?
An apparatus duplicates a process code of a variadic template function that has a variable number of parameters in a source code, in association with each of actual arguments in an actual-argument list corresponding to a variadic parameter defined by a variadic operator that packs the variable number of parameters of the variadic template function. The apparatus substitutes another parameter in…
Who is the assignee on this patent?
Fujitsu Ltd
What technology area does this patent fall under?
Primary CPC classification G06F8/447. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Jul 03 2018 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).