Skip to content

Commit 4311847

Browse files
committed
[geogram] Update to 1.6.5
1 parent bb9288a commit 4311847

270 files changed

Lines changed: 4212 additions & 91523 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ include(cmake/geogram.cmake)
3939

4040
set(VORPALINE_VERSION_MAJOR 1)
4141
set(VORPALINE_VERSION_MINOR 6)
42-
set(VORPALINE_VERSION_PATCH 4)
42+
set(VORPALINE_VERSION_PATCH 5)
4343
set(VORPALINE_VERSION ${VORPALINE_VERSION_MAJOR}.${VORPALINE_VERSION_MINOR}.${VORPALINE_VERSION_PATCH})
4444

4545
set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR})

CMakeOptions.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

cmake/platforms/Linux-gcc.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ endif()
4545
add_flags(CMAKE_CXX_FLAGS -frounding-math -ffp-contract=off)
4646
add_flags(CMAKE_C_FLAGS -frounding-math -ffp-contract=off)
4747

48+
# Activate AVX2 instruction set
49+
#add_flags(CMAKE_CXX_FLAGS -mavx2)
50+
#add_flags(CMAKE_C_FLAGS -mavx2)
51+
4852
# Activate c++ 2011
4953
add_flags(CMAKE_CXX_FLAGS -std=c++11)
5054

src/bin/fpg/AST.cpp

100755100644
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ namespace AST {
1919

2020
// be careful with order of global initialization, AST::Node depends on current_location!
2121
Location current_location;
22-
std::ostream* Node::os = NULL;
22+
std::ostream* Node::os = nullptr;
2323
std::string Node::context;
2424
//SymbolEnvironment Node::symbol_env;
2525

26-
Type *return_type = NULL;
26+
Type *return_type = nullptr;
2727

2828
LiteralExpression *literal_one = new LiteralExpression( 1 );
2929
LiteralExpression *literal_zero = new LiteralExpression( 0 );
@@ -50,7 +50,7 @@ struct Clone_postprocessing : public Generic_visitor {
5050

5151
Node*
5252
clone_prime( Node* n, Clone_context *context ) {
53-
if( context == NULL )
53+
if( context == nullptr )
5454
context = new Clone_context;
5555
// store n ... we need to do postprocessing on it
5656
n = n->clone( context );
@@ -150,16 +150,16 @@ ConditionalStatement::ConditionalStatement(
150150
) : cond(cond), then_branch(then_branch), else_branch(else_branch)
151151
{
152152
CompoundStatement *compound = dynamic_cast<CompoundStatement*>( then_branch );
153-
if( compound == NULL ) {
153+
if( compound == nullptr ) {
154154
StatementList *slist = new StatementList();
155155
slist->add( then_branch );
156156
this->then_branch = new CompoundStatement( slist );
157157
} else
158158
this->then_branch = compound;
159159

160-
if( else_branch != NULL ) {
160+
if( else_branch != nullptr ) {
161161
compound = dynamic_cast<CompoundStatement*>( else_branch );
162-
if( compound == NULL )
162+
if( compound == nullptr )
163163
{
164164
StatementList *slist = new StatementList();
165165
slist->add( else_branch );
@@ -223,7 +223,7 @@ TranslationUnit::add( FunctionDefinition *fun_def ) {
223223
// visitor
224224

225225
#define ACCEPT(CLASSNAME) \
226-
void CLASSNAME ::accept( Visitor *visitor ) { assert( visitor != NULL ); visitor->visit( this ); }
226+
void CLASSNAME ::accept( Visitor *visitor ) { assert( visitor != nullptr ); visitor->visit( this ); }
227227

228228
//ACCEPT(CastExpression)
229229
ACCEPT(LiteralExpression)
@@ -337,8 +337,8 @@ ExpressionStatement::clone( Clone_context *context ) {
337337

338338
ConditionalStatement*
339339
ConditionalStatement::clone( Clone_context *context ) {
340-
Statement *new_else_branch = NULL;
341-
if( else_branch != NULL )
340+
Statement *new_else_branch = nullptr;
341+
if( else_branch != nullptr )
342342
new_else_branch = else_branch->clone( context );
343343
return update_location( this, new ConditionalStatement( cond->clone( context ), then_branch->clone( context ), new_else_branch ) );
344344
}
@@ -362,7 +362,7 @@ StatementList::clone( Clone_context *context ) {
362362
VariableDeclaration*
363363
VariableDeclaration::clone( Clone_context *context ) {
364364
MSG("mapping var " << (unsigned int)var<< " to var " << (unsigned int)new_var )
365-
Variable *new_var = NULL;
365+
Variable *new_var = nullptr;
366366
if( context->var_map.find( var ) == context->var_map.end() ) {
367367
new_var = new Variable( var->id, var->type );
368368
context->var_map [ var ] = new_var;
@@ -382,7 +382,7 @@ CompoundStatement::clone( Clone_context *context ) {
382382
// only creates _one_ single new fundef
383383
FunctionDefinition*
384384
FunctionDefinition::clone( Clone_context *context ) {
385-
assert( context != NULL );
385+
assert( context != nullptr );
386386
// NOTE: not yet inserted in symbol_env!
387387
FunctionType *new_type = new FunctionType( *type );
388388

src/bin/fpg/ASTdump.cpp

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ AssignmentExpression::dump( int level ) {
8585
void
8686
FunctionCall::dump( int level ) {
8787
dumpPrefix( level );
88-
assert( fun_type != NULL );
88+
assert( fun_type != nullptr );
8989
std::cout << "funcall " << fun_type->id << std::endl;
9090
FOREACH_ARG
9191
(*it)->dump( level + 3 );
@@ -111,7 +111,7 @@ ConditionalStatement::dump( int level ) {
111111
dumpPrefix( level + 3);
112112
std::cout << "else" << std::endl;
113113
cond->dump( level + 3 );
114-
if( else_branch != NULL )
114+
if( else_branch != nullptr )
115115
else_branch->dump( level +3 );
116116
}
117117

src/bin/fpg/ASTtype.cpp

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Type*
192192
StatementList::computeType() {
193193
FOREACH_STATEMENT {
194194
Statement *stmt = *it;
195-
assert( stmt != NULL );
195+
assert( stmt != nullptr );
196196
stmt->getType();
197197
}
198198
return type_void;
@@ -203,7 +203,7 @@ Type*
203203
FunctionDefinition::computeType() {
204204
return_type = type->return_type;
205205
body->getType();
206-
return_type = NULL;
206+
return_type = nullptr;
207207
return type_void;
208208
}
209209

src/bin/fpg/Abstract_interpretation_visitor.cpp

100755100644
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <FPG/MSG.h>
1616

1717
Abstract_interpretation_visitor::Abstract_interpretation_visitor( Abstract_value* initial_value )
18-
: expression_value( NULL ), initial_value( initial_value )
18+
: expression_value( nullptr ), initial_value( initial_value )
1919
{}
2020

2121
void
@@ -52,7 +52,7 @@ void
5252
Abstract_interpretation_visitor::visit( AST::UnaryExpression* uexp ) {
5353
MSG( "" )
5454
analyze( uexp->e );
55-
//expression_value = NULL;
55+
//expression_value = nullptr;
5656
}
5757

5858
void
@@ -65,8 +65,8 @@ Abstract_interpretation_visitor::visit( AST::BinaryExpression* bexp) {
6565
expression_value = new_abstract_value();
6666
return;
6767
}
68-
assert( value1 != NULL );
69-
assert( value2 != NULL );
68+
assert( value1 != nullptr );
69+
assert( value2 != nullptr );
7070
switch( bexp->kind ) {
7171
case AST::BinaryExpression::ADD:
7272
expression_value = value1->add( value2, bexp );
@@ -119,7 +119,7 @@ void
119119
Abstract_interpretation_visitor::visit( AST::AssignmentExpression* aexp ) {
120120
// expression_value is passed upwards unchanged
121121
AST::IdentifierExpression *id_expr = dynamic_cast< AST::IdentifierExpression* >( aexp->e1 );
122-
if( id_expr != NULL ) {
122+
if( id_expr != nullptr ) {
123123
Variable *var = id_expr->var;
124124
Abstract_value *val = analyze( aexp->e2 );
125125
if( is_float(var->type) ) {
@@ -160,7 +160,7 @@ Abstract_interpretation_visitor::visit( AST::FunctionCall* funcall ) {
160160
// for non-external functions:
161161
if( !funcall->fun_type->is_extern ) {
162162
AST::FunctionDefinition *fun_def = funcall->called_function;
163-
assert( fun_def != NULL );
163+
assert( fun_def != nullptr );
164164
// now it's safe to create the new environment:
165165
value_env_stack.push( Value_environment() );
166166
std::vector< Abstract_value * >::iterator abs_arg_iter = abstract_arguments.begin();
@@ -176,7 +176,7 @@ Abstract_interpretation_visitor::visit( AST::FunctionCall* funcall ) {
176176
++abs_arg_iter;
177177
}
178178
}
179-
return_values.push( NULL );
179+
return_values.push( nullptr );
180180
analyze( fun_def->body );
181181
#if 0
182182
// NOTE: this is an ugly hack! in particular, if there was an assignment to one of the
@@ -201,7 +201,7 @@ Abstract_interpretation_visitor::visit( AST::FunctionCall* funcall ) {
201201
expression_value = return_values.top();
202202
return_values.pop();
203203
if( funcall->fun_type->getReturnType() != type_void ) {
204-
assert( expression_value != NULL );
204+
assert( expression_value != nullptr );
205205
MSG( "return value=" << expression_value )
206206
}
207207
} else
@@ -227,13 +227,13 @@ Abstract_interpretation_visitor::visit( AST::UnaryFunction* uf ) {
227227
void
228228
Abstract_interpretation_visitor::visit( AST::EmptyStatement* ) {
229229
// an emptystatement does not depend on anything
230-
assert( expression_value == NULL );
230+
assert( expression_value == nullptr );
231231
}
232232

233233
void
234234
Abstract_interpretation_visitor::visit( AST::ExpressionStatement* expr_stmt ) {
235235
analyze( expr_stmt->e );
236-
expression_value = NULL;
236+
expression_value = nullptr;
237237
}
238238

239239
void
@@ -275,7 +275,7 @@ Abstract_interpretation_visitor::visit( AST::Return* ret) {
275275
if( ret->e ) {
276276
analyze(ret->e);
277277
assert( return_values.size() > 0 );
278-
if( return_values.top() == NULL ) {
278+
if( return_values.top() == nullptr ) {
279279
MSG( "setting retval=" << expression_value )
280280
return_values.top() = expression_value;
281281
} else if( is_float( ret->e->getType() ) && return_values.top() != expression_value ) {
@@ -284,7 +284,7 @@ Abstract_interpretation_visitor::visit( AST::Return* ret) {
284284
MSG( "result: " << return_values.top() )
285285
}
286286
}
287-
expression_value = NULL;
287+
expression_value = nullptr;
288288
}
289289

290290
void
@@ -293,7 +293,7 @@ Abstract_interpretation_visitor::visit( AST::StatementList* slist ) {
293293
AST::Statement *stmt = *it;
294294
analyze(stmt);
295295
// statements have no expression value
296-
assert( expression_value == NULL );
296+
assert( expression_value == nullptr );
297297
}
298298
}
299299

@@ -306,7 +306,7 @@ void
306306
Abstract_interpretation_visitor::visit( AST::FunctionDefinition* fundef ) {
307307
MSG( fundef->type->id )
308308
value_env_stack.push( Value_environment() );
309-
return_values.push( NULL );
309+
return_values.push( nullptr );
310310
FunctionType::ParameterList::iterator it;
311311
for( it = fundef->type->parameters.begin(); it != fundef->type->parameters.end(); ++it ) {
312312
Variable *var = *it;
@@ -327,7 +327,7 @@ Abstract_interpretation_visitor::visit( AST::FunctionDefinition* fundef ) {
327327
// toplevel return values are ignored, they are most probably of integer type anyway.
328328
return_values.pop();
329329
assert( return_values.size() == 0 );
330-
assert( expression_value == NULL );
330+
assert( expression_value == nullptr );
331331
}
332332

333333
void
@@ -349,7 +349,7 @@ Abstract_interpretation_visitor::get_analysis_result( AST::Expression *e ) {
349349
}*/
350350
assert( analysis_result.find(e) != analysis_result.end() );
351351
Abstract_value *val = analysis_result[ e ];
352-
assert( val != NULL );
352+
assert( val != nullptr );
353353
return val;
354354
} else if( is_int(e->getType()) )
355355
return new_abstract_value();
@@ -360,8 +360,8 @@ Abstract_interpretation_visitor::get_analysis_result( AST::Expression *e ) {
360360

361361
void
362362
Abstract_interpretation_visitor::update( AST::Expression *old_e, AST::Expression *new_e ) {
363-
assert( old_e != NULL );
364-
assert( new_e != NULL );
363+
assert( old_e != nullptr );
364+
assert( new_e != nullptr );
365365
if( is_float(old_e->getType()) ) {
366366
assert( is_float(new_e->getType()) );
367367
//old_e->dump(0);
@@ -419,18 +419,18 @@ Abstract_interpretation_visitor::is_defined_in_env( Variable* var ) {
419419

420420
Abstract_value*
421421
Abstract_interpretation_visitor::analyze( AST::Node* n ) {
422-
expression_value = NULL;
422+
expression_value = nullptr;
423423
//std::cout << "xxxxxx analyze " << (unsigned int)n << std::endl;
424424
if( !is_bound( n->getType() ) ) {
425425
//std::cout << "xxxxxx accept " << (unsigned int)n << std::endl;
426426
n->accept( this );
427-
if( is_float(n->getType()) && expression_value != NULL ) {
427+
if( is_float(n->getType()) && expression_value != nullptr ) {
428428
AST::Expression *e = dynamic_cast<AST::Expression*>(n);
429429
assert( e );
430430
//std::cout << "xxxxxx create " << (unsigned int)e << std::endl;
431431
analysis_result[ e ] = expression_value;
432432
}
433433
}
434-
return expression_value != NULL ? expression_value
434+
return expression_value != nullptr ? expression_value
435435
: new_abstract_value();
436436
}

src/bin/fpg/Declarator.cpp

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ IdentifierDeclarator::declare( Type *base_type, std::string &id ) const {
1111
Type*
1212
FunctionDeclarator::declare( Type *base_type, std::string &id ) const {
1313
// decl should be some form of IdentifierDeclarator. type not needed.
14-
decl->declare( NULL, id );
14+
decl->declare( nullptr, id );
1515

1616
// prepare function type
1717
FunctionType *fun = new FunctionType( id, base_type );

src/bin/fpg/Error_bound_value.cpp

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Error_bound_value::get_initial_value( Variable *var ) {
2121
Error_bound_value*
2222
Error_bound_value::downcast( Abstract_value* value ) {
2323
Error_bound_value *bound = dynamic_cast<Error_bound_value*>( value );
24-
assert( bound != NULL );
24+
assert( bound != nullptr );
2525
return bound;
2626
}
2727

src/bin/fpg/FPG/AST.h

100755100644
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct Clone_context {
3434

3535
struct Node {
3636
friend class ::Visitor;
37-
Node() : location(current_location), type(NULL) {}
37+
Node() : location(current_location), type(nullptr) {}
3838
virtual ~Node() {}
3939
static std::string context;
4040

@@ -215,7 +215,7 @@ struct AssignmentExpression : public Expression {
215215
typedef std::list< Expression* > ExpressionList;
216216

217217
struct FunctionCall : public Expression {
218-
FunctionCall( FunctionType *fun_type, ExpressionList *exp_list, FunctionDefinition *called_function = NULL )
218+
FunctionCall( FunctionType *fun_type, ExpressionList *exp_list, FunctionDefinition *called_function = nullptr )
219219
: fun_type( fun_type ),
220220
exp_list( exp_list ),
221221
called_function( called_function )
@@ -273,7 +273,7 @@ struct ExpressionStatement : public Statement {
273273
virtual void accept( Visitor *visitor );
274274
virtual ExpressionStatement* clone( Clone_context *context );
275275

276-
Expression *e; // can be NULL
276+
Expression *e; // can be nullptr
277277
};
278278

279279
typedef std::list< Statement*> StatementContainer;
@@ -311,7 +311,7 @@ struct CompoundStatement : public Statement {
311311
struct ConditionalStatement : public Statement {
312312
ConditionalStatement( Expression *cond,
313313
Statement *then_branch,
314-
Statement *else_branch = NULL );
314+
Statement *else_branch = nullptr );
315315
void dump( int level );
316316
virtual Type* computeType();
317317
bool hasBreakOrReturnOnExit();
@@ -342,14 +342,14 @@ struct Declaration : public Statement {
342342
};
343343

344344
struct VariableDeclaration : public Declaration {
345-
VariableDeclaration( Variable *var ) : var( var ), initializer(NULL) {}
345+
VariableDeclaration( Variable *var ) : var( var ), initializer(nullptr) {}
346346
void dump( int level );
347347
bool hasToplevelVariableDeclaration() { return true; }
348348
virtual void accept( Visitor *visitor );
349349
virtual VariableDeclaration* clone( Clone_context *context );
350350

351351
Variable *var;
352-
Expression *initializer; // only non-null after beautifying!
352+
Expression *initializer; // only non-nullptr after beautifying!
353353
};
354354

355355

@@ -419,10 +419,10 @@ extern Node* clone_prime( Node*, Clone_context *context );
419419

420420
template< class ASTElement >
421421
ASTElement*
422-
clone( ASTElement *e, Clone_context *context = NULL ) {
422+
clone( ASTElement *e, Clone_context *context = nullptr ) {
423423
AST::Node *n = clone_prime( e, context );
424424
e = dynamic_cast<ASTElement*>(n);
425-
assert(e != NULL);
425+
assert(e != nullptr);
426426
return e;
427427
}
428428

0 commit comments

Comments
 (0)