本文整理汇总了C#中Microsoft.CodeAnalysis.CSharp.BoundFieldAccess.Update方法的典型用法代码示例。如果您正苦于以下问题:C# BoundFieldAccess.Update方法的具体用法?C# BoundFieldAccess.Update怎么用?C# BoundFieldAccess.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.CSharp.BoundFieldAccess
的用法示例。
在下文中一共展示了BoundFieldAccess.Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeFieldAccess
private BoundExpression MakeFieldAccess(
CSharpSyntaxNode syntax,
BoundExpression rewrittenReceiver,
FieldSymbol fieldSymbol,
ConstantValue constantValueOpt,
LookupResultKind resultKind,
TypeSymbol type,
BoundFieldAccess oldNodeOpt = null)
{
if (fieldSymbol.IsTupleField)
{
return MakeTupleFieldAccess(syntax, fieldSymbol, rewrittenReceiver, constantValueOpt, resultKind);
}
BoundExpression result = oldNodeOpt != null ?
oldNodeOpt.Update(rewrittenReceiver, fieldSymbol, constantValueOpt, resultKind, type) :
new BoundFieldAccess(syntax, rewrittenReceiver, fieldSymbol, constantValueOpt, resultKind, type);
if (fieldSymbol.IsFixed)
{
// a reference to a fixed buffer is translated into its address
result = new BoundConversion(syntax,
new BoundAddressOfOperator(syntax, result, syntax != null && SyntaxFacts.IsFixedStatementExpression(syntax), type, false),
new Conversion(ConversionKind.PointerToPointer), false, false, default(ConstantValue), type, false);
}
return result;
}
示例2: VisitFieldAccess
public override BoundNode VisitFieldAccess(BoundFieldAccess node)
{
BoundSpillSequence2 ss = null;
var receiver = VisitExpression(ref ss, node.ReceiverOpt);
return UpdateExpression(ss, node.Update(receiver, node.FieldSymbol, node.ConstantValueOpt, node.ResultKind, node.Type));
}
示例3: VisitFieldAccess
public override BoundNode VisitFieldAccess(BoundFieldAccess node)
{
BoundExpression receiverOpt = (BoundExpression)this.Visit(node.ReceiverOpt);
TypeSymbol type = this.VisitType(node.Type);
if (receiverOpt == null || receiverOpt.Kind != BoundKind.SpillSequence)
{
return node.Update(receiverOpt, node.FieldSymbol, node.ConstantValueOpt, node.ResultKind, type);
}
var spill = (BoundSpillSequence)receiverOpt;
return RewriteSpillSequence(spill,
node.Update(
spill.Value,
node.FieldSymbol,
node.ConstantValueOpt,
node.ResultKind,
type));
}