瀏覽代碼

Remove include flags memoization.

Stephen Kelly 14 年之前
父節點
當前提交
7620932d82
共有 2 個文件被更改,包括 3 次插入15 次删除
  1. 2 13
      Source/cmLocalGenerator.cxx
  2. 1 2
      Source/cmLocalGenerator.h

+ 2 - 13
Source/cmLocalGenerator.cxx

@@ -1196,7 +1196,7 @@ cmLocalGenerator::ConvertToIncludeReference(std::string const& path)
 }
 
 //----------------------------------------------------------------------------
-const char* cmLocalGenerator::GetIncludeFlags(
+std::string cmLocalGenerator::GetIncludeFlags(
                                      const std::vector<std::string> &includes,
                                      const char* lang, bool forResponseFile)
 {
@@ -1204,12 +1204,6 @@ const char* cmLocalGenerator::GetIncludeFlags(
     {
     return "";
     }
-  std::string key = lang;
-  key += forResponseFile? "@" : "";
-  if(this->LanguageToIncludeFlags.count(key))
-    {
-    return this->LanguageToIncludeFlags[key].c_str();
-    }
 
   cmOStringStream includeFlags;
 
@@ -1314,12 +1308,7 @@ const char* cmLocalGenerator::GetIncludeFlags(
     {
     flags[flags.size()-1] = ' ';
     }
-  this->LanguageToIncludeFlags[key] = flags;
-
-  // Use this temorary variable for the return value to work-around a
-  // bogus GCC 2.95 warning.
-  const char* ret = this->LanguageToIncludeFlags[key].c_str();
-  return ret;
+  return flags;
 }
 
 //----------------------------------------------------------------------------

+ 1 - 2
Source/cmLocalGenerator.h

@@ -146,7 +146,7 @@ public:
   ///! Append flags to a string.
   virtual void AppendFlags(std::string& flags, const char* newFlags);
   ///! Get the include flags for the current makefile and language
-  const char* GetIncludeFlags(const std::vector<std::string> &includes,
+  std::string GetIncludeFlags(const std::vector<std::string> &includes,
                               const char* lang, bool forResponseFile = false);
 
   /**
@@ -392,7 +392,6 @@ protected:
   std::vector<std::string> StartOutputDirectoryComponents;
   cmLocalGenerator* Parent;
   std::vector<cmLocalGenerator*> Children;
-  std::map<cmStdString, cmStdString> LanguageToIncludeFlags;
   std::map<cmStdString, cmStdString> UniqueObjectNamesMap;
   std::string::size_type ObjectPathMax;
   std::set<cmStdString> ObjectMaxPathViolations;