diff --git a/REQUIRE b/REQUIRE index 9e74e5b2..2652857b 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,2 +1,2 @@ julia 0.5 -Compat 0.9.5 +Compat 0.17.0 diff --git a/src/core.jl b/src/core.jl index d3b796e9..cb4c3d5e 100644 --- a/src/core.jl +++ b/src/core.jl @@ -2,10 +2,10 @@ # other related types and utilities. # forward-declarations -@reftypedef abstract User <: Value -@reftypedef abstract Constant <: User -@reftypedef abstract GlobalValue <: Constant -@reftypedef abstract GlobalObject <: GlobalValue +@reftypedef @compat abstract type User <: Value end +@reftypedef @compat abstract type Constant <: User end +@reftypedef @compat abstract type GlobalValue <: Constant end +@reftypedef @compat abstract type GlobalObject <: GlobalValue end @reftypedef proxy=Value kind=LLVMFunctionValueKind immutable Function <: GlobalObject end @reftypedef proxy=Value kind=LLVMBasicBlockValueKind immutable BasicBlock <: Value end diff --git a/src/core/attributes.jl b/src/core/attributes.jl index 26a72221..5074ea92 100644 --- a/src/core/attributes.jl +++ b/src/core/attributes.jl @@ -5,7 +5,7 @@ export Attribute, EnumAttribute, StringAttribute, kind, value -@reftypedef ref=LLVMAttributeRef abstract Attribute +@reftypedef ref=LLVMAttributeRef @compat abstract type Attribute end @reftypedef proxy=Attribute immutable EnumAttribute <: Attribute end diff --git a/src/core/type.jl b/src/core/type.jl index ec993c1f..6ba1d64a 100644 --- a/src/core/type.jl +++ b/src/core/type.jl @@ -50,7 +50,7 @@ width(inttyp::IntegerType) = API.LLVMGetIntTypeWidth(ref(inttyp)) # NOTE: this type doesn't exist in the LLVM API, # we add it for convenience of typechecking generic values (see execution.jl) -@reftypedef abstract FloatingPointType <: LLVMType +@reftypedef @compat abstract type FloatingPointType <: LLVMType end # NOTE: we don't handle the obscure types here (:X86FP80, :FP128, :PPCFP128), # they would also need special casing as LLVMPPCFP128Type != LLVMPPC_FP128TypeKind @@ -96,14 +96,14 @@ end ## composite types -@reftypedef abstract CompositeType <: LLVMType +@reftypedef @compat abstract type CompositeType <: LLVMType end ## sequential types export addrspace -@reftypedef abstract SequentialType <: CompositeType +@reftypedef @compat abstract type SequentialType <: CompositeType end import Base: length, size, eltype diff --git a/src/pass.jl b/src/pass.jl index 76883543..f343337f 100644 --- a/src/pass.jl +++ b/src/pass.jl @@ -1,6 +1,6 @@ export Pass -abstract Pass +@compat abstract type Pass end # diff --git a/src/passmanager.jl b/src/passmanager.jl index b1e9ceb5..b901ae5a 100644 --- a/src/passmanager.jl +++ b/src/passmanager.jl @@ -1,7 +1,7 @@ export PassManager, add!, dispose -abstract PassManager +@compat abstract type PassManager end add!(pm::PassManager, pass::Pass) = API.LLVMAddPass(ref(pm), ref(pass)) diff --git a/src/types.jl b/src/types.jl index 08af7842..865f44c9 100644 --- a/src/types.jl +++ b/src/types.jl @@ -1,7 +1,7 @@ ## forward declarations # TODO: LLVM.Type once JuliaLang/Julia#18756 is backported -@reftypedef ref=LLVMTypeRef enum=LLVMTypeKind abstract LLVMType -@reftypedef ref=LLVMValueRef enum=LLVMValueKind abstract Value +@reftypedef ref=LLVMTypeRef enum=LLVMTypeKind @compat abstract type LLVMType end +@reftypedef ref=LLVMValueRef enum=LLVMValueKind @compat abstract type Value end @reftypedef ref=LLVMModuleRef immutable Module end @reftypedef ref=LLVMTargetDataRef immutable DataLayout end diff --git a/src/util.jl b/src/util.jl index c8e83369..120a26c7 100644 --- a/src/util.jl +++ b/src/util.jl @@ -23,6 +23,10 @@ macro reftypedef(args...) typedef = args[end] # decode type definition + if typedef.head == :macrocall + # handle `@compat` prefixing 0.6-style type declarations + typedef = macroexpand(typedef) + end if typedef.head == :abstract structure = typedef.args[1] elseif typedef.head == :type