Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/SemaExpr.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 19,365 Lines • ▼ Show 20 Lines | if (Proto) { | ||||
// This is a hack, but it is far superior to moving the | // This is a hack, but it is far superior to moving the | ||||
// corresponding target-specific code from IR-gen to Sema/AST. | // corresponding target-specific code from IR-gen to Sema/AST. | ||||
ArrayRef<QualType> ParamTypes = Proto->getParamTypes(); | ArrayRef<QualType> ParamTypes = Proto->getParamTypes(); | ||||
SmallVector<QualType, 8> ArgTypes; | SmallVector<QualType, 8> ArgTypes; | ||||
if (ParamTypes.empty() && Proto->isVariadic()) { // the special case | if (ParamTypes.empty() && Proto->isVariadic()) { // the special case | ||||
ArgTypes.reserve(E->getNumArgs()); | ArgTypes.reserve(E->getNumArgs()); | ||||
for (unsigned i = 0, e = E->getNumArgs(); i != e; ++i) { | for (unsigned i = 0, e = E->getNumArgs(); i != e; ++i) { | ||||
Expr *Arg = E->getArg(i); | ArgTypes.push_back(S.Context.getReferenceQualifiedType(E->getArg(i))); | ||||
QualType ArgType = Arg->getType(); | |||||
if (E->isLValue()) { | |||||
ArgType = S.Context.getLValueReferenceType(ArgType); | |||||
} else if (E->isXValue()) { | |||||
ArgType = S.Context.getRValueReferenceType(ArgType); | |||||
} | |||||
ArgTypes.push_back(ArgType); | |||||
} | } | ||||
ParamTypes = ArgTypes; | ParamTypes = ArgTypes; | ||||
} | } | ||||
DestType = S.Context.getFunctionType(DestType, ParamTypes, | DestType = S.Context.getFunctionType(DestType, ParamTypes, | ||||
Proto->getExtProtoInfo()); | Proto->getExtProtoInfo()); | ||||
} else { | } else { | ||||
DestType = S.Context.getFunctionNoProtoType(DestType, | DestType = S.Context.getFunctionNoProtoType(DestType, | ||||
FnType->getExtInfo()); | FnType->getExtInfo()); | ||||
▲ Show 20 Lines • Show All 473 Lines • Show Last 20 Lines |