Add semantic check for most of the restrictions for the declare directive. Reviewed By: kiranktp Differential Revision: https://reviews.llvm.org/D92741