fix exception handling for TargetMachine
This commit is contained in:
parent
84a95945ea
commit
c20c4d776f
1 changed files with 1 additions and 1 deletions
|
|
@ -282,7 +282,7 @@ class TargetMachine(llvm.Wrapper):
|
||||||
with contextlib.closing(BytesIO()) as error:
|
with contextlib.closing(BytesIO()) as error:
|
||||||
target = api.llvm.TargetRegistry.lookupTarget(triple, error)
|
target = api.llvm.TargetRegistry.lookupTarget(triple, error)
|
||||||
if not target:
|
if not target:
|
||||||
raise llvm.LLVMException(error)
|
raise llvm.LLVMException(error.getvalue())
|
||||||
if not target.hasTargetMachine():
|
if not target.hasTargetMachine():
|
||||||
raise llvm.LLVMException(target, "No target machine.")
|
raise llvm.LLVMException(target, "No target machine.")
|
||||||
target_options = api.llvm.TargetOptions.new()
|
target_options = api.llvm.TargetOptions.new()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue