Fix decimal bugs.

Fix overflow handling in a few cases and add decimal as hs2 type.

Change-Id: Ifde1988365f6be961e7eb7404ed37d7bbaab875c
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2531
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
Codegen improvements

The main improvement introduced by this patch is speeding up
compilation time by pruning the module of unused functions before
running the rest of the optimization passes. This eliminates most of
the functions in the module since it includes all cross-compiled
functions. This requires that all codegen'd functions are registered
with AddFunctionToJit(), so we know which functions can't be deleted.
With this change, the compilation time decreased from 131.398ms to
36.579ms on a simple "select *" query.

The rest of the changes are minor additions to LlvmCodegen that will
be used in the expr refactoring.

Change-Id: If08000d3dc3fd4d777f6d1f7a30639badad89d6c
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2378
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: Skye Wanderman-Milne <skye@cloudera.com>