[Bf-blender-cvs] [1fc5680] object_nodes: Cleanup: Renamed Value class to NodeValue, to distinguish from llvm::Value easier.
Lukas Tönne
noreply at git.blender.org
Tue Apr 5 16:33:27 CEST 2016
Commit: 1fc5680442fd3514d046ff9a6ef9cace6c549ad7
Author: Lukas Tönne
Date: Tue Apr 5 16:26:38 2016 +0200
Branches: object_nodes
https://developer.blender.org/rB1fc5680442fd3514d046ff9a6ef9cace6c549ad7
Cleanup: Renamed Value class to NodeValue, to distinguish from llvm::Value easier.
===================================================================
M source/blender/blenvm/compile/CMakeLists.txt
M source/blender/blenvm/compile/bvm_codegen.cc
M source/blender/blenvm/compile/bvm_codegen.h
M source/blender/blenvm/compile/bvm_codegen_debug.cc
A source/blender/blenvm/compile/node_graph.cc
A source/blender/blenvm/compile/node_graph.h
A source/blender/blenvm/compile/node_value.cc
A source/blender/blenvm/compile/node_value.h
D source/blender/blenvm/compile/nodegraph.cc
D source/blender/blenvm/compile/nodegraph.h
M source/blender/blenvm/compile/typedesc.cc
M source/blender/blenvm/compile/typedesc.h
D source/blender/blenvm/compile/value.cc
D source/blender/blenvm/compile/value.h
M source/blender/blenvm/intern/bvm_api.cc
M source/blender/blenvm/llvm/llvm_codegen.cc
M source/blender/blenvm/llvm/llvm_codegen.h
M source/blender/blenvm/util/util_debug.h
===================================================================
diff --git a/source/blender/blenvm/compile/CMakeLists.txt b/source/blender/blenvm/compile/CMakeLists.txt
index 5e10574..d7e120c 100644
--- a/source/blender/blenvm/compile/CMakeLists.txt
+++ b/source/blender/blenvm/compile/CMakeLists.txt
@@ -40,12 +40,12 @@ set(INC_SYS
)
set(SRC
- nodegraph.cc
- nodegraph.h
+ node_graph.cc
+ node_graph.h
+ node_value.cc
+ node_value.h
typedesc.cc
typedesc.h
- value.cc
- value.h
bvm_codegen.cc
bvm_codegen_debug.cc
diff --git a/source/blender/blenvm/compile/bvm_codegen.cc b/source/blender/blenvm/compile/bvm_codegen.cc
index 230ef56..59c67d2 100644
--- a/source/blender/blenvm/compile/bvm_codegen.cc
+++ b/source/blender/blenvm/compile/bvm_codegen.cc
@@ -32,7 +32,7 @@
#include <cstdio>
#include <set>
-#include "nodegraph.h"
+#include "node_graph.h"
#include "bvm_codegen.h"
#include "bvm_eval.h"
@@ -232,7 +232,7 @@ void Compiler::resolve_symbols(const NodeGraph &graph)
}
-void Compiler::push_constant(const Value *value) const
+void Compiler::push_constant(const NodeValue *value) const
{
BLI_assert(value != NULL);
switch (value->typedesc().base_type()) {
@@ -294,7 +294,7 @@ void Compiler::push_constant(const Value *value) const
}
}
-void Compiler::codegen_value(const Value *value, StackIndex offset) const
+void Compiler::codegen_value(const NodeValue *value, StackIndex offset) const
{
switch (value->typedesc().base_type()) {
case BVM_FLOAT: {
diff --git a/source/blender/blenvm/compile/bvm_codegen.h b/source/blender/blenvm/compile/bvm_codegen.h
index 8438a61..9261c68 100644
--- a/source/blender/blenvm/compile/bvm_codegen.h
+++ b/source/blender/blenvm/compile/bvm_codegen.h
@@ -37,7 +37,7 @@
#include "MEM_guardedalloc.h"
-#include "nodegraph.h"
+#include "node_graph.h"
#include "bvm_instruction_list.h"
@@ -92,9 +92,9 @@ protected:
virtual int current_address() const = 0;
- void push_constant(const Value *value) const;
+ void push_constant(const NodeValue *value) const;
- void codegen_value(const Value *value, StackIndex offset) const;
+ void codegen_value(const NodeValue *value, StackIndex offset) const;
int codegen_node_block(const NodeBlock &block);
int codegen_graph(const NodeGraph &graph);
diff --git a/source/blender/blenvm/compile/bvm_codegen_debug.cc b/source/blender/blenvm/compile/bvm_codegen_debug.cc
index 3ad7a80..f8990b3 100644
--- a/source/blender/blenvm/compile/bvm_codegen_debug.cc
+++ b/source/blender/blenvm/compile/bvm_codegen_debug.cc
@@ -32,7 +32,7 @@
#include <cstdio>
#include <set>
-#include "nodegraph.h"
+#include "node_graph.h"
#include "bvm_codegen.h"
diff --git a/source/blender/blenvm/compile/nodegraph.cc b/source/blender/blenvm/compile/node_graph.cc
similarity index 98%
rename from source/blender/blenvm/compile/nodegraph.cc
rename to source/blender/blenvm/compile/node_graph.cc
index ab1a5bc..444590c 100644
--- a/source/blender/blenvm/compile/nodegraph.cc
+++ b/source/blender/blenvm/compile/node_graph.cc
@@ -37,7 +37,7 @@
#include <sstream>
#include <algorithm>
-#include "nodegraph.h"
+#include "node_graph.h"
#include "util_opcode.h"
#include "util_math.h"
@@ -46,7 +46,7 @@ namespace blenvm {
NodeInput::NodeInput(const string &name,
const TypeDesc &typedesc,
- Value *default_value,
+ NodeValue *default_value,
BVMInputValueType value_type) :
name(name),
typedesc(typedesc),
@@ -212,7 +212,7 @@ bool NodeType::verify_arguments(Module *module, LLVMContext &context, raw_ostrea
const NodeInput *NodeType::add_input(const string &name,
const string &type,
- Value *default_value,
+ NodeValue *default_value,
BVMInputValueType value_type)
{
BLI_assert(!find_input(name));
@@ -343,7 +343,7 @@ ConstOutputKey ConstInputKey::link() const
return ConstOutputKey();
}
-const Value *ConstInputKey::value() const
+const NodeValue *ConstInputKey::value() const
{
return node->input_value(socket->name);
}
@@ -400,12 +400,12 @@ void InputKey::link_set(const OutputKey &from) const
node->link_set(socket->name, from);
}
-const Value *InputKey::value() const
+const NodeValue *InputKey::value() const
{
return node->input_value(socket->name);
}
-void InputKey::value_set(Value *value) const
+void InputKey::value_set(NodeValue *value) const
{
node->input_value_set(socket->name, value);
}
@@ -524,7 +524,7 @@ bool NodeInstance::link_set(const string &name, const OutputKey &from)
return false;
}
-const Value *NodeInstance::input_value(const string &name) const
+const NodeValue *NodeInstance::input_value(const string &name) const
{
InputMap::const_iterator it = inputs.find(name);
if (it != inputs.end()) {
@@ -534,13 +534,13 @@ const Value *NodeInstance::input_value(const string &name) const
return type->find_input(name)->default_value;
}
-const Value *NodeInstance::input_value(int index) const
+const NodeValue *NodeInstance::input_value(int index) const
{
const NodeInput *socket = type->find_input(index);
return socket ? input_value(socket->name) : NULL;
}
-bool NodeInstance::input_value_set(const string &name, Value *value)
+bool NodeInstance::input_value_set(const string &name, NodeValue *value)
{
InputInstance &input = inputs[name];
if (input.value)
@@ -779,7 +779,7 @@ const NodeGraph::Input *NodeGraph::add_input(const string &name, const string &t
return &inputs.back();
}
-const NodeGraph::Output *NodeGraph::add_output(const string &name, const string &type, Value *default_value)
+const NodeGraph::Output *NodeGraph::add_output(const string &name, const string &type, NodeValue *default_value)
{
BLI_assert(!get_output(name));
const TypeDesc &typedesc = find_typedef(type);
@@ -789,7 +789,7 @@ const NodeGraph::Output *NodeGraph::add_output(const string &name, const string
/* ------------------------------------------------------------------------- */
-NodeInstance *NodeGraph::add_proxy(const TypeDesc &typedesc, Value *default_value)
+NodeInstance *NodeGraph::add_proxy(const TypeDesc &typedesc, NodeValue *default_value)
{
NodeInstance *node = NULL;
switch (typedesc.buffer_type()) {
@@ -831,7 +831,7 @@ NodeInstance *NodeGraph::add_proxy(const TypeDesc &typedesc, Value *default_valu
return node;
}
-OutputKey NodeGraph::add_value_node(Value *value)
+OutputKey NodeGraph::add_value_node(NodeValue *value)
{
NodeInstance *node = NULL;
switch (value->typedesc().base_type()) {
@@ -964,7 +964,7 @@ OutputKey NodeGraph::find_root(const OutputKey &key)
{
OutputKey root = key;
/* value is used to create a valid root node if necessary */
- const Value *value = NULL;
+ const NodeValue *value = NULL;
while (root && root.node->type->is_pass_node()) {
value = root.node->input_value(0);
root = root.node->link(0);
diff --git a/source/blender/blenvm/compile/nodegraph.h b/source/blender/blenvm/compile/node_graph.h
similarity index 93%
rename from source/blender/blenvm/compile/nodegraph.h
rename to source/blender/blenvm/compile/node_graph.h
index b87609e..3daf8af 100644
--- a/source/blender/blenvm/compile/nodegraph.h
+++ b/source/blender/blenvm/compile/node_graph.h
@@ -50,7 +50,7 @@ extern "C" {
#endif
}
-#include "value.h"
+#include "node_value.h"
#include "util_opcode.h"
#include "util_string.h"
@@ -65,13 +65,13 @@ struct NodeBlock;
struct NodeInput {
NodeInput(const string &name,
const TypeDesc &typedesc,
- Value *default_value,
+ NodeValue *default_value,
BVMInputValueType value_type);
~NodeInput();
string name;
TypeDesc typedesc;
- Value *default_value;
+ NodeValue *default_value;
BVMInputValueType value_type;
};
@@ -114,7 +114,7 @@ struct NodeType {
const NodeInput *add_input(const string &name,
const string &type,
- Value *default_value,
+ NodeValue *default_value,
BVMInputValueType value_type = INPUT_EXPRESSION);
const NodeOutput *add_output(const string &name,
@@ -175,7 +175,7 @@ struct ConstInputKey {
operator bool() const;
ConstOutputKey link() const;
- const Value *value() const;
+ const NodeValue *value() const;
BVMInputValueType value_type() const;
const NodeInstance *node;
@@ -193,8 +193,8 @@ struct InputKey {
OutputKey link() const;
void link_set(const OutputKey &from) const;
- const Value *value() const;
- void value_set(Value *value) const;
+ const NodeValue *value() const;
+ void value_set(NodeValue *value) const;
BVMInputValueType value_type() const;
NodeInstance *node;
@@ -212,7 +212,7 @@ struct NodeInstance {
{}
OutputKey link;
- Value *value;
+ NodeValue *value;
};
typedef std::map<string, InputInstance> InputMap;
@@ -238,14 +238,14 @@ struct NodeInstance {
OutputKey link(int index) const;
bool link_set(const string &name, const OutputKey &from);
- const Value *input_value(const string &name) const;
- const Value *input_value(int index) const;
- bool input_value_set(const string &name, Value *value);
+ const NodeValue *input_value(const string &name) const;
+ const NodeValue *input_value(int index) const;
+ bool input_value_set(const string &name, NodeValue *value);
template <typename T>
bool input_value_set(const string &name, const T &value)
{
const NodeInput *socket = type->find_input(name);
- return socket ? input_value_set(name, Value::create(socket->typedesc, value)) : false;
+ return socket ? input_value_set(name, NodeValue::create(socket->typedesc, value)) : false;
}
const NodeType *type;
@@ -352,12 +352,12 @@ struct NodeGraph {
void set_output_socket(const string &name, const OutputKey &key);
const Input *add_input(const string &name, const string &type);
- const Output *add_output(const string &name, const string &type, Value *default_value);
+ const Output *add_output(const string &name, const string &type, NodeValue *default_value);
template <typename T>
const Output *add_output(const string &name, const string &type, const T &
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list