And when we fail to compile a module, the fileName may be NULL, we can't
access it unconditionally.
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
cloned_module = llvm::CloneModule((llvm::Module*)module);
}
if (llvmToGen(*unit, fileName, module, optLevel, OCL_STRICT_CONFORMANCE) == false) {
- error = std::string(fileName) + " not found";
+ if (fileName)
+ error = std::string(fileName) + " not found";
return false;
}
//If unit is not valid, maybe some thing don't support by backend, introduce by some passes