Commit b9b00e93 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Turn on some more warnings, though the ones that don't have many false...

Turn on some more warnings, though the ones that don't have many false positives aren't very helpful
parent fe82c46c
...@@ -126,11 +126,15 @@ else ...@@ -126,11 +126,15 @@ else
endif endif
# Extra flags to enable soon: # Extra flags to enable soon:
# COMMON_CXXFLAGS += -Wold-style-cast -Wconversion -Wsign-conversion -Wnon-virtual-dtor -Winit-self -Wimplicit-int -Wmissing-include-dirs -Wswitch-enum -Wunused-variable -Wunused -Wstrict-overflow=5 -Wfloat-equal -Wtraditional-conversion -Wundef -Wunsafe-loop-optimizations -Wpointer-arith -Wtype-limits -Wwrite-strings -Wclobbered -Wconversion -Wempty-body -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-declaration -Wold-style-definition -Wmissing-parameter-type -Wmissing-field-initializers -Wredundant-decls -Wnested-externs -Winline -Wint-to-pointer-cast -Wpointer-to-int-cast -Wlong-long -Wvla COMMON_CXXFLAGS += -Wno-sign-conversion -Wnon-virtual-dtor -Winit-self -Wimplicit-int -Wmissing-include-dirs -Wstrict-overflow=5 -Wundef -Wpointer-arith -Wtype-limits -Wwrite-strings -Wempty-body -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-field-initializers -Wredundant-decls -Wnested-externs -Winline -Wint-to-pointer-cast -Wpointer-to-int-cast -Wlong-long -Wvla
# Want this one but there's a lot of places that I haven't followed it:
# COMMON_CXXFLAGS += -Wold-style-cast
# llvm headers fail on this one:
# COMMON_CXXFLAGS += -Wswitch-enum
# Not sure about these: # Not sure about these:
# COMMON_CXXFLAGS += -Wbad-function-cast -Wcast-qual -Wcast-align -Wmissing-prototypes -Wunreachable-code # COMMON_CXXFLAGS += -Wbad-function-cast -Wcast-qual -Wcast-align -Wmissing-prototypes -Wunreachable-code -Wfloat-equal -Wunused -Wunused-variable
# Or everything: # Or everything:
# COMMON_CXXFLAGS += -Weverything # COMMON_CXXFLAGS += -Weverything -Wno-c++98-compat-pedantic -Wno-shadow -Wno-padded -Wno-zero-length-array
# libunwind's include files warn on -Wextern-c-compat, so turn that off; # libunwind's include files warn on -Wextern-c-compat, so turn that off;
# ideally would just turn it off for header files in libunwind, maybe by # ideally would just turn it off for header files in libunwind, maybe by
......
...@@ -28,6 +28,8 @@ class BBAnalyzer { ...@@ -28,6 +28,8 @@ class BBAnalyzer {
typedef std::unordered_map<std::string, T> Map; typedef std::unordered_map<std::string, T> Map;
typedef std::unordered_map<CFGBlock*, Map> AllMap; typedef std::unordered_map<CFGBlock*, Map> AllMap;
virtual ~BBAnalyzer() {}
virtual T merge(T from, T into) const = 0; virtual T merge(T from, T into) const = 0;
virtual T mergeBlank(T into) const = 0; virtual T mergeBlank(T into) const = 0;
virtual void processBB(Map &starting, CFGBlock *block) const = 0; virtual void processBB(Map &starting, CFGBlock *block) const = 0;
......
...@@ -190,7 +190,7 @@ static std::unordered_map<void*, ICInfo*> ics_by_return_addr; ...@@ -190,7 +190,7 @@ static std::unordered_map<void*, ICInfo*> ics_by_return_addr;
void registerCompiledPatchpoint(uint8_t* start_addr, PatchpointSetupInfo* pp, StackInfo stack_info, std::unordered_set<int> live_outs) { void registerCompiledPatchpoint(uint8_t* start_addr, PatchpointSetupInfo* pp, StackInfo stack_info, std::unordered_set<int> live_outs) {
int size = pp->totalSize(); int size = pp->totalSize();
uint8_t* end_addr = start_addr + size; uint8_t* end_addr = start_addr + size;
void* slowpath_addr = end_addr; uint8_t* slowpath_addr = end_addr;
uint8_t* rtn_addr; uint8_t* rtn_addr;
...@@ -223,7 +223,7 @@ void registerCompiledPatchpoint(uint8_t* start_addr, PatchpointSetupInfo* pp, St ...@@ -223,7 +223,7 @@ void registerCompiledPatchpoint(uint8_t* start_addr, PatchpointSetupInfo* pp, St
//} //}
initializePatchpoint(start_addr, size); initializePatchpoint(start_addr, size);
rtn_addr = end_addr; rtn_addr = slowpath_addr;
} }
// we can let the user just slide down the nop section, but instead // we can let the user just slide down the nop section, but instead
...@@ -241,7 +241,7 @@ void registerCompiledPatchpoint(uint8_t* start_addr, PatchpointSetupInfo* pp, St ...@@ -241,7 +241,7 @@ void registerCompiledPatchpoint(uint8_t* start_addr, PatchpointSetupInfo* pp, St
writer->jmp(JumpDestination::fromStart(pp->slot_size * (pp->num_slots - i))); writer->jmp(JumpDestination::fromStart(pp->slot_size * (pp->num_slots - i)));
} }
ics_by_return_addr[rtn_addr] = new ICInfo(start_addr, end_addr, stack_info, pp->num_slots, pp->slot_size, pp->getCallingConvention(), live_outs, return_register, pp->type_recorder); ics_by_return_addr[rtn_addr] = new ICInfo(start_addr, slowpath_addr, stack_info, pp->num_slots, pp->slot_size, pp->getCallingConvention(), live_outs, return_register, pp->type_recorder);
} }
ICInfo* getICInfo(void* rtn_addr) { ICInfo* getICInfo(void* rtn_addr) {
......
...@@ -43,6 +43,7 @@ class ICSlotRewrite { ...@@ -43,6 +43,7 @@ class ICSlotRewrite {
public: public:
class CommitHook { class CommitHook {
public: public:
virtual ~CommitHook() {}
virtual void finishAssembly(int fastpath_offset) = 0; virtual void finishAssembly(int fastpath_offset) = 0;
}; };
private: private:
......
...@@ -34,6 +34,7 @@ extern CompilerType* UNDEF; ...@@ -34,6 +34,7 @@ extern CompilerType* UNDEF;
class CompilerType { class CompilerType {
public: public:
virtual ~CompilerType() {}
virtual std::string debugName() = 0; virtual std::string debugName() = 0;
virtual ConcreteCompilerType* getConcreteType() = 0; virtual ConcreteCompilerType* getConcreteType() = 0;
virtual ConcreteCompilerType* getBoxType() = 0; virtual ConcreteCompilerType* getBoxType() = 0;
......
...@@ -50,7 +50,7 @@ PystonJITEventListener::PystonJITEventListener() { ...@@ -50,7 +50,7 @@ PystonJITEventListener::PystonJITEventListener() {
assert(target); assert(target);
const llvm::StringRef triple = g.tm->getTargetTriple(); const llvm::StringRef triple = g.tm->getTargetTriple();
llvm::Triple *ltriple = new llvm::Triple(triple); //llvm::Triple *ltriple = new llvm::Triple(triple);
const llvm::StringRef CPU = ""; const llvm::StringRef CPU = "";
const llvm::MCRegisterInfo *MRI = target->createMCRegInfo(triple); const llvm::MCRegisterInfo *MRI = target->createMCRegInfo(triple);
......
...@@ -24,6 +24,8 @@ namespace pyston { ...@@ -24,6 +24,8 @@ namespace pyston {
class IREmitter; class IREmitter;
class GCBuilder { class GCBuilder {
public: public:
virtual ~GCBuilder() {}
virtual llvm::Value* readPointer(IREmitter&, llvm::Value* ptr_ptr) = 0; virtual llvm::Value* readPointer(IREmitter&, llvm::Value* ptr_ptr) = 0;
virtual void writePointer(IREmitter&, llvm::Value* ptr_ptr, llvm::Value* ptr_value, bool ignore_existing_value) = 0; virtual void writePointer(IREmitter&, llvm::Value* ptr_ptr, llvm::Value* ptr_value, bool ignore_existing_value) = 0;
......
...@@ -277,7 +277,7 @@ static void emitBBs(IRGenState* irstate, const char* bb_type, GuardList &out_gua ...@@ -277,7 +277,7 @@ static void emitBBs(IRGenState* irstate, const char* bb_type, GuardList &out_gua
EffortLevel::EffortLevel effort = irstate->getEffortLevel(); EffortLevel::EffortLevel effort = irstate->getEffortLevel();
CompiledFunction *cf = irstate->getCurFunction(); CompiledFunction *cf = irstate->getCurFunction();
ConcreteCompilerType *rtn_type = irstate->getReturnType(); ConcreteCompilerType *rtn_type = irstate->getReturnType();
llvm::MDNode* func_info = irstate->getFuncDbgInfo(); //llvm::MDNode* func_info = irstate->getFuncDbgInfo();
if (entry_descriptor != NULL) if (entry_descriptor != NULL)
assert(full_blocks.count(source->cfg->getStartingBlock()) == 0); assert(full_blocks.count(source->cfg->getStartingBlock()) == 0);
......
...@@ -190,6 +190,8 @@ class IRGenerator { ...@@ -190,6 +190,8 @@ class IRGenerator {
symbol_table(symbol_table), phi_symbol_table(phi_symbol_table), ending_block(ending_block) {} symbol_table(symbol_table), phi_symbol_table(phi_symbol_table), ending_block(ending_block) {}
}; };
virtual ~IRGenerator() {}
virtual void unpackArguments(const std::vector<AST_expr*> &arg_names, const std::vector<ConcreteCompilerType*> &arg_types) = 0; virtual void unpackArguments(const std::vector<AST_expr*> &arg_names, const std::vector<ConcreteCompilerType*> &arg_types) = 0;
virtual void giveLocalSymbol(const std::string &name, CompilerVariable *var) = 0; virtual void giveLocalSymbol(const std::string &name, CompilerVariable *var) = 0;
virtual void copySymbolsFrom(SymbolTable* st) = 0; virtual void copySymbolsFrom(SymbolTable* st) = 0;
......
...@@ -130,6 +130,8 @@ class AST_keyword; ...@@ -130,6 +130,8 @@ class AST_keyword;
class AST { class AST {
public: public:
virtual ~AST() {}
const AST_TYPE::AST_TYPE type; const AST_TYPE::AST_TYPE type;
uint32_t lineno, col_offset; uint32_t lineno, col_offset;
......
...@@ -32,6 +32,7 @@ namespace pyston { ...@@ -32,6 +32,7 @@ namespace pyston {
class GCVisitor { class GCVisitor {
public: public:
virtual ~GCVisitor() {}
virtual void visit(void* p) = 0; virtual void visit(void* p) = 0;
virtual void visitRange(void** start, void** end) = 0; virtual void visitRange(void** start, void** end) = 0;
virtual void visitPotential(void* p) = 0; virtual void visitPotential(void* p) = 0;
......
...@@ -76,7 +76,7 @@ class TraceStackGCVisitor : public GCVisitor { ...@@ -76,7 +76,7 @@ class TraceStackGCVisitor : public GCVisitor {
void _visit(void* p); void _visit(void* p);
public: public:
TraceStack *stack; TraceStack *stack;
constexpr TraceStackGCVisitor(TraceStack *stack) : stack(stack) {} TraceStackGCVisitor(TraceStack *stack) : stack(stack) {}
void visit(void* p) override; void visit(void* p) override;
void visitRange(void** start, void** end) override; void visitRange(void** start, void** end) override;
......
...@@ -226,14 +226,6 @@ struct BoxedDict : public Box { ...@@ -226,14 +226,6 @@ struct BoxedDict : public Box {
PyDict d; PyDict d;
BoxedDict() __attribute__((visibility("default"))) : Box(&dict_flavor, dict_cls) {} BoxedDict() __attribute__((visibility("default"))) : Box(&dict_flavor, dict_cls) {}
void verify() {
int i = 0;
for (auto it : d) {
++i;
}
assert(i == d.size());
}
}; };
struct BoxedFunction : public HCBox { struct BoxedFunction : public HCBox {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment