Genex: Remove unnecessary check of context->Makefile

The context->Makefile is never NULL, but our checks for it convince
Clang scan-build that it might be NULL.  Then it warns about later
unchecked uses.  Drop the unnecessary checks.
This commit is contained in:
Brad King 2014-08-06 09:11:41 -04:00
parent 4ec6ff8f9f
commit c6acbc9063
1 changed files with 6 additions and 9 deletions

View File

@ -394,9 +394,8 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
cmGeneratorExpressionDAGChecker *,
const std::string &lang) const
{
const char *compilerId = context->Makefile ?
context->Makefile->GetSafeDefinition(
"CMAKE_" + lang + "_COMPILER_ID") : "";
const char *compilerId =
context->Makefile->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_ID");
if (parameters.size() == 0)
{
return compilerId ? compilerId : "";
@ -500,9 +499,8 @@ struct CompilerVersionNode : public cmGeneratorExpressionNode
cmGeneratorExpressionDAGChecker *,
const std::string &lang) const
{
const char *compilerVersion = context->Makefile ?
context->Makefile->GetSafeDefinition(
"CMAKE_" + lang + "_COMPILER_VERSION") : "";
const char *compilerVersion = context->Makefile->GetSafeDefinition(
"CMAKE_" + lang + "_COMPILER_VERSION");
if (parameters.size() == 0)
{
return compilerVersion ? compilerVersion : "";
@ -583,9 +581,8 @@ struct PlatformIdNode : public cmGeneratorExpressionNode
const GeneratorExpressionContent *,
cmGeneratorExpressionDAGChecker *) const
{
const char *platformId = context->Makefile ?
context->Makefile->GetSafeDefinition(
"CMAKE_SYSTEM_NAME") : "";
const char *platformId =
context->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME");
if (parameters.size() == 0)
{
return platformId ? platformId : "";