Together these let you easily create diagnostics that
- are never emitted for host code
- are always emitted for device and global functions, and
- are emitted for host device functions iff these functions are codegen'ed.
At the moment there are only three diagnostics that need this treatment,
but I have more to add, and it's not sustainable to write code for emitting
every such diagnostic twice, and from a special wrapper in SemaCUDA.cpp.
While we're at it, don't emit the function name in
err_cuda_device_exceptions: It's not necessary to print it, and making
this work in the new framework in the face of a null value for
dyn_cast<FunctionDecl>(CurContext) isn't worth the effort.
LLVM has a different enum naming convention: http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly