CN109614106B - C + + program compiling method and device - Google Patents
C + + program compiling method and device Download PDFInfo
- Publication number
- CN109614106B CN109614106B CN201811569117.6A CN201811569117A CN109614106B CN 109614106 B CN109614106 B CN 109614106B CN 201811569117 A CN201811569117 A CN 201811569117A CN 109614106 B CN109614106 B CN 109614106B
- Authority
- CN
- China
- Prior art keywords
- cpp
- file
- node
- compiling
- abstract syntax
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Devices For Executing Special Programs (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a C + + program compiling method which comprises the steps of obtaining a plurality of cpp files, carrying out merging algorithm processing on the cpp files to generate a target cpp file to be compiled, and compiling the target cpp file. The method avoids the compiling process that each cpp file needs to be subjected to independent preprocessing, compiling, assembling and target link generation when a large number of cpp files are compiled, and directly carries out unified compiling on the combined cpp files, thereby saving various system resources, a large amount of time overhead and system overhead, accelerating the compiling process of the C + + program and improving the performance of the system.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a C + + program compiling method and device.
Background
Compiling the C + + file is typically done using a compiler, such as a C + + compiler using a clone, gcc, etc. When compiling a plurality of C + + files, such as 2000 or more files, the existing compiler compiles the C + + files one by one, which consumes a lot of time. When a C + + compiler compiles a file, a process is started every time a file is compiled, and a large amount of time overhead and system overhead are generated when various system resources are loaded.
At present, a large amount of C + + files are compiled, mainly by using a distributed compiling technology, the C + + files are sent to different machines for compiling, and finally, result integration is returned. This approach requires support from third-party distributed software and consumes a large amount of hardware, such as compiling more than 2000 files and at least 10 machines to increase the speed of compilation.
Therefore, on the premise of saving hardware compiling environment and compiling time overhead as much as possible, improving the compiling speed of the C + + file is a technical problem which needs to be solved urgently at present.
Disclosure of Invention
In order to improve the compiling speed of the C + + file, the invention provides a C + + program compiling acceleration method, which aims to solve the problem of improving the compiling speed of the C + + file on the premise of saving hardware compiling environment and compiling time overhead as much as possible. According to the method, a large number of C + + files are combined into one file by adopting a combination compiling mode, and then the combined file is compiled, so that system resources only need to be loaded once, the C + + files are compiled in a centralized manner, and the compiling time can be greatly shortened.
The specific technical scheme of the method is as follows:
a C + + program compiling method, comprising:
acquiring a plurality of cpp files;
carrying out merging algorithm processing on the cpp files to generate a target cpp file to be compiled;
compiling the target cpp file.
Further, the method comprises the following steps of carrying out merging algorithm processing on the cpp file and before generating a target cpp file to be compiled:
generating an abstract syntax tree for each cpp file;
and judging whether the abstract syntax trees comprise the same internal variables and/or functions.
Further, if the abstract syntax trees do not contain the same internal variables and/or functions, merging algorithm processing is carried out on the cpp files to generate a target cpp file to be compiled.
Further, the method may further comprise,
if the abstract syntax trees comprise the same internal variables and/or functions, generating error information;
modifying the error information;
the error information comprises a file name, an internal variable name and/or a function name of a file corresponding to an abstract object tree with the same internal variable and/or function, and a line number of a file where the internal variable name and/or the function name are located.
Further, the merging algorithm process comprises the following steps:
calling the cpp file by using an include pseudo-instruction;
and adding the called cpp file to a pre-set cpp file to generate a target cpp file to be compiled.
Further, judging whether the abstract syntax trees include the same internal variables and/or functions, specifically including the following steps:
acquiring node information of the abstract syntax tree;
traversing the node information and judging whether the node information meets preset judgment conditions or not;
and if the preset judgment condition is met, judging that the abstract syntax trees comprise the same internal variables and/or functions.
The invention also provides a C + + program compiling device, which is characterized by comprising,
the acquisition module is used for acquiring a plurality of cpp files;
the merging algorithm processing module is used for performing merging algorithm processing on the acquired cpp files and generating target cpp files to be compiled;
and the compiling module is used for compiling the target cpp file.
Further, the merging algorithm processing module further includes:
the abstract syntax tree generating module is used for generating an abstract syntax tree for each cpp file;
the judging module is used for judging whether the abstract syntax trees comprise the same internal variables and/or functions;
generating error information, wherein the error information is generated when the abstract syntax trees are judged to include the same internal variables and/or functions;
and the error modification module is used for modifying the error information and generating a new abstract syntax tree.
Further, the merging algorithm processing module further comprises,
an include pseudo-instruction calling module, configured to call the cpp file;
and the cpp file adding module is used for adding the cpp file to a pre-set cpp file to generate a target cpp file to be compiled.
Further, the judging module further comprises,
the node information acquisition module is used for acquiring node information in the abstract syntax tree;
the node information judging module is used for traversing the node information and judging whether the node information meets preset judging conditions or not; and if the preset judgment condition is met, judging that the abstract syntax trees comprise the same internal variables and/or functions.
The invention provides a C + + program compiling method, which adopts a specific method to merge a large number of cpp files into a target cpp file to be compiled, namely, a plurality of cpp files are obtained first, then the cpp files are merged by an algorithm to generate the target cpp file to be compiled, and finally the merged target cpp file is compiled, so that the method avoids the need of performing separate processes of preprocessing, compiling, assembling and generating target links on each cpp file when the large number of cpp files are compiled, and directly performs the processes of uniform preprocessing, compiling, assembling and generating target links on the merged cpp files to complete the compiling process of a C + + program, and the system process is changed from a plurality of cpp file compiling processes into a one-time C + + program compiling process, thereby saving various system resources, a large amount of time overhead and system overhead, the compiling process of the C + + program is accelerated, and the system performance is improved.
Further, before the cpp files are subjected to merging algorithm processing to generate the target cpp files to be compiled, the method generates abstract syntax trees for each cpp file, wherein the abstract syntax trees comprise a large amount of node information such as internal variables and internal functions, judges the information such as the internal variables and the internal functions in each abstract syntax tree, and judges whether the abstract syntax trees comprise the same internal variables and/or functions. Before the target cpp files to be compiled are generated, a large number of internal variables and functions contained in the cpp files are analyzed and judged, and the problem that when the target cpp files are generated later, C + + is generated in the compiling process or syntax errors occur in compiling due to the fact that the same internal variables and functions exist among the cpp files, and the C + + program needs to be repeatedly modified and compiled, so that compiling efficiency is reduced is solved.
Furthermore, the invention directly adopts include pseudo-instruction to call the cpp file, adds the called cpp file to the pre-set cpp file, generates the target cpp file to be compiled, and adopts the simplest pseudo-instruction calling method while the program performance is well optimized, the function is easy to realize, the program is simple, and the effect better than the prior art can be realized.
The invention also provides a C + + program compiling device, which comprises an acquisition module, a compiling module and a compiling module, wherein the acquisition module is used for acquiring a plurality of cpp files; the merging algorithm processing module is used for performing merging algorithm processing on the acquired cpp files and generating target cpp files to be compiled; and the compiling module is used for compiling the target cpp file. The device acquires a plurality of cpp files through the acquisition module, the merging algorithm processing module merges the acquired cpp files and generates a target cpp file to be compiled, and the compiling module compiles the generated target cpp file, so that the problem that when a large number of cpp files are compiled, each cpp file needs to be subjected to a process of independent preprocessing, compiling, assembling and generating target links is avoided, a large number of cpp files are directly merged, and the merged algorithm is directly subjected to a process of unified preprocessing, compiling, assembling and generating target links, so that the compiling process of a C + + program is completed, various system resources, a large amount of time overhead and system overhead are saved, the compiling process of the C + + program is accelerated, and the performance of the system is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present invention, and it is obvious for those skilled in the art to obtain other drawings according to these drawings.
FIG. 1 is a flowchart illustrating a C + + program compiling method according to the present invention;
FIG. 2 is a diagram illustrating a C + + program compiling method according to a preferred embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a C + + program compiling apparatus according to the present invention;
fig. 4 is a schematic diagram of a preferred structure of a C + + program compiling apparatus according to the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
Referring to fig. 1, a schematic flow chart of a C + + program compiling method according to the present invention is shown, where the schematic flow chart includes the following steps:
s1, acquiring a plurality of cpp files;
s2, carrying out merging algorithm processing on the cpp files to generate a target cpp file to be compiled;
s3, compiling the target cpp file.
In step S1, multiple cpp files are obtained, the present invention loads a pre-established C + + development project by opening a compilation system, and when the compilation system runs a program, it uses a file traversal system function readdir to perform recursive traversal on a directory in the pre-established C + + development project, searches for a file with cpp as a suffix name, obtains the multiple cpp files, and stores the obtained file name representing the cpp file into a preset variable, for example, the variable name is files, and the type of the variable is vector < string >.
In step S2, the multiple cpp files obtained may be processed directly by using a merge algorithm to generate a target cpp file to be compiled. It should be noted that the merging algorithm process of the present invention may be to edit multiple cpp files into a preset file manually, and use the file as a target cpp file to be compiled. Preferably, the invention calls the plurality of acquired cpp files by adopting a pseudo instruction include, and then adds the called cpp files to the pre-set cpp files to generate the target cpp files to be compiled.
In the above step S3, the target cpp file is compiled. In the present invention, the generated target cpp file is compiled on a claspg compilation platform.
The invention provides a C + + program compiling method, which adopts a specific method to merge a large number of cpp files into a target cpp file to be compiled, namely, a plurality of cpp files are obtained first, then the cpp files are merged by an algorithm to generate the target cpp file to be compiled, and finally the merged target cpp file is compiled, so that the method avoids the need of performing separate processes of preprocessing, compiling, assembling and generating target links on each cpp file when the large number of cpp files are compiled, and directly performs the processes of uniform preprocessing, compiling, assembling and generating target links on the merged cpp files to complete the compiling process of a C + + program, and the system process is changed from a plurality of cpp file compiling processes into a one-time C + + program compiling process, thereby saving various system resources, a large amount of time overhead and system overhead, the compiling process of the C + + program is accelerated, and the system performance is improved.
Referring to fig. 2, a preferred embodiment of the C + + program compiling method according to the present invention is shown.
The method comprises the following steps:
l1: acquiring a plurality of cpp files;
l2: generating an abstract syntax tree for each cpp file to obtain internal variables and functions;
l3: judging whether the abstract syntax trees comprise the same internal variables and/or functions;
l4: if the abstract syntax trees do not comprise the same internal variables and/or functions, merging the cpp files to generate a target cpp file to be compiled;
l5: compiling the target cpp file.
Step L1: the invention loads the pre-established C + + project by opening the compiling system, when the compiling system runs the program, uses the file traversal system function readdir to carry out recursion traversal on the directory in the pre-established C + + development project, searches the file with cpp as the suffix name, obtains a plurality of cpp files, and stores the obtained file name for representing the file into the pre-set variable, for example, the variable name is fileexists, and the variable type is vector < string >.
Step L2: after acquiring a plurality of cpp files, firstly constructing a global variable which is used for storing names of variables or functions; and then introducing a clang SDK, calling an abstract syntax tree function clang _ pars transformation unit integrated in the clang SDK to perform algorithm processing on the acquired cpp file, and generating an abstract syntax tree. It should be noted that the abstract syntax tree is a tree representation of the abstract syntax structure of the source code, and there are many nodes on the tree, each of which represents a structure in the source code and contains internal variables and internal functions.
Step L3: judging whether the abstract syntax trees comprise the same internal variables and/or functions; and traversing the generated plurality of abstract syntax trees, searching internal variables and functions in the abstract syntax trees, and recording the names of the internal variables and the functions. The specific process is as follows:
if the C + + abstract syntax tree is successfully generated, calling a clone _ getTranslationsUnitCursor method to obtain a traversal cursor of the abstract syntax tree; calling a function of clone _ visitChildren traverses each node of the syntax tree by using cursor, calling a clone _ getCursorKind function for each node, acquiring a node type nodeb, calling clone _ getCursorLinkage to acquire a node link type nodelinktype, and if nodeb is CXCursor _ FunctionDecl or CXCursor _ VarDecl, nodelinktype is CXLinkage _ Internal. We consider the node to be an internal variable or an internal function. If the node is found to be an internal variable or an internal function, calling a method of clipping _ getCursorSpelling to acquire the name of the node, namely the name of the variable or the method, namely VariableOrMethodName, then calling a method of clipping _ getCursorLocation to acquire the position information of the node, and then acquiring the cppFilleName, the Row number Row and the Column number Column of the file where the node is located by using the clipping _ getExpansionLocation and the clipping _ getFileName methods. We store this information into the variable m _ variables, with VariableOrMethodName as the key, cpp filename as the child key, and the values of the row and column numbers, namely:
m_variables[VariableOrMethodName][CppFileName]=“Row Column”
and traversing m _ variables, and if the number of each key value of the m _ variables is more than 1, indicating that the variable or function name appears repeatedly. That is, when variable element. size () > 1 is judged, it is described that the same internal variable or function name appears. If the situation is larger than 1, the variable element is traversed, and each key value output is printed, wherein the key is the cpp file name CppFileName, and the values are the row number row and the column number column.
In summary, node information of the abstract syntax tree is obtained, where the node information includes functions and internal variables; traversing the node information and judging whether the node information meets the preset judgment condition, if so, judging that the abstract syntax trees comprise the same internal variables and/or functions.
L4: if the abstract syntax trees do not comprise the same internal variables and/or functions, merging the cpp files to generate a target cpp file to be compiled;
l5: compiling the target cpp file. In the present invention, the generated target cpp file is compiled on a claspg compilation platform.
It should be noted that the present invention further includes a step L4,If the abstract syntax trees comprise the same internal variables and/or functions, generating error information; modifying error information until the same internal variables and/or functions between the abstract syntax trees do not appear again when the same judgment is carried out on the internal variables and/or functions between the abstract syntax trees, merging a plurality of cpp files by calling include pseudo instructions into one cpp file, taking the cpp file as a target cpp file, and compiling the merged target cpp file; the error information comprises a file name, an internal variable name and/or a function name of a file corresponding to an abstract object tree with the same internal variable and/or function, and a line number of a file where the internal variable name and/or the function name are located.
The invention provides a C + + program compiling method, which is characterized in that a large number of cpp files are combined into a target cpp file to be compiled by adopting a specific method, namely, a plurality of cpp files are obtained, then each cpp file generates an abstract syntax tree, the abstract syntax tree comprises a large number of node information such as internal variables and internal functions, the information such as the internal variables and the internal functions in each abstract syntax tree is judged, and whether the abstract syntax trees comprise the same internal variables and/or functions is judged. If the abstract syntax trees do not comprise the same internal variables and/or functions, merging the cpp files to generate a target cpp file to be compiled; and finally, compiling the merged target cpp file to complete the compiling of the C + + program. Before the target cpp files to be compiled are generated, a large number of internal variables and functions contained in the cpp files are analyzed and judged, and the problem that when the target cpp files are generated later, C + + is generated in the compiling process or syntax errors occur in compiling due to the fact that the same internal variables and functions exist among the cpp files, and the C + + program needs to be repeatedly modified and compiled, so that compiling efficiency is reduced is solved. Meanwhile, the method for merging the cpp files to generate the target cpp file to be compiled and compiling the merged target cpp file finally avoids the process of carrying out independent preprocessing, compiling, assembling and target link generation on each cpp file when a large number of cpp files are compiled, and directly carrying out unified preprocessing, compiling, assembling and target link generation on the merged cpp files to complete the compiling process of the C + + program, and the system process is changed from a plurality of cpp file compiling processes to a one-time C + + program compiling process, so that various system resources, a large amount of time overhead and system overhead are saved, the C + + program compiling process is accelerated, and the system performance is improved.
Furthermore, the invention directly adopts include pseudo-instruction to call the cpp file, adds the called cpp file to the pre-set cpp file, generates the target cpp file to be compiled, and adopts the simplest pseudo-instruction calling method while the program performance is well optimized, the function is easy to realize, the program is simple, and the effect better than the prior art can be realized.
Referring to fig. 3, the present invention further provides a C + + program compiling apparatus, which includes an obtaining module, configured to obtain a plurality of cpp files; the merging algorithm processing module is used for performing merging algorithm processing on the acquired cpp files and generating target cpp files to be compiled; and the compiling module is used for compiling the target cpp file.
The invention loads the pre-established C + + development project by opening the compiling system, when the compiling system runs the program, the obtaining module of the device obtains a plurality of cpp files, calls the file traversal system function readdir, carries out recursive traversal on the directory in the pre-established C + + development project, searches the file with the cpp as the suffix name, obtains the plurality of cpp files, and stores the obtained file name for representing the cpp file into the preset variable, for example, the variable name is files, and the type of the variable is vector < string >. The merging algorithm processing module can directly adopt merging algorithm processing to the plurality of cpp files to generate target cpp files to be compiled. It should be noted that, the merging algorithm processing module of the present invention may edit a plurality of cpp files into a preset file manually, and use the file as a target cpp file to be compiled. Preferably, the invention calls the plurality of cpp files acquired by adopting a pseudo instruction include, and then adds the called cpp files to the cpp files which are preset to generate the target files to be compiled. And finally, compiling the generated target cpp file by a compiling module on a clang compiling platform.
Referring to fig. 4, a preferred embodiment of the C + + program compiling apparatus according to the present invention is shown. The device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a plurality of cpp files; the merging algorithm processing module is used for performing merging algorithm processing on the acquired cpp files and generating target cpp files to be compiled; and the compiling module is used for compiling the target cpp file.
The device acquires a plurality of cpp files through the acquisition module, the merging algorithm processing module merges the acquired cpp files and generates a target cpp file to be compiled, and the compiling module compiles the generated target cpp file, so that the problem that when a large number of cpp files are compiled, each cpp file needs to be subjected to a process of independent preprocessing, compiling, assembling and generating target links is avoided, a large number of cpp files are directly merged, and the merged algorithm is directly subjected to a process of unified preprocessing, compiling, assembling and generating target links, so that the compiling process of a C + + program is completed, various system resources, a large amount of time overhead and system overhead are saved, the compiling process of the C + + program is accelerated, and the performance of the system is improved.
Further, the merging algorithm processing module further includes:
the abstract syntax tree generating module is used for generating an abstract syntax tree for each cpp file; the judging module is used for judging whether the abstract syntax trees comprise the same internal variables and/or functions; generating error information, wherein the error information is generated when the abstract syntax trees are judged to include the same internal variables and/or functions; and the error modification module is used for modifying the error information and generating a new abstract syntax tree. The merging algorithm processing module also comprises an include pseudo-instruction calling module which is used for calling the acquired cpp file; and the cpp file adding module is used for adding the cpp file to a pre-set cpp file to generate a target cpp file to be compiled. The judging module also comprises a judging module for judging whether the current time is less than or equal to a preset time,
the node information acquisition module is used for acquiring node information in the abstract syntax tree; and the node information judging module is used for judging the node information.
As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by software plus a general hardware platform. With this understanding, the technical solution of the present invention can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM)/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network communication device such as a router, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present invention.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described embodiments of the apparatus system are merely illustrative, and the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only for the preferred embodiment of the present invention and is not intended to limit the scope of the present invention. It should be noted that, for a person skilled in the art, several modifications and refinements can be made without departing from the invention, and these modifications and refinements should be regarded as the protection scope of the present invention.
Claims (4)
1. A C + + program compiling method, comprising:
acquiring a plurality of cpp files;
carrying out merging algorithm processing on the cpp files to generate a target cpp file to be compiled; the merging algorithm process comprises the following steps: calling the cpp file by using an include pseudo-instruction; adding the called cpp file to a pre-set cpp file to generate a target cpp file to be compiled;
compiling the target cpp file;
carrying out merging algorithm processing on the cpp file, and before generating a target cpp file to be compiled, the method comprises the following steps:
generating an abstract syntax tree for each cpp file; judging whether the abstract syntax trees comprise the same internal variables and/or functions, specifically comprising the following steps: obtaining node information of an abstract syntax tree, wherein the node information comprises: the method comprises the following steps of (1) node type, node link type, node name, node position information, file name, line number and column number of a cpp (common program) file where the node is located; traversing the node information and judging whether the node information meets preset judgment conditions or not; if the abstract syntax trees meet preset judgment conditions, judging that the abstract syntax trees comprise the same internal variables and/or functions; if the abstract syntax trees do not comprise the same internal variables and/or functions, merging the cpp files to generate a target cpp file to be compiled; wherein, judge whether node information satisfies predetermined judgement condition, include: judging whether the node is an internal variable or an internal function; if yes, determining the key value pair of the node according to the node information, and judging whether the number of sub-keys of the key value pair is larger than 1; the key value pair takes the name of the node as a key, the cpp file name of the node as a sub-key, and the values as a row number and a column number.
2. The method of claim 1, further comprising,
if the abstract syntax trees comprise the same internal variables and/or functions, generating error information;
modifying the error information;
the error information comprises a file name, an internal variable name and/or a function name of a file corresponding to an abstract object tree with the same internal variable and/or function, and a line number of a file where the internal variable name and/or the function name are located.
3. A C + + program compiling apparatus, comprising,
the acquisition module is used for acquiring a plurality of cpp files;
the merging algorithm processing module is used for performing merging algorithm processing on the acquired cpp files and generating target cpp files to be compiled;
the compiling module is used for compiling the target cpp file;
the merging algorithm processing module further comprises:
the abstract syntax tree generating module is used for generating an abstract syntax tree for each cpp file;
the judging module is used for judging whether the abstract syntax trees comprise the same internal variables and/or functions;
the judging module also comprises a judging module for judging whether the current time is less than or equal to a preset time,
the node information acquisition module is used for acquiring node information in the abstract syntax tree; the node information includes: the method comprises the following steps of (1) node type, node link type, node name, node position information, file name, line number and column number of a cpp (common program) file where the node is located;
the node information judging module is used for traversing the node information and judging whether the node information meets preset judging conditions or not; if the abstract syntax trees meet preset judgment conditions, judging that the abstract syntax trees comprise the same internal variables and/or functions; if the abstract syntax trees do not comprise the same internal variables and/or functions, merging the cpp files to generate a target cpp file to be compiled; wherein, judge whether node information satisfies predetermined judgement condition, include: judging whether the node is an internal variable or an internal function; if yes, determining the key value pair of the node according to the node information, and judging whether the number of sub-keys of the key value pair is larger than 1; the key value pair takes the name of a node as a key, the cpp file name of the node as a sub-key, and the value as a row number and a column number;
the merging algorithm processing module further comprises a merging algorithm processing module,
an include pseudo-instruction calling module, configured to call the cpp file;
and the cpp file adding module is used for adding the cpp file to a pre-set cpp file to generate a target cpp file to be compiled.
4. The apparatus of claim 3, wherein the merging algorithm processing module further comprises:
generating error information, wherein the error information is generated when the abstract syntax trees are judged to include the same internal variables and/or functions;
and the error modification module is used for modifying the error information and generating a new abstract syntax tree.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811569117.6A CN109614106B (en) | 2018-12-21 | 2018-12-21 | C + + program compiling method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811569117.6A CN109614106B (en) | 2018-12-21 | 2018-12-21 | C + + program compiling method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109614106A CN109614106A (en) | 2019-04-12 |
CN109614106B true CN109614106B (en) | 2022-04-19 |
Family
ID=66011177
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811569117.6A Active CN109614106B (en) | 2018-12-21 | 2018-12-21 | C + + program compiling method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109614106B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110471837A (en) * | 2019-07-05 | 2019-11-19 | 平安证券股份有限公司 | Program detecting method, device and computer readable storage medium |
CN110704068B (en) * | 2019-10-18 | 2023-02-17 | 安徽中科国创高可信软件有限公司 | Processing method and system for cross-file collaborative program analysis based on database |
CN111221519B (en) * | 2019-11-12 | 2020-11-27 | 广州银汉科技有限公司 | Python-based CLI automatic export method |
CN113495728B (en) * | 2020-03-18 | 2024-06-28 | 腾讯科技(深圳)有限公司 | Dependency relationship determination method, dependency relationship determination device, electronic equipment and medium |
CN111552466B (en) * | 2020-05-12 | 2023-03-31 | 重庆科技学院 | Project file generation method, system, computer equipment and storage medium |
CN111880805B (en) * | 2020-07-20 | 2024-07-30 | 腾讯科技(深圳)有限公司 | Method and device for generating package file of software item, equipment and storage medium |
CN113031962B (en) * | 2021-03-23 | 2022-04-15 | 北京百度网讯科技有限公司 | Compiling method, compiling apparatus, electronic device, storage medium, and program product |
CN113031961B (en) * | 2021-03-23 | 2023-04-07 | 北京百度网讯科技有限公司 | Compiling method, compiling apparatus, electronic device, storage medium, and program product |
CN113050952B (en) * | 2021-04-19 | 2024-07-05 | 杭州至千哩科技有限公司 | Pseudo instruction compiling method, pseudo instruction compiling device, computer equipment and storage medium |
CN114089960B (en) * | 2021-10-11 | 2024-10-25 | 阿里云计算有限公司 | Object processing method and device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2330469A1 (en) * | 2009-12-03 | 2011-06-08 | dspace digital signal processing and control engineering GmbH | Method and development environment for generating an executable total control program |
CN107678748A (en) * | 2017-09-21 | 2018-02-09 | 杭州迪普科技股份有限公司 | A kind of source code file Compilation Method and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108399318B (en) * | 2018-01-31 | 2020-09-08 | 北京顶象技术有限公司 | Executable file generation method, executable file execution method and electronic equipment |
-
2018
- 2018-12-21 CN CN201811569117.6A patent/CN109614106B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2330469A1 (en) * | 2009-12-03 | 2011-06-08 | dspace digital signal processing and control engineering GmbH | Method and development environment for generating an executable total control program |
CN107678748A (en) * | 2017-09-21 | 2018-02-09 | 杭州迪普科技股份有限公司 | A kind of source code file Compilation Method and device |
Non-Patent Citations (4)
Title |
---|
jamesheros.关于如何将多个Cpp文件关联起来.《CSDN博客,https://blog.csdn.net/u010167037/article/details/19680877》.2014, * |
Using libclang to Parse C++ (aka libclang 101);shaharmike;《https://shaharmike.com/cpp/libclang/ 》;20170103;第1-8页 * |
关于如何将多个Cpp文件关联起来;jamesheros;《CSDN博客,https://blog.csdn.net/u010167037/article/details/19680877》;20140222;第1-4页 * |
多cpp文件 重复定义;gameWYD;《https://blog.csdn.net/gamewyd/article/details/6792113》;20110919;第1-3页 * |
Also Published As
Publication number | Publication date |
---|---|
CN109614106A (en) | 2019-04-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109614106B (en) | C + + program compiling method and device | |
US10394694B2 (en) | Unexplored branch search in hybrid fuzz testing of software binaries | |
CN108369591B (en) | System and method for caching and parameterizing IR | |
US11474823B2 (en) | Methods, systems, and computer readable media for on-demand, on-device compiling and use of programmable pipeline device profiles | |
CN110543427B (en) | Test case storage method and device, electronic equipment and storage medium | |
CN107665170B (en) | Flow testing method and device | |
CN104320312A (en) | Network application safety test tool and fuzz test case generation method and system | |
CN113360156B (en) | IOS compiling method and related equipment | |
Binkley et al. | Tree-oriented vs. line-oriented observation-based slicing | |
CN113778445A (en) | Cross-platform component generation method and device, electronic equipment and storage medium | |
CN111221852A (en) | Mixed query processing method and device based on big data | |
CN117032668A (en) | Processing method, device, system and platform of visual rule engine | |
CN113568604B (en) | Method and device for updating wind control strategy and computer readable storage medium | |
CN113495723B (en) | Method, device and storage medium for calling functional component | |
CN112395339B (en) | Intersystem data admission verification method, device, computer equipment and storage medium | |
CN112463628B (en) | Self-adaptive evolution method of autonomous unmanned system software based on model base framework | |
CN109343856A (en) | The generation method and device of custom algorithm component | |
CN114791865B (en) | Configuration item self-consistency detection method, system and medium based on relation diagram | |
CN114115900B (en) | Script compiling method and device and electronic equipment | |
CN114661298A (en) | Automatic public method generation method, system, device and medium | |
Ipate et al. | Model learning and test generation using cover automata | |
CN113708971A (en) | Openstack cloud platform deployment method and related device | |
CN117349332B (en) | Method and device for generating application programming interface API and electronic equipment | |
CN116483597B (en) | Data sharing method, device, equipment and storage medium | |
Miyamoto | Synthesizing Pareto efficient intelligible state machines from communication diagram |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |