Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/pac_datadep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ void RequiresAnalyzerContext::ProcessExpr(Expr* expr) {

bool RequiresAnalyzerContext::compute(DataDepElement* element) {
RequiresAnalyzerContext visitor;
element->Traverse(&visitor);
// This result is intentionally ignored. We want to traverse, but always return
// the same result.
std::ignore = element->Traverse(&visitor);
return visitor.requires_analyzer_context_;
}
22 changes: 12 additions & 10 deletions src/pac_expr.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#ifndef pac_expr_h
#define pac_expr_h

#include <cstdint>

#include "pac_common.h"
#include "pac_datadep.h"

class CaseExpr;

class Expr : public Object, public DataDepElement {
public:
enum ExprType {
enum ExprType : uint8_t {
#define EXPR_DEF(type, x, y) type,
#include "pac_expr.def"
#undef EXPR_DEF
Expand Down Expand Up @@ -93,16 +95,16 @@ class Expr : public Object, public DataDepElement {
private:
ExprType expr_type_;

int num_operands_;
Expr* operand_[3];
int num_operands_ = 0;
Expr* operand_[3] = {nullptr};

ID* id_; // EXPR_ID
Number* num_; // EXPR_NUM
ConstString* cstr_; // EXPR_CSTR
RegEx* regex_; // EXPR_REGEX
ExprList* args_; // EXPR_CALLARGS
CaseExprList* cases_; // EXPR_CASE
Nullptr* nullp_; // EXPR_NULLPTR
ID* id_ = nullptr; // EXPR_ID
Number* num_ = nullptr; // EXPR_NUM
ConstString* cstr_ = nullptr; // EXPR_CSTR
RegEx* regex_ = nullptr; // EXPR_REGEX
ExprList* args_ = nullptr; // EXPR_CALLARGS
CaseExprList* cases_ = nullptr; // EXPR_CASE
Nullptr* nullp_ = nullptr; // EXPR_NULLPTR

string str_; // value string
string orig_; // original string for debugging info
Expand Down
2 changes: 1 addition & 1 deletion src/pac_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void add_to_include_directories(string dirs) {
if ( dir.length() > 0 && *(dir.end() - 1) != '/' )
dir += '/';

FLAGS_include_directories.push_back(dir);
FLAGS_include_directories.push_back(std::move(dir));
dir_begin = dir_end + 1;
}
}
Expand Down
Loading