[Mesa-dev] [PATCH 1/4] clover: remove compat classes that match std one

EdB edb+mesa at sigluy.net
Fri Apr 24 03:59:54 PDT 2015


---
 src/gallium/state_trackers/clover/Makefile.sources |  1 -
 src/gallium/state_trackers/clover/api/program.cpp  |  2 +-
 .../state_trackers/clover/core/compiler.hpp        |  2 +-
 src/gallium/state_trackers/clover/core/error.hpp   |  6 ++--
 src/gallium/state_trackers/clover/util/compat.cpp  | 38 ----------------------
 src/gallium/state_trackers/clover/util/compat.hpp  | 27 ---------------
 6 files changed, 6 insertions(+), 70 deletions(-)
 delete mode 100644 src/gallium/state_trackers/clover/util/compat.cpp

diff --git a/src/gallium/state_trackers/clover/Makefile.sources b/src/gallium/state_trackers/clover/Makefile.sources
index 5b3344c..03eb754 100644
--- a/src/gallium/state_trackers/clover/Makefile.sources
+++ b/src/gallium/state_trackers/clover/Makefile.sources
@@ -45,7 +45,6 @@ CPP_SOURCES := \
 	util/adaptor.hpp \
 	util/algebra.hpp \
 	util/algorithm.hpp \
-	util/compat.cpp \
 	util/compat.hpp \
 	util/factor.hpp \
 	util/functional.hpp \
diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp
index 60184ed..c985690 100644
--- a/src/gallium/state_trackers/clover/api/program.cpp
+++ b/src/gallium/state_trackers/clover/api/program.cpp
@@ -216,7 +216,7 @@ clCompileProgram(cl_program d_prog, cl_uint num_devs,
             throw error(CL_INVALID_OPERATION);
 
          if (!any_of(key_equals(name), headers))
-            headers.push_back(compat::pair<compat::string, compat::string>(
+            headers.push_back(std::pair<compat::string, compat::string>(
                                  name, header.source()));
       },
       range(header_names, num_headers),
diff --git a/src/gallium/state_trackers/clover/core/compiler.hpp b/src/gallium/state_trackers/clover/core/compiler.hpp
index 7210d1e..bec8aac 100644
--- a/src/gallium/state_trackers/clover/core/compiler.hpp
+++ b/src/gallium/state_trackers/clover/core/compiler.hpp
@@ -29,7 +29,7 @@
 #include "pipe/p_defines.h"
 
 namespace clover {
-   typedef compat::vector<compat::pair<compat::string,
+   typedef compat::vector<std::pair<compat::string,
                                        compat::string> > header_map;
 
    module compile_program_llvm(const compat::string &source,
diff --git a/src/gallium/state_trackers/clover/core/error.hpp b/src/gallium/state_trackers/clover/core/error.hpp
index 7b010f1..45a38c1 100644
--- a/src/gallium/state_trackers/clover/core/error.hpp
+++ b/src/gallium/state_trackers/clover/core/error.hpp
@@ -25,6 +25,8 @@
 
 #include "CL/cl.h"
 
+#include <stdexcept>
+
 #include "util/compat.hpp"
 
 namespace clover {
@@ -50,10 +52,10 @@ namespace clover {
    /// Class that represents an error that can be converted to an
    /// OpenCL status code.
    ///
-   class error : public compat::runtime_error {
+   class error : public std::runtime_error {
    public:
       error(cl_int code, compat::string what = "") :
-         compat::runtime_error(what), code(code) {
+         std::runtime_error(what), code(code) {
       }
 
       cl_int get() const {
diff --git a/src/gallium/state_trackers/clover/util/compat.cpp b/src/gallium/state_trackers/clover/util/compat.cpp
deleted file mode 100644
index 80d5b3e..0000000
--- a/src/gallium/state_trackers/clover/util/compat.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// Copyright 2013 Francisco Jerez
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the "Software"),
-// to deal in the Software without restriction, including without limitation
-// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-// and/or sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#include "util/compat.hpp"
-
-using namespace clover::compat;
-
-exception::~exception() {
-}
-
-const char *
-exception::what() const {
-   return "";
-}
-
-const char *
-runtime_error::what() const {
-   return _what.c_str();
-}
diff --git a/src/gallium/state_trackers/clover/util/compat.hpp b/src/gallium/state_trackers/clover/util/compat.hpp
index 735994f..ea7d3a0 100644
--- a/src/gallium/state_trackers/clover/util/compat.hpp
+++ b/src/gallium/state_trackers/clover/util/compat.hpp
@@ -411,33 +411,6 @@ namespace clover {
       private:
          mutable vector<char> v;
       };
-
-      template<typename T, typename S>
-      struct pair {
-         pair(T first, S second) :
-            first(first), second(second) {}
-
-         T first;
-         S second;
-      };
-
-      class exception {
-      public:
-         exception() {}
-         virtual ~exception();
-
-         virtual const char *what() const;
-      };
-
-      class runtime_error : public exception {
-      public:
-         runtime_error(const string &what) : _what(what) {}
-
-         virtual const char *what() const;
-
-      protected:
-         string _what;
-      };
    }
 }
 
-- 
2.3.6



More information about the mesa-dev mailing list