本文整理汇总了C#中AddressOp类的典型用法代码示例。如果您正苦于以下问题:C# AddressOp类的具体用法?C# AddressOp怎么用?C# AddressOp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AddressOp类属于命名空间,在下文中一共展示了AddressOp类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddressOf
public void AddressOf (EmitContext ec, AddressOp Mode)
{
expr.Emit (ec);
}
示例2: AddressOf
public void AddressOf (EmitContext ec, AddressOp mode)
{
unwrap.AddressOf (ec, mode);
}
示例3: AddressOf
public void AddressOf (EmitContext ec, AddressOp mode)
{
VariableInfo vi = VariableInfo;
ec.ig.Emit (OpCodes.Ldloca, vi.LocalBuilder);
}
示例4: AddressOf
public void AddressOf(EmitContext ec, AddressOp mode)
{
throw new NotImplementedException ();
}
示例5: AddressOf
public void AddressOf (EmitContext ec, AddressOp mode)
{
if (IsHoistedEmitRequired (ec)) {
HoistedVariable.AddressOf (ec, mode);
return;
}
Variable.EmitAddressOf (ec);
}
示例6: AddressOf
public void AddressOf(EmitContext ec, AddressOp mode)
{
if ((mode & AddressOp.Store) != 0)
spec.MemberDefinition.SetIsAssigned ();
if ((mode & AddressOp.Load) != 0)
spec.MemberDefinition.SetIsUsed ();
//
// Handle initonly fields specially: make a copy and then
// get the address of the copy.
//
bool need_copy;
if (spec.IsReadOnly){
need_copy = true;
if (ec.HasSet (EmitContext.Options.ConstructorScope)){
if (IsStatic){
if (ec.IsStatic)
need_copy = false;
} else
need_copy = false;
}
} else
need_copy = false;
if (need_copy){
LocalBuilder local;
Emit (ec);
local = ec.DeclareLocal (type, false);
ec.Emit (OpCodes.Stloc, local);
ec.Emit (OpCodes.Ldloca, local);
return;
}
if (IsStatic){
ec.Emit (OpCodes.Ldsflda, spec);
} else {
if (!prepared)
EmitInstance (ec, false);
ec.Emit (OpCodes.Ldflda, spec);
}
}
示例7: AddressOf
public void AddressOf (EmitContext ec, AddressOp mode)
{
ILGenerator ig = ec.ig;
FieldBase f = TypeManager.GetField (FieldInfo);
if (f != null){
if ((mode & AddressOp.Store) != 0)
f.SetAssigned ();
if ((mode & AddressOp.Load) != 0)
f.SetMemberIsUsed ();
}
//
// Handle initonly fields specially: make a copy and then
// get the address of the copy.
//
bool need_copy;
if (FieldInfo.IsInitOnly){
need_copy = true;
if (ec.HasSet (EmitContext.Options.ConstructorScope)){
if (FieldInfo.IsStatic){
if (ec.IsStatic)
need_copy = false;
} else
need_copy = false;
}
} else
need_copy = false;
if (need_copy){
LocalBuilder local;
Emit (ec);
local = ig.DeclareLocal (type);
ig.Emit (OpCodes.Stloc, local);
ig.Emit (OpCodes.Ldloca, local);
return;
}
if (FieldInfo.IsStatic){
ig.Emit (OpCodes.Ldsflda, GetConstructedFieldInfo ());
} else {
if (!prepared)
EmitInstance (ec, false);
ig.Emit (OpCodes.Ldflda, GetConstructedFieldInfo ());
}
}
示例8: EmitAddressOf
protected override IMemoryLocation EmitAddressOf (EmitContext ec, AddressOp Mode)
{
instance = base.EmitAddressOf (ec, Mode);
if (!initializers.IsEmpty)
initializers.Emit (ec);
return instance;
}
示例9: AddressOf
public void AddressOf (EmitContext ec, AddressOp mode)
{
ILGenerator ig = ec.ig;
FieldBase f = TypeManager.GetField (FieldInfo);
if (f != null){
if ((f.ModFlags & Modifiers.VOLATILE) != 0){
Report.Warning (420, 1, loc, "`{0}': A volatile field references will not be treated as volatile",
f.GetSignatureForError ());
}
if ((mode & AddressOp.Store) != 0)
f.SetAssigned ();
if ((mode & AddressOp.Load) != 0)
f.SetMemberIsUsed ();
}
//
// Handle initonly fields specially: make a copy and then
// get the address of the copy.
//
bool need_copy;
if (FieldInfo.IsInitOnly){
need_copy = true;
if (ec.IsConstructor){
if (FieldInfo.IsStatic){
if (ec.IsStatic)
need_copy = false;
} else
need_copy = false;
}
} else
need_copy = false;
if (need_copy){
LocalBuilder local;
Emit (ec);
local = ig.DeclareLocal (type);
ig.Emit (OpCodes.Stloc, local);
ig.Emit (OpCodes.Ldloca, local);
return;
}
if (FieldInfo.IsStatic){
ig.Emit (OpCodes.Ldsflda, GetConstructedFieldInfo ());
} else {
if (!prepared)
EmitInstance (ec, false);
ig.Emit (OpCodes.Ldflda, GetConstructedFieldInfo ());
}
}
示例10: AddressOf
public void AddressOf (EmitContext ec, AddressOp mode)
{
IMemoryLocation ml;
if (temp_field != null) {
ml = temp_field as IMemoryLocation;
if (ml == null) {
var lt = new LocalTemporary (temp_field.Type);
temp_field.Emit (ec);
lt.Store (ec);
ml = lt;
}
} else {
ml = expr as VariableReference;
}
if (ml != null)
ml.AddressOf (ec, mode);
else
LocalVariable.AddressOf (ec, mode);
}
示例11: AddressOf
public void AddressOf (EmitContext ec, AddressOp mode)
{
if (builder == null)
builder = ec.GetTemporaryLocal (type);
if (builder.LocalType.IsByRef) {
//
// if is_address, than this is just the address anyways,
// so we just return this.
//
ec.Emit (OpCodes.Ldloc, builder);
} else {
ec.Emit (OpCodes.Ldloca, builder);
}
}
示例12: AddressOf
public void AddressOf (EmitContext ec, AddressOp mode)
{
GetFieldExpression (ec).AddressOf (ec, mode);
}
示例13: AddressOf
public void AddressOf (EmitContext ec, AddressOp mode)
{
if (builder == null)
builder = ec.GetTemporaryLocal (is_address ? TypeManager.GetReferenceType (type): type);
// if is_address, than this is just the address anyways,
// so we just return this.
ILGenerator ig = ec.ig;
if (is_address)
ig.Emit (OpCodes.Ldloc, builder);
else
ig.Emit (OpCodes.Ldloca, builder);
}