#ifndef __X10_COMPILER_LOCALVAR_H
#define __X10_COMPILER_LOCALVAR_H

#include <x10rt.h>


#define X10_LANG_OBJECT_H_NODEPS
#include <x10/lang/Object.h>
#undef X10_LANG_OBJECT_H_NODEPS
namespace x10 { namespace lang { 
class Any;
} } 
namespace x10 { namespace compiler { 
class Native;
} } 
namespace x10 { namespace compiler { 
class NativeRep;
} } 
namespace x10 { namespace compiler { 

template<class TPMGL(T)> class LocalVar;
template <> class LocalVar<void>;
template<class TPMGL(T)> class LocalVar : public x10::lang::Object   {
    public:
    RTT_H_DECLS_CLASS
    
    void _constructor(TPMGL(T) local);
    
    static x10aux::ref<x10::compiler::LocalVar<TPMGL(T)> > _make(TPMGL(T) local);
    
    virtual TPMGL(T) __apply();
    virtual TPMGL(T) get();
    virtual TPMGL(T) __apply(TPMGL(T) local);
    virtual x10aux::ref<x10::compiler::LocalVar<TPMGL(T)> > x10__compiler__LocalVar____x10__compiler__LocalVar__this(
      );
    
    // Serialization
    public: static const x10aux::serialization_id_t _serialization_id;
    
    public: virtual x10aux::serialization_id_t _get_serialization_id() {
         return _serialization_id;
    }
    
    public: virtual void _serialize_body(x10aux::serialization_buffer& buf);
    
    public: static x10aux::ref<x10::lang::Reference> _deserializer(x10aux::deserialization_buffer& buf);
    
    public: void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};
template <> class LocalVar<void> : public x10::lang::Object {
    public:
    static x10aux::RuntimeType rtt;
    static const x10aux::RuntimeType* getRTT() { return & rtt; }
    
};

} } 
#endif // X10_COMPILER_LOCALVAR_H

namespace x10 { namespace compiler { 
template<class TPMGL(T)> class LocalVar;
} } 

#ifndef X10_COMPILER_LOCALVAR_H_NODEPS
#define X10_COMPILER_LOCALVAR_H_NODEPS
#include <x10/lang/Object.h>
#include <x10/lang/Any.h>
#include <x10/compiler/Native.h>
#include <x10/compiler/NativeRep.h>
#ifndef X10_COMPILER_LOCALVAR_H_GENERICS
#define X10_COMPILER_LOCALVAR_H_GENERICS
#endif // X10_COMPILER_LOCALVAR_H_GENERICS
#ifndef X10_COMPILER_LOCALVAR_H_IMPLEMENTATION
#define X10_COMPILER_LOCALVAR_H_IMPLEMENTATION
#include <x10/compiler/LocalVar.h>


//#line 17 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/compiler/LocalVar.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(T)> void x10::compiler::LocalVar<TPMGL(T)>::_constructor(
                           TPMGL(T) local) {
    
    //#line 17 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/compiler/LocalVar.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::lang::Object::_constructor();
    
    //#line 17 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/compiler/LocalVar.x10": x10.ast.AssignPropertyCall_c
    
}
template<class TPMGL(T)> x10aux::ref<x10::compiler::LocalVar<TPMGL(T)> > x10::compiler::LocalVar<TPMGL(T)>::_make(
                           TPMGL(T) local) {
    x10aux::ref<x10::compiler::LocalVar<TPMGL(T)> > this_ = new (memset(x10aux::alloc<x10::compiler::LocalVar<TPMGL(T)> >(), 0, sizeof(x10::compiler::LocalVar<TPMGL(T)>))) x10::compiler::LocalVar<TPMGL(T)>();
    this_->_constructor(local);
    return this_;
}



//#line 19 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/compiler/LocalVar.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::compiler::LocalVar<TPMGL(T)>::__apply(
  ) {
    
    //#line 20 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/compiler/LocalVar.x10": x10.ast.X10Return_c
    return x10aux::class_cast<TPMGL(T)>(x10aux::class_cast_unchecked<x10aux::ref<x10::lang::Any> >(X10_NULL));
    
}

//#line 22 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/compiler/LocalVar.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::compiler::LocalVar<TPMGL(T)>::get(
  ) {
    
    //#line 23 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/compiler/LocalVar.x10": x10.ast.X10Return_c
    return x10aux::class_cast<TPMGL(T)>(x10aux::class_cast_unchecked<x10aux::ref<x10::lang::Any> >(X10_NULL));
    
}

//#line 25 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/compiler/LocalVar.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> TPMGL(T) x10::compiler::LocalVar<TPMGL(T)>::__apply(
  TPMGL(T) local) {
    
    //#line 26 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/compiler/LocalVar.x10": x10.ast.X10Return_c
    return local;
    
}

//#line 14 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/compiler/LocalVar.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::compiler::LocalVar<TPMGL(T)> >
  x10::compiler::LocalVar<TPMGL(T)>::x10__compiler__LocalVar____x10__compiler__LocalVar__this(
  ) {
    
    //#line 14 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/compiler/LocalVar.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::compiler::LocalVar<TPMGL(T)> >)this);
    
}
template<class TPMGL(T)> const x10aux::serialization_id_t x10::compiler::LocalVar<TPMGL(T)>::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10::compiler::LocalVar<TPMGL(T)>::_deserializer, x10aux::CLOSURE_KIND_NOT_ASYNC);

template<class TPMGL(T)> void x10::compiler::LocalVar<TPMGL(T)>::_serialize_body(x10aux::serialization_buffer& buf) {
    x10::lang::Object::_serialize_body(buf);
    
}

template<class TPMGL(T)> x10aux::ref<x10::lang::Reference> x10::compiler::LocalVar<TPMGL(T)>::_deserializer(x10aux::deserialization_buffer& buf) {
    x10aux::ref<x10::compiler::LocalVar<TPMGL(T)> > this_ = new (memset(x10aux::alloc<x10::compiler::LocalVar<TPMGL(T)> >(), 0, sizeof(x10::compiler::LocalVar<TPMGL(T)>))) x10::compiler::LocalVar<TPMGL(T)>();
    buf.record_reference(this_);
    this_->_deserialize_body(buf);
    return this_;
}

template<class TPMGL(T)> void x10::compiler::LocalVar<TPMGL(T)>::_deserialize_body(x10aux::deserialization_buffer& buf) {
    x10::lang::Object::_deserialize_body(buf);
    
}

template<class TPMGL(T)> x10aux::RuntimeType x10::compiler::LocalVar<TPMGL(T)>::rtt;
template<class TPMGL(T)> void x10::compiler::LocalVar<TPMGL(T)>::_initRTT() {
    const x10aux::RuntimeType *canonical = x10aux::getRTT<x10::compiler::LocalVar<void> >();
    if (rtt.initStageOne(canonical)) return;
    const x10aux::RuntimeType* parents[1] = { x10aux::getRTT<x10::lang::Object>()};
    const x10aux::RuntimeType* params[1] = { x10aux::getRTT<TPMGL(T)>()};
    x10aux::RuntimeType::Variance variances[1] = { x10aux::RuntimeType::invariant};
    const char *baseName = "x10.compiler.LocalVar";
    rtt.initStageTwo(baseName, x10aux::RuntimeType::class_kind, 1, parents, 1, params, variances);
}
#endif // X10_COMPILER_LOCALVAR_H_IMPLEMENTATION
#endif // __X10_COMPILER_LOCALVAR_H_NODEPS
