+const LineInfo* GetAsmLineInfo (const Collection* LineInfos)
+/* Find a line info of type LI_TYPE_ASM and count zero in the given collection
+** and return it. Return NULL if no such line info was found.
+*/
+{
+ unsigned I;
+
+ /* Search for a line info of LI_TYPE_ASM */
+ for (I = 0; I < CollCount (LineInfos); ++I) {
+ const LineInfo* LI = CollConstAt (LineInfos, I);
+ if (LI->Type == LI_MAKE_TYPE (LI_TYPE_ASM, 0)) {
+ return LI;
+ }
+ }
+
+ /* Not found */
+ return 0;
+}
+
+
+
+unsigned LineInfoCount (void)
+/* Return the total number of line infos */
+{
+ /* Walk over all object files */
+ unsigned I;
+ unsigned Count = 0;
+ for (I = 0; I < CollCount (&ObjDataList); ++I) {
+
+ /* Get this object file */
+ const ObjData* O = CollAtUnchecked (&ObjDataList, I);
+
+ /* Count spans */
+ Count += CollCount (&O->LineInfos);
+ }
+
+ return Count;
+}
+
+
+
+void AssignLineInfoIds (void)
+/* Assign the ids to the line infos */
+{
+ unsigned I, J;
+
+ /* Walk over all line infos */
+ unsigned Id = 0;
+ for (I = 0; I < CollCount (&ObjDataList); ++I) {
+
+ /* Get the object file */
+ ObjData* O = CollAtUnchecked (&ObjDataList, I);
+
+ /* Output the line infos */
+ for (J = 0; J < CollCount (&O->LineInfos); ++J) {
+
+ /* Get this line info */
+ LineInfo* LI = CollAtUnchecked (&O->LineInfos, J);
+
+ /* Assign the id */
+ LI->Id = Id++;
+ }
+ }
+}
+
+
+