summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-07-08 20:23:18 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-07-08 20:23:18 +0000
commitcb1ad6f58240cceb5d387f0ce13e49e496662553 (patch)
tree483de5cf3cb944865f6785be760c7d28636327cc /clang/lib/CodeGen/CodeGenFunction.cpp
parent074736f576ffaf60f4fdcf136517e7327b2c3ed8 (diff)
downloadbcm5719-llvm-cb1ad6f58240cceb5d387f0ce13e49e496662553.tar.gz
bcm5719-llvm-cb1ad6f58240cceb5d387f0ce13e49e496662553.zip
Remove unnecessary check for NULL
llvm-svn: 212564
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 4b202e136d5..0987673bb2b 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -788,16 +788,13 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
// of the declaration as the location for the subprogram. A function
// may lack a declaration in the source code if it is created by code
// gen. (examples: _GLOBAL__I_a, __cxx_global_array_dtor, thunk).
- SourceLocation Loc;
- if (FD) {
- Loc = FD->getLocation();
-
- // If this is a function specialization then use the pattern body
- // as the location for the function.
- if (const FunctionDecl *SpecDecl = FD->getTemplateInstantiationPattern())
- if (SpecDecl->hasBody(SpecDecl))
- Loc = SpecDecl->getLocation();
- }
+ SourceLocation Loc = FD->getLocation();
+
+ // If this is a function specialization then use the pattern body
+ // as the location for the function.
+ if (const FunctionDecl *SpecDecl = FD->getTemplateInstantiationPattern())
+ if (SpecDecl->hasBody(SpecDecl))
+ Loc = SpecDecl->getLocation();
// Emit the standard function prologue.
StartFunction(GD, ResTy, Fn, FnInfo, Args, Loc, BodyRange.getBegin());
OpenPOWER on IntegriCloud