llvm.org GIT mirror llvm / 717f7fa
Don't call exit from a runtime. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157450 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 8 years ago
1 changed file(s) with 6 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
120120 fprintf(stderr, "LLVM profiling runtime: while opening '%s': ",
121121 cptr ? cptr + 1 : orig_filename);
122122 perror("");
123 exit(1);
123 return;
124124 }
125125 }
126126
166166 #ifdef DEBUG_GCDAPROFILING
167167 printf("llvmgcda: function id=%x\n", ident);
168168 #endif
169 if (!output_file) return;
169170
170171 /* function tag */
171172 fwrite("\0\0\0\1", 4, 1, output_file);
178179
179180 void llvm_gcda_emit_arcs(uint32_t num_counters, uint64_t *counters) {
180181 uint32_t i;
181 /* counter #1 (arcs) tag */
182
183 /* Counter #1 (arcs) tag */
184 if (!output_file) return;
182185 fwrite("\0\0\xa1\1", 4, 1, output_file);
183186 write_int32(num_counters * 2);
184187 for (i = 0; i < num_counters; ++i) {
195198
196199 void llvm_gcda_end_file() {
197200 /* Write out EOF record. */
201 if (!output_file) return;
198202 fwrite("\0\0\0\0\0\0\0\0", 8, 1, output_file);
199203 fclose(output_file);
200204 output_file = NULL;