[Mesa-dev] [PATCH] st/clover: add space between < and ::
Nicolai Hähnle
nhaehnle at gmail.com
Wed Apr 19 12:34:38 UTC 2017
On 19.04.2017 13:05, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> As pointed out by compiler
>
> ./llvm/codegen.hpp:52:22: error: ‘<::’ cannot begin a template-argument list [-fpermissive]
> ./llvm/codegen.hpp:52:22: note: ‘<:’ is an alternate spelling for ‘[’. Insert whitespace between ‘<’ and ‘::’
>
> Cc: Francisco Jerez <currojerez at riseup.net>
> Cc: <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> Supersedes: HACK: st/clover: automake: set -fpermissive for clover/llvm
>
> Commit message is a bit ... any suggestions will be appreciated.
I believe C++17 fixes that (the digraph, not the commit message, which
is fine). Anyway,
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
> ---
> src/gallium/state_trackers/clover/llvm/codegen.hpp | 2 +-
> src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp | 4 ++--
> src/gallium/state_trackers/clover/llvm/codegen/common.cpp | 6 +++---
> src/gallium/state_trackers/clover/llvm/codegen/native.cpp | 2 +-
> src/gallium/state_trackers/clover/llvm/compat.hpp | 8 ++++----
> src/gallium/state_trackers/clover/llvm/metadata.hpp | 12 ++++++------
> 6 files changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/src/gallium/state_trackers/clover/llvm/codegen.hpp b/src/gallium/state_trackers/clover/llvm/codegen.hpp
> index 44971adb7dd..25f6e01beb5 100644
> --- a/src/gallium/state_trackers/clover/llvm/codegen.hpp
> +++ b/src/gallium/state_trackers/clover/llvm/codegen.hpp
> @@ -49,7 +49,7 @@ namespace clover {
> build_module_library(const ::llvm::Module &mod,
> enum module::section::type section_type);
>
> - std::unique_ptr<::llvm::Module>
> + std::unique_ptr< ::llvm::Module>
> parse_module_library(const module &m, ::llvm::LLVMContext &ctx,
> std::string &r_log);
>
> diff --git a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> index d09207b946a..6737f7af0aa 100644
> --- a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> @@ -94,7 +94,7 @@ clover::llvm::build_module_library(const ::llvm::Module &mod,
> return m;
> }
>
> -std::unique_ptr<::llvm::Module>
> +std::unique_ptr< ::llvm::Module>
> clover::llvm::parse_module_library(const module &m, ::llvm::LLVMContext &ctx,
> std::string &r_log) {
> auto mod = ::llvm::parseBitcodeFile(::llvm::MemoryBufferRef(
> @@ -104,5 +104,5 @@ clover::llvm::parse_module_library(const module &m, ::llvm::LLVMContext &ctx,
> fail(r_log, error(CL_INVALID_PROGRAM), s);
> });
>
> - return std::unique_ptr<::llvm::Module>(std::move(*mod));
> + return std::unique_ptr< ::llvm::Module>(std::move(*mod));
> }
> diff --git a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> index 3b0014d8797..075183400ae 100644
> --- a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> @@ -121,12 +121,12 @@ namespace {
> } else {
> // Other types.
> const auto actual_type =
> - isa<::llvm::PointerType>(arg_type) && arg.hasByValAttr() ?
> - cast<::llvm::PointerType>(arg_type)->getElementType() : arg_type;
> + isa< ::llvm::PointerType>(arg_type) && arg.hasByValAttr() ?
> + cast< ::llvm::PointerType>(arg_type)->getElementType() : arg_type;
>
> if (actual_type->isPointerTy()) {
> const unsigned address_space =
> - cast<::llvm::PointerType>(actual_type)->getAddressSpace();
> + cast< ::llvm::PointerType>(actual_type)->getAddressSpace();
>
> if (address_space == address_spaces[clang::LangAS::opencl_local
> - compat::lang_as_offset]) {
> diff --git a/src/gallium/state_trackers/clover/llvm/codegen/native.cpp b/src/gallium/state_trackers/clover/llvm/codegen/native.cpp
> index 4f24332f6b5..b9e67507192 100644
> --- a/src/gallium/state_trackers/clover/llvm/codegen/native.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/codegen/native.cpp
> @@ -156,7 +156,7 @@ clover::llvm::print_module_native(const ::llvm::Module &mod,
> const target &target) {
> std::string log;
> try {
> - std::unique_ptr<::llvm::Module> cmod { CloneModule(&mod) };
> + std::unique_ptr< ::llvm::Module> cmod { CloneModule(&mod) };
> return as_string(emit_code(*cmod, target,
> TargetMachine::CGFT_AssemblyFile, log));
> } catch (...) {
> diff --git a/src/gallium/state_trackers/clover/llvm/compat.hpp b/src/gallium/state_trackers/clover/llvm/compat.hpp
> index 987680cc3c0..cee51b9dd1b 100644
> --- a/src/gallium/state_trackers/clover/llvm/compat.hpp
> +++ b/src/gallium/state_trackers/clover/llvm/compat.hpp
> @@ -132,18 +132,18 @@ namespace clover {
> #endif
> }
>
> - inline std::unique_ptr<::llvm::Linker>
> + inline std::unique_ptr< ::llvm::Linker>
> create_linker(::llvm::Module &mod) {
> #if HAVE_LLVM >= 0x0308
> - return std::unique_ptr<::llvm::Linker>(new ::llvm::Linker(mod));
> + return std::unique_ptr< ::llvm::Linker>(new ::llvm::Linker(mod));
> #else
> - return std::unique_ptr<::llvm::Linker>(new ::llvm::Linker(&mod));
> + return std::unique_ptr< ::llvm::Linker>(new ::llvm::Linker(&mod));
> #endif
> }
>
> inline bool
> link_in_module(::llvm::Linker &linker,
> - std::unique_ptr<::llvm::Module> mod) {
> + std::unique_ptr< ::llvm::Module> mod) {
> #if HAVE_LLVM >= 0x0308
> return linker.linkInModule(std::move(mod));
> #else
> diff --git a/src/gallium/state_trackers/clover/llvm/metadata.hpp b/src/gallium/state_trackers/clover/llvm/metadata.hpp
> index 814c830b5ec..825008d4974 100644
> --- a/src/gallium/state_trackers/clover/llvm/metadata.hpp
> +++ b/src/gallium/state_trackers/clover/llvm/metadata.hpp
> @@ -51,7 +51,7 @@ namespace clover {
> is_kernel_node_for(const ::llvm::Function &f) {
> return [&](const ::llvm::MDNode *n) {
> using ::llvm::mdconst::dyn_extract;
> - return &f == dyn_extract<::llvm::Function>(n->getOperand(0));
> + return &f == dyn_extract< ::llvm::Function>(n->getOperand(0));
> };
> }
>
> @@ -65,7 +65,7 @@ namespace clover {
> #endif
> }
>
> - inline iterator_range<::llvm::MDNode::op_iterator>
> + inline iterator_range< ::llvm::MDNode::op_iterator>
> get_kernel_metadata_operands(const ::llvm::Function &f,
> const std::string &name) {
> #if HAVE_LLVM >= 0x0309
> @@ -79,11 +79,11 @@ namespace clover {
> const auto kernel_node = find(is_kernel_node_for(f),
> get_kernel_nodes(*f.getParent()));
>
> - const auto data_node = cast<::llvm::MDNode>(
> + const auto data_node = cast< ::llvm::MDNode>(
> find([&](const ::llvm::MDOperand &op) {
> - if (auto m = dyn_cast<::llvm::MDNode>(op))
> + if (auto m = dyn_cast< ::llvm::MDNode>(op))
> if (m->getNumOperands())
> - if (auto m_name = dyn_cast<::llvm::MDString>(
> + if (auto m_name = dyn_cast< ::llvm::MDString>(
> m->getOperand(0).get()))
> return m_name->getString() == name;
>
> @@ -106,7 +106,7 @@ namespace clover {
> get_argument_metadata(const ::llvm::Function &f,
> const ::llvm::Argument &arg,
> const std::string &name) {
> - return ::llvm::cast<::llvm::MDString>(
> + return ::llvm::cast< ::llvm::MDString>(
> detail::get_kernel_metadata_operands(f, name)[arg.getArgNo()])
> ->getString();
> }
>
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
More information about the mesa-dev
mailing list