speeding up compile times in C++

amichail@cs.toronto.edu (Amir Michail)
Thu, 26 Jan 1995 07:17:41 GMT

          From comp.compilers

Related articles
speeding up compile times in C++ amichail@cs.toronto.edu (1995-01-26)
Re: speeding up compile times in C++ thutt@clark.net (1995-01-26)
Re: speeding up compile times in C++ glwinter@infi.net (1995-01-29)
Re: speeding up compile times in C++ shankar@sgi.com (1995-02-02)
Re: speeding up compile times in C++ glasss@ncp.gpt.co.uk (Steve Glass) (1995-02-03)
Re: speeding up compile times in C++ thutt@clark.net (1995-02-04)
Re: speeding up compile times in C++ rfg@rahul.net (Ronald F. Guilmette) (1995-02-04)
[4 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: amichail@cs.toronto.edu (Amir Michail)
Keywords: C++, performance, question
Organization: CS Lab, University of Toronto
Date: Thu, 26 Jan 1995 07:17:41 GMT

One problem with writing large C++ projects is that changing one or two
header files often results in much of the project being recompiled. This
is partly due to the class hierarchies and derivation.


I was thinking of a way around this problem. The motivation is that
changing .h files should not cause any .c files to recompile unless these
files were also changed.


The idea is for the compiler to maintain a .i file along with any .h file
that gives information about how the .o files were created. In
particular, if I declare a structure taking x bytes, then the compiler
generates code that gives the structure 2x bytes.


Now, if I change the structure later on by reordering variables, adding
and/or deleting variables, then the compiler checks the .i file to see how
the .o files were created, and automatically reorders items or pads
structures in the .h file so that the ordering of old items is identical
to that in the .o file. Thus, previously compiled code will still work
with new code compiled with the new .h file. Obviously, if the structure
grows to twice its original size, then all .c files that depend on the .h
file must be recompiled with twice the new size of the structure.


Would this idea work? Would it improve compilation times?


Amir
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.