Re: [Mesa-dev] [PATCH 3/4] glsl: Remove unused function import_prototypes

2016-10-14 Thread Timothy Arceri


On 15 October 2016 10:11:17 am AEDT, Kenneth Graunke  
wrote:
>On Friday, October 14, 2016 11:59:46 AM PDT Ian Romanick wrote:
>> From: Ian Romanick 
>> 
>> Once upon a time, this was used to extract prototypes from the shader
>> containing GLSL built-in functions.  This was removed by f5692f45 in
>> November 2010 for Mesa 7.10.
>> 
>> Signed-off-by: Ian Romanick 
>> Cc: Kenneth Graunke 
>
>Dead for 6 years, and we only now noticed...derp. :)  I wish there were
>better compiler warnings for things like this...

LibreOffice uses this [1]. Note the todo to make it a gcc plugin but I don't 
think there has been any progress towards that.

[1] http://www.skynet.ie/~caolan/Packages/callcatcher.html

>
>Series is:
>Reviewed-by: Kenneth Graunke 
>
>
>
>
>
>
>___
>mesa-dev mailing list
>mesa-dev@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/mesa-dev

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/4] glsl: Remove unused function import_prototypes

2016-10-14 Thread Kenneth Graunke
On Friday, October 14, 2016 11:59:46 AM PDT Ian Romanick wrote:
> From: Ian Romanick 
> 
> Once upon a time, this was used to extract prototypes from the shader
> containing GLSL built-in functions.  This was removed by f5692f45 in
> November 2010 for Mesa 7.10.
> 
> Signed-off-by: Ian Romanick 
> Cc: Kenneth Graunke 

Dead for 6 years, and we only now noticed...derp. :)  I wish there were
better compiler warnings for things like this...

Series is:
Reviewed-by: Kenneth Graunke 




signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/4] glsl: Remove unused function import_prototypes

2016-10-14 Thread Ian Romanick
From: Ian Romanick 

Once upon a time, this was used to extract prototypes from the shader
containing GLSL built-in functions.  This was removed by f5692f45 in
November 2010 for Mesa 7.10.

Signed-off-by: Ian Romanick 
Cc: Kenneth Graunke 
---
 src/compiler/Makefile.sources  |   1 -
 src/compiler/glsl/ir.h |   6 --
 src/compiler/glsl/ir_import_prototypes.cpp | 125 -
 3 files changed, 132 deletions(-)
 delete mode 100644 src/compiler/glsl/ir_import_prototypes.cpp

diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
index 712b33a..a30443d 100644
--- a/src/compiler/Makefile.sources
+++ b/src/compiler/Makefile.sources
@@ -46,7 +46,6 @@ LIBGLSL_FILES = \
glsl/ir_hierarchical_visitor.cpp \
glsl/ir_hierarchical_visitor.h \
glsl/ir_hv_accept.cpp \
-   glsl/ir_import_prototypes.cpp \
glsl/ir_optimization.h \
glsl/ir_print_visitor.cpp \
glsl/ir_print_visitor.h \
diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
index 7e06d42..3d28dd5 100644
--- a/src/compiler/glsl/ir.h
+++ b/src/compiler/glsl/ir.h
@@ -2378,12 +2378,6 @@ _mesa_glsl_release_builtin_functions(void);
 extern void
 reparent_ir(exec_list *list, void *mem_ctx);
 
-struct glsl_symbol_table;
-
-extern void
-import_prototypes(const exec_list *source, exec_list *dest,
- struct glsl_symbol_table *symbols, void *mem_ctx);
-
 extern void
 do_set_program_inouts(exec_list *instructions, struct gl_program *prog,
   gl_shader_stage shader_stage);
diff --git a/src/compiler/glsl/ir_import_prototypes.cpp 
b/src/compiler/glsl/ir_import_prototypes.cpp
deleted file mode 100644
index b0429fb..000
--- a/src/compiler/glsl/ir_import_prototypes.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * 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 (including the next
- * paragraph) 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.
- */
-
-/**
- * \file ir_import_prototypes.cpp
- * Import function prototypes from one IR tree into another.
- *
- * \author Ian Romanick
- */
-#include "ir.h"
-#include "glsl_symbol_table.h"
-
-namespace {
-
-/**
- * Visitor used to import function prototypes
- *
- * Normally the \c clone method of either \c ir_function or
- * \c ir_function_signature could be used.  However, we don't want a complete
- * clone of the \c ir_function_signature.  We want everything \b except the
- * body of the function.
- */
-class import_prototype_visitor : public ir_hierarchical_visitor {
-public:
-   /**
-*/
-   import_prototype_visitor(exec_list *list, glsl_symbol_table *symbols,
-   void *mem_ctx)
-   {
-  this->mem_ctx = mem_ctx;
-  this->list = list;
-  this->symbols = symbols;
-  this->function = NULL;
-   }
-
-   virtual ir_visitor_status visit_enter(ir_function *ir)
-   {
-  assert(this->function == NULL);
-
-  this->function = this->symbols->get_function(ir->name);
-  if (!this->function) {
-this->function = new(this->mem_ctx) ir_function(ir->name);
-
-list->push_tail(this->function);
-
-/* Add the new function to the symbol table.
- */
-this->symbols->add_function(this->function);
-  }
-  return visit_continue;
-   }
-
-   virtual ir_visitor_status visit_leave(ir_function *ir)
-   {
-  (void) ir;
-  assert(this->function != NULL);
-
-  this->function = NULL;
-  return visit_continue;
-   }
-
-   ir_visitor_status visit_enter(ir_function_signature *ir)
-   {
-  assert(this->function != NULL);
-
-  ir_function_signature *copy = ir->clone_prototype(mem_ctx, NULL);
-
-  this->function->add_signature(copy);
-
-  /* Do not process child nodes of the ir_function_signature.  There can
-   * never be any nodes inside the ir_function_signature that we care
-   * about.  Instead continue with the next sibling.
-   */
-  return visit_conti