clover: Add environment variables for dumping kernel code v2
authorTom Stellard <thomas.stellard@amd.com>
Tue, 30 Sep 2014 14:32:33 +0000 (10:32 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Thu, 16 Oct 2014 23:42:52 +0000 (19:42 -0400)
commite1d363b3ffbfb85133a6871c63068a4ba841b2cd
tree1e4fea5cfca404dd9c3124246ce63b70b49828fa
parent76136c29bbd78ea414c86402d4031855218dc42b
clover: Add environment variables for dumping kernel code v2

There are two debug variables:

CLOVER_DEBUG which you can set to any combination of llvm,clc,asm
(separated by commas) to dump llvm IR, OpenCL C, and native assembly.

CLOVER_DEBUG_FILE which you can set to a file name for dumping output
instead of stderr.  If you set this variable, the output will be split
into three separate files with different suffixes: .cl for OpenCL C,
.ll for LLVM IR, and .asm for native assembly.  Note that when data
is written, it is always appended to the files.

v2:
  - Code cleanups
  - Add CLOVER_DEBUG_FILE environment variable for dumping to a file.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/llvm/invocation.cpp