Commit d9b2c7da authored by Marc Chevrier's avatar Marc Chevrier
Browse files

Introduce memory management helper: cm_memory.hxx

parent 81389a5e
......@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCPackExternalGenerator.h"
#include "cmAlgorithms.h"
#include "cmCPackComponentGroup.h"
#include "cmCPackLog.h"
#include "cmMakefile.h"
......@@ -17,6 +16,8 @@
#include <utility>
#include <vector>
#include "cm_memory.hxx"
int cmCPackExternalGenerator::InitializeInternal()
{
this->SetOption("CPACK_EXTERNAL_KNOWN_VERSIONS", "1.0");
......
......@@ -11,7 +11,6 @@
#include "cmsys/RegularExpression.hxx"
#include <chrono>
#include <cmAlgorithms.h>
#include <cstdint>
#include <cstring>
#include <iomanip>
......@@ -20,6 +19,8 @@
#include <stdio.h>
#include <utility>
#include "cm_memory.hxx"
cmCTestRunTest::cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler)
: MultiTestHandler(multiHandler)
{
......
......@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestUpdateHandler.h"
#include "cmAlgorithms.h"
#include "cmCLocaleEnvironmentScope.h"
#include "cmCTest.h"
#include "cmCTestBZR.h"
......@@ -18,9 +17,10 @@
#include "cmXMLWriter.h"
#include <chrono>
#include <memory>
#include <sstream>
#include "cm_memory.hxx"
static const char* cmCTestUpdateHandlerUpdateStrings[] = {
"Unknown", "CVS", "SVN", "BZR", "GIT", "HG", "P4"
};
......
......@@ -11,7 +11,6 @@
#include <algorithm>
#include <functional>
#include <iterator>
#include <memory>
#include <sstream>
#include <string.h>
#include <string>
......@@ -340,20 +339,6 @@ inline void cmStripSuffixIfExists(std::string& str, const std::string& suffix)
namespace cm {
#if defined(CMake_HAVE_CXX_MAKE_UNIQUE)
using std::make_unique;
#else
template <typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
#endif
#if __cplusplus >= 201703L || defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
using std::size;
......
......@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmBinUtilsLinuxELFLinker.h"
#include "cmAlgorithms.h"
#include "cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h"
#include "cmLDConfigLDConfigTool.h"
#include "cmMakefile.h"
......@@ -12,9 +12,10 @@
#include <cmsys/RegularExpression.hxx>
#include <memory>
#include <sstream>
#include "cm_memory.hxx"
static std::string ReplaceOrigin(const std::string& rpath,
const std::string& origin)
{
......
......@@ -12,6 +12,8 @@
#include <string>
#include <vector>
#include "cm_memory.hxx"
cmBinUtilsMacOSMachOLinker::cmBinUtilsMacOSMachOLinker(
cmRuntimeDependencyArchive* archive)
: cmBinUtilsLinker(archive)
......
......@@ -2,16 +2,17 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmBinUtilsWindowsPELinker.h"
#include "cmAlgorithms.h"
#include "cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.h"
#include "cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h"
#include "cmRuntimeDependencyArchive.h"
#include "cmSystemTools.h"
#include <memory>
#include <sstream>
#include <vector>
#include "cm_memory.hxx"
#ifdef _WIN32
# include <windows.h>
#endif
......
......@@ -15,7 +15,6 @@
#include <ctype.h>
#include <iostream>
#include <map>
#include <memory>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
......@@ -30,6 +29,8 @@
# include <unistd.h> // IWYU pragma: keep
#endif
#include "cm_memory.hxx"
#include "cmAlgorithms.h"
#include "cmCTestBuildAndTestHandler.h"
#include "cmCTestBuildHandler.h"
......
......@@ -23,6 +23,8 @@
#include <string.h>
#include <utility>
#include "cm_memory.hxx"
/*
This file computes an ordered list of link items to use when linking a
......
......@@ -2,13 +2,13 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCryptoHash.h"
#include "cmAlgorithms.h"
#include "cm_kwiml.h"
#include "cm_rhash.h"
#include "cmsys/FStream.hxx"
#include <string.h>
#include <memory>
#include "cm_memory.hxx"
static unsigned int const cmCryptoHashAlgoToId[] = {
/* clang-format needs this comment to break after the opening brace */
......
......@@ -20,11 +20,12 @@
#include "cmsys/FStream.hxx"
#include <assert.h>
#include <memory>
#include <sstream>
#include <string.h>
#include <utility>
#include "cm_memory.hxx"
static std::string cmExportFileGeneratorEscape(std::string const& str)
{
// Escape a property value for writing into a .cmake file.
......
......@@ -4,10 +4,10 @@
#include "cmsys/FStream.hxx"
#include <map>
#include <memory>
#include <utility>
#include "cmAlgorithms.h"
#include "cm_memory.hxx"
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
......
......@@ -13,7 +13,6 @@
#include <cmath>
#include <ctype.h>
#include <map>
#include <memory>
#include <set>
#include <sstream>
#include <stdio.h>
......@@ -21,6 +20,8 @@
#include <utility>
#include <vector>
#include "cm_memory.hxx"
#include "cmAlgorithms.h"
#include "cmArgumentParser.h"
#include "cmCryptoHash.h"
......
......@@ -2,11 +2,12 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmFileTimes.h"
#include "cmAlgorithms.h"
#include "cm_sys_stat.h"
#include <utility>
#include "cm_memory.hxx"
#if defined(_WIN32)
# include "cmSystemTools.h"
# include <windows.h>
......
......@@ -13,12 +13,13 @@
#include <deque>
#include <functional>
#include <iterator>
#include <memory>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <utility>
#include "cm_memory.hxx"
#include "cmAlgorithms.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
......
......@@ -2,12 +2,12 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmForEachCommand.h"
#include <memory>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include "cmAlgorithms.h"
#include "cm_memory.hxx"
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
......
......@@ -9,10 +9,11 @@
#include <algorithm>
#include <ctype.h>
#include <iterator>
#include <memory>
#include <sstream>
#include <stdio.h>
#include "cm_memory.hxx"
#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
#include "cmFortranParser.h"
......
......@@ -4,10 +4,11 @@
#include <algorithm>
#include <functional>
#include <memory>
#include <sstream>
#include <utility>
#include "cm_memory.hxx"
#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
#include "cmGeneratedFileStream.h"
......
......@@ -5,11 +5,12 @@
#include "cmsys/RegularExpression.hxx"
#include <assert.h>
#include <iomanip>
#include <memory>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include "cm_memory.hxx"
#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
#include "cmCustomCommand.h"
......
......@@ -7,7 +7,6 @@
#include <assert.h>
#include <functional>
#include <iterator>
#include <memory>
#include <set>
#include <sstream>
#include <stdexcept>
......@@ -16,6 +15,8 @@
#include <utility>
#include <vector>
#include "cm_memory.hxx"
#include "cmAlgorithms.h"
#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment