Fix a potential null-pointer use, and fix the style of my new function.
Thanks, Anton!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95821 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/TargetAttributesSema.cpp b/lib/Sema/TargetAttributesSema.cpp
index ab54949..9062d36 100644
--- a/lib/Sema/TargetAttributesSema.cpp
+++ b/lib/Sema/TargetAttributesSema.cpp
@@ -83,10 +83,10 @@
   // do anything, either. It doesn't matter anyway, because there's nothing
   // special about calling a force_align_arg_pointer function.
   ValueDecl* VD = dyn_cast<ValueDecl>(D);
-  if(VD->getType()->isFunctionPointerType())
+  if (VD && VD->getType()->isFunctionPointerType())
     return;
   // Attribute can only be applied to function types.
-  if(!isa<FunctionDecl>(D)) {
+  if (!isa<FunctionDecl>(D)) {
     S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
       << Attr.getName() << /* function */0;
     return;