Vax C90-EL SERIES Service Manual Page 131

  • Download
  • Add to my manuals
  • Print
  • Page
    / 216
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 130
Cray Standard C++ Template Instantiation [6]
created, if one does not already exist (for example, the compilation of abc.C
results in the creation of abc.ti).
2. When the object files are linked together, a program called the prelinker is
run. It examines the object files, looking for references and definitions of
template entities and for any additional information about entities that
could be instantiated.
!
Caution: The prelinker does not examine the object files in a library (.a)
file.
3. If the prelinker finds a reference to a template entity for which there is no
definition in the set of object files, it looks for a file that indicates that it could
instantiate that template entity. Upon discovery of such a file, it assigns the
instantiation to that file. The set of instantiations assigned to a given file (for
example, abc.C) is recorded in an associated file that has a .ii suffix (for
example, abc.ii).
4. The prelinker then executes the compiler to again recompile each file for
which the .ii was changed.
5. During compilation, the compiler obeys the instantiation requests contained
in the associated .ii file and produces a new object file that contains the
requested template entities and the other things that were already in the
object file.
6. The prelinker repeats steps 3 through 5 until there are no more instantiations
to be adjusted.
7. The object files are linked together.
Once the program has been linked correctly, the .ii files contain a complete
set of instantiation assignments. If source files are recompiled, the compiler
consults the .ii files and does the indicated instantiations as it does the normal
compilations. That means that, except in cases where the set of required
instantiations changes, the prelink step from then on will find that all the
necessary instantiations are present in the object files and no instantiation
assignment adjustments need be done. This is true even if the entire program
is recompiled. Because the .ii file contains information on how to recompile
when instantiating, it is important that the .o and .ii files are not moved
between the first compilation and linkage.
The prelinker cannot instantiate into and from library files (.a), so if a library is
to be shared by many applications its templates should be expanded. You may
find that creating a directory of objects with corresponding .ii files and the use
S217936 111
Page view 130
1 2 ... 126 127 128 129 130 131 132 133 134 135 136 ... 215 216

Comments to this Manuals

No comments