Fix build broken by LLVM commit r199279

Patch by: Udo van den Heuvel

Tom Stellard:
  - Added ifdef and error handling