summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
Commit message (Collapse)AuthorAgeFilesLines
* llvm-cov: Added call to update run/program counts.Yuchen Wu2013-11-121-0/+8
| | | | | | Also updated test files that were generated from this change. llvm-svn: 194453
* Fixed comment typo in GCOVProfiling.cppYuchen Wu2013-10-231-1/+1
| | | | llvm-svn: 193268
* Remove lib/Transforms/Instrumentation/ProfilingUtils.*Rafael Espindola2013-10-141-1/+0
| | | | | | | | They were leftover from the old profiling support. Patch by Alastair Murray. llvm-svn: 192605
* Move registering the execution of a basic block to the beginning rather than ↵Bill Wendling2013-08-201-7/+7
| | | | | | | | | | | | | | | | | the end. There are situations which can affect the correctness (or at least expectation) of the gcov output. For instance, if a call to __gcov_flush() occurs within a block before the execution count is registered and then the program aborts in some way, then that block will not be marked as executed. This is not normally what the user expects. If we move the code that's registering when a block is executed to the beginning, we can catch these types of situations. PR16893 llvm-svn: 188849
* Mark a method 'const' and another 'static'.Craig Topper2013-07-171-2/+2
| | | | llvm-svn: 186485
* Make a few more static string pointers constant.Craig Topper2013-07-171-8/+8
| | | | llvm-svn: 186484
* Add a wrapper for open.Rafael Espindola2013-07-161-1/+1
| | | | | | | This centralizes the handling of O_BINARY and opens the way for hiding more differences (like how open behaves with directories). llvm-svn: 186447
* Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid ↵Craig Topper2013-07-041-1/+1
| | | | | | specifying the vector size. llvm-svn: 185606
* Debug Info: clean up usage of Verify.Manman Ren2013-06-281-2/+8
| | | | | | | | | | | No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. For cases where we know the type of a DI metadata, use assert. Also update testing cases to make them conform to the format of DI classes. llvm-svn: 185135
* Revert "Debug Info: clean up usage of Verify." as it's breaking bots.Eric Christopher2013-06-261-2/+2
| | | | | | This reverts commit r185020 llvm-svn: 185032
* Debug Info: clean up usage of Verify.Manman Ren2013-06-261-2/+2
| | | | | | | | No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. llvm-svn: 185020
* Fix nondeterminism in .gcno file generation.Nick Lewycky2013-06-181-9/+25
| | | | llvm-svn: 184174
* Move PathV2.h to Path.hRafael Espindola2013-06-111-1/+1
| | | | | | | Most clients have already been moved from Path V1 to V2. The ones using V1 now include PathV1.h explicitly. llvm-svn: 183801
* Minor simplification.Bill Wendling2013-03-281-8/+4
| | | | | | Go ahead and use the full path for both the .gcno and .gcda files. llvm-svn: 178302
* Use the full path when outputting the `.gcda' file.Bill Wendling2013-03-261-5/+14
| | | | | | | | | | | | | | If we compile a single source program, the `.gcda' file will be generated where the program was executed. This isn't desirable, because that place may be at an unpredictable place (the program could call `chdir' for instance). Instead, we will output the `.gcda' file in the same place we output the `.gcno' file. I.e., the directory where the executable was generated. This matches GCC's behavior. <rdar://problem/13061072> & PR11809 llvm-svn: 178084
* Call the new llvm_gcov_init function to register the environment.Bill Wendling2013-03-201-29/+10
| | | | | | | | | | | Use the new `llvm_gcov_init' function to register the writeout and flush functions. The initialization function will also call `atexit' for some cleanups and final writout calls. But it does this only once. This is better than checking for the `main' function, because in a library that function may not exist. <rdar://problem/12439551> llvm-svn: 177579
* Register the GCOV writeout functions so that they're emitted serially.Bill Wendling2013-03-191-10/+31
| | | | | | | | | We don't want to write out >1000 files at the same time. That could make things prohibitively expensive. Instead, register the "writeout" function so that it's emitted serially. <rdar://problem/12439551> llvm-svn: 177437
* Emit the linkage name instead of the function name, when available. This meansNick Lewycky2013-03-191-8/+14
| | | | | | that we'll prefer to emit the mangled C++ name (pending a clang change). llvm-svn: 177371
* Register the flush function for each compile unit.Bill Wendling2013-03-181-31/+54
| | | | | | | | | | For each compile unit, we want to register a function that will flush that compile unit. Otherwise, __gcov_flush() would only flush the counters within the current compile unit, and not any outside of it. PR15191 & <rdar://problem/13167507> llvm-svn: 177340
* Remove accidentally committed debug line.Nick Lewycky2013-03-141-1/+0
| | | | llvm-svn: 177005
* Refactor GCOV's six constructor arguments into a struct with a getter thatNick Lewycky2013-03-141-42/+59
| | | | | | | | | | constructs default arguments. It can now take default arguments from cl::opt'ions. Add a new -default-gcov-version=... option, and actually test it! Sink the reverse-order of the version into GCOVProfiling, hiding it from our users. llvm-svn: 177002
* No functionality change. Rename emitGCNO() to the more sensibleNick Lewycky2013-03-131-7/+7
| | | | | | | | | emitProfileNotes(), similar to emitProfileArcs(). Also update its comment. Also add a comment on Version[4] (there will be another comment in clang later), and compress lines that exceeded 80 columns. llvm-svn: 176994
* Use the correct index variable. This is the meat of what was supposed to be inNick Lewycky2013-03-091-1/+1
| | | | | | r176751. Also, learn a lesson about applying patches by hand/eyeball. llvm-svn: 176764
* Fix bug introduced in r176616 when making function identifier numbers stable.Nick Lewycky2013-03-091-5/+3
| | | | | | Count the subprograms, not the compile units. llvm-svn: 176751
* Don't emit the extra checksum into the .gcda file if the user hasn't asked forNick Lewycky2013-03-091-4/+6
| | | | | | | | it. Fortunately, versions of gcov that predate the extra checksum also ignore any extra data, so this isn't a problem. There will be a matching commit in compiler-rt. llvm-svn: 176745
* Switch from a version 4.2/4.4 switch to a four-byte version string to be putNick Lewycky2013-03-071-23/+25
| | | | | | | | | into the actual gcov file. Instead of using the bottom 4 bytes as the function identifier, use a counter. This makes the identifier numbers stable across multiple runs. llvm-svn: 176616
* In GCC 4.7, function names are now forbidden from .gcda files. Support this byNick Lewycky2013-02-271-8/+14
| | | | | | | passing a null pointer to the function name in to GCDAProfiling, and add another switch onto GCOVProfiling. llvm-svn: 176173
* Doh, fix behaviour change introduced in r176168 which is tested in clang,Nick Lewycky2013-02-271-1/+3
| | | | | | not llvm. llvm-svn: 176172
* IRBuilder has grown all sorts of useful utility functions. Make use of them toNick Lewycky2013-02-271-25/+16
| | | | | | clean up this code a tiny bit. No functionality change. llvm-svn: 176168
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-3/+3
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-8/+8
| | | | | | single attribute in the future. llvm-svn: 170502
* Initialize NoRedZone and remove unused default values.Rafael Espindola2012-12-181-3/+4
| | | | llvm-svn: 170404
* Don't use a red zone for code coverage if the user specified `-mno-red-zone'.Bill Wendling2012-12-101-4/+17
| | | | | | | | | The `-mno-red-zone' flag wasn't being propagated to the functions that code coverage generates. This allowed some of them to use the red zone when that wasn't allowed. <rdar://problem/12843084> llvm-svn: 169754
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-6/+6
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Plug a memory leak in the GCOV profiling emitter, which never released the ↵Benjamin Kramer2012-11-171-5/+5
| | | | | | edge table memory. llvm-svn: 168259
* Back out r166591, not sure why this made it through since I cancelled the ↵Micah Villmow2012-10-241-4/+3
| | | | | | command. Bleh, sorry about this! llvm-svn: 166596
* Delete a directory that wasn't supposed to be checked in yet.Micah Villmow2012-10-241-3/+4
| | | | llvm-svn: 166591
* Have 'addFnAttr' take the attribute enum value. Then have it build the ↵Bill Wendling2012-10-101-6/+2
| | | | | | attribute object and add it appropriately. No functionality change. llvm-svn: 165595
* Use the enum value of the attributes when adding them to the attributes builder.Bill Wendling2012-10-091-2/+2
| | | | llvm-svn: 165494
* Convert to using the Attributes::Builder interface.Bill Wendling2012-10-091-2/+6
| | | | llvm-svn: 165465
* s/__llvm_gcov_flush/__gcov_flush/gBill Wendling2012-09-171-4/+4
| | | | llvm-svn: 164040
* Remove comment.Bill Wendling2012-09-141-1/+1
| | | | llvm-svn: 163945
* Use Nick's suggestion of storing a large NULL into the GV instead of memset, ↵Bill Wendling2012-09-131-18/+10
| | | | | | which requires TargetData. llvm-svn: 163799
* Introduce the __llvm_gcov_flush function.Bill Wendling2012-09-131-6/+56
| | | | | | | | | | This function writes out the current values of the counters and then resets them. This can be used similarly to the __gcov_flush function to sync the counters when need be. For instance, in a situation where the application doesn't exit. <rdar://problem/12185886> llvm-svn: 163757
* Pass by pointer and not std::string.Bill Wendling2012-08-301-2/+2
| | | | llvm-svn: 162888
* Revert r162855 in favor of changing clang to emit the absolute coverage file ↵Bill Wendling2012-08-301-19/+7
| | | | | | path. llvm-svn: 162883
* Use the full path to output the .gcda file.Bill Wendling2012-08-291-7/+19
| | | | | | | | This lets the user run the program from a different directory and still have the .gcda files show up in the correct place. <rdar://problem/12179524> llvm-svn: 162855
* Use ArrayRef instead of SmallVector when passing vector into function.Bill Wendling2012-08-291-4/+3
| | | | llvm-svn: 162851
* Don't reinsert the 'atexit' function if it already exists.Bill Wendling2012-06-301-2/+1
| | | | llvm-svn: 159491
* Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth2012-06-291-9/+9
| | | | | | | | | | | | | | | | | This was always part of the VMCore library out of necessity -- it deals entirely in the IR. The .cpp file in fact was already part of the VMCore library. This is just a mechanical move. I've tried to go through and re-apply the coding standard's preferred header sort, but at 40-ish files, I may have gotten some wrong. Please let me know if so. I'll be committing the corresponding updates to Clang and Polly, and Duncan has DragonEgg. Thanks to Bill and Eric for giving the green light for this bit of cleanup. llvm-svn: 159421
OpenPOWER on IntegriCloud