clover: remove compat classes that match std one
authorEdB <edb+mesa@sigluy.net>
Fri, 24 Apr 2015 10:59:54 +0000 (12:59 +0200)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 29 Apr 2015 12:44:53 +0000 (12:44 +0000)
Acked-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
src/gallium/state_trackers/clover/Makefile.sources
src/gallium/state_trackers/clover/api/program.cpp
src/gallium/state_trackers/clover/core/compiler.hpp
src/gallium/state_trackers/clover/core/error.hpp
src/gallium/state_trackers/clover/util/compat.cpp [deleted file]
src/gallium/state_trackers/clover/util/compat.hpp

index 5b3344c63ffade0c7fc83c690b56a53de9bb57dc..03eb754e90360004862db9f79f2029d8c344bf97 100644 (file)
@@ -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 \
index 60184ed10b86b7f6c9847b10a809c51604191a49..c9856901c2e59d24812855f389b6cbb77d763f33 100644 (file)
@@ -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),
index 7210d1e9cdc5ac17a3d9b422d6f876d9555de37c..bec8aacf65dc51388364bd5385d9283e329a17e6 100644 (file)
@@ -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,
index 7b010f1b1dd0f8310a0663c6924e6d22d8c71c88..45a38c1165b00dd381f8b4c661c4fe29986461b5 100644 (file)
@@ -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 (file)
index 80d5b3e..0000000
+++ /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();
-}
index 735994f50a662af50592f87b22e78ce2198bcfa7..ea7d3a000beb52124c1a5843e81e1dd02d5ec994 100644 (file)
@@ -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;
-      };
    }
 }