Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/SemaDecl.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 11,888 Lines • ▼ Show 20 Lines | void Sema::CheckHLSLEntryPoint(FunctionDecl *FD) { | ||||||||||
case llvm::Triple::EnvironmentType::Compute: | case llvm::Triple::EnvironmentType::Compute: | ||||||||||
if (!FD->hasAttr<HLSLNumThreadsAttr>()) { | if (!FD->hasAttr<HLSLNumThreadsAttr>()) { | ||||||||||
Diag(FD->getLocation(), diag::err_hlsl_missing_numthreads) | Diag(FD->getLocation(), diag::err_hlsl_missing_numthreads) | ||||||||||
<< Triple.getEnvironmentName(); | << Triple.getEnvironmentName(); | ||||||||||
FD->setInvalidDecl(); | FD->setInvalidDecl(); | ||||||||||
} | } | ||||||||||
break; | break; | ||||||||||
} | } | ||||||||||
for (const auto *Param : FD->parameters()) { | |||||||||||
aaron.ballmanUnsubmitted Not Done ReplyInline Actions
aaron.ballman: | |||||||||||
if (!Param->hasAttr<HLSLAnnotationAttr>()) { | |||||||||||
Not Done ReplyInline ActionsWhen param type is struct, it is OK not to have HLSL semantic as long as all fields in the struct have HLSL semantic. python3kgae: When param type is struct, it is OK not to have HLSL semantic as long as all fields in the… | |||||||||||
My intent was to handle structs in a subsequent patch. Since we only have one semantic implemented right now we can't make a valid test for structs unless it is a single element struct which is not a robust test case. beanz: My intent was to handle structs in a subsequent patch. Since we only have one semantic… | |||||||||||
// FIXME: Handle struct parameters where annotations are on struct fields. | |||||||||||
Not Done ReplyInline ActionsWhat about checking for the function return type? aaron.ballman: What about checking for the function return type? | |||||||||||
Diag(FD->getLocation(), diag::err_hlsl_missing_semantic_annotation); | |||||||||||
Diag(Param->getLocation(), diag::note_previous_decl) << Param; | |||||||||||
FD->setInvalidDecl(); | |||||||||||
} | |||||||||||
} | |||||||||||
// FIXME: Verify return type semantic annotation. | |||||||||||
} | } | ||||||||||
bool Sema::CheckForConstantInitializer(Expr *Init, QualType DclT) { | bool Sema::CheckForConstantInitializer(Expr *Init, QualType DclT) { | ||||||||||
// FIXME: Need strict checking. In C89, we need to check for | // FIXME: Need strict checking. In C89, we need to check for | ||||||||||
// any assignment, increment, decrement, function-calls, or | // any assignment, increment, decrement, function-calls, or | ||||||||||
// commas outside of a sizeof. In C99, it's the same list, | // commas outside of a sizeof. In C99, it's the same list, | ||||||||||
// except that the aforementioned are allowed in unevaluated | // except that the aforementioned are allowed in unevaluated | ||||||||||
// expressions. Everything else falls under the | // expressions. Everything else falls under the | ||||||||||
▲ Show 20 Lines • Show All 7,631 Lines • Show Last 20 Lines |