tools/clang/lib/Sema/SemaHLSL.cpp
/// Checks whether a usage attribute is compatible with those seen so far and
/// maintains history.
Checks whether a usage attribute is compatible with those seen so far and
maintains history.
Checks whether a usage attribute is compatible with those seen so far and maintains history .
static bool IsUsageAttributeCompatible(AttributeList::Kind kind, bool &usageIn,
                                       bool &usageOut) {
  switch (kind) {
  case AttributeList::AT_HLSLIn:
    if (usageIn)
      return false;
    usageIn = true;
    break;
  case AttributeList::AT_HLSLOut:
    if (usageOut)
      return false;
    usageOut = true;
    break;
  default:
    assert(kind == AttributeList::AT_HLSLInOut);
    if (usageOut || usageIn)
      return false;
    usageIn = usageOut = true;
    break;
  }
  return true;
}
static bool IsUsageAttributeCompatible ( AttributeList :: Kind kind , bool & usageIn , bool & usageOut ) { switch ( kind ) { case AttributeList :: AT_HLSLIn : if ( usageIn ) return false ; usageIn = true ; break ; case AttributeList :: AT_HLSLOut : if ( usageOut ) return false ; usageOut = true ; break ; default : assert ( kind == AttributeList :: AT_HLSLInOut ) ; if ( usageOut || usageIn ) return false ; usageIn = usageOut = true ; break ; } return true ; }
Checks whether a usage attribute is compatible with those seen so far and
maintains history.
Checks whether a usage attribute is compatible with those seen so far and maintains history .