Csaba Ringhofer has posted comments on this change. ( http://gerrit.cloudera.org:8080/9063 )
Change subject: IMPALA-5801: Clean up codegen GetType() interface ...................................................................... Patch Set 1: (2 comments) http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/codegen/llvm-codegen.h File be/src/codegen/llvm-codegen.h: http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/codegen/llvm-codegen.h@263 PS1, Line 263: GetType > I'm not sure that the templated version would improve readability enough to GetNamed(Ptr)Type is ok for me, even if it it a bit longer than I would prefer. I was curious about the error message, so I created an implementation and added a call with parameter int (which should lead to an error, as it doesn't have LLVM_CLASS_NAME). The error message contains some useful clues (first half) but also some strange stuff (second half), so I must agree that it could lead to confusion: In file included from be/src/codegen/llvm-codegen.cc:18:0: be/src/codegen/llvm-codegen.h: In instantiation of ‘llvm::Type* impala::LlvmCodeGen::GetType() [with T = int]’: be/src/codegen/llvm-codegen.cc:484:33: required from here be/src/codegen/llvm-codegen.h:259:65: error: ‘LLVM_CLASS_NAME’ is not a member of ‘int’ llvm::Type* GetType() { return GetNamedType(T::LLVM_CLASS_NAME); } ^ be/src/codegen/llvm-codegen.h: In member function ‘llvm::Type* impala::LlvmCodeGen::GetType() [with T = int]’: be/src/codegen/llvm-codegen.h:259:68: error: control reaches end of non-void function [-Werror=return-type] llvm::Type* GetType() { return GetNamedType(T::LLVM_CLASS_NAME); } ^ be/src/codegen/llvm-codegen.cc: In function ‘void boost::throw_exception(const std::exception&)’: be/src/codegen/llvm-codegen.cc:1719:1: error: ‘noreturn’ function does return [-Werror] } http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/codegen/llvm-codegen.h@497 PS1, Line 497: llvm::Type* i8_type() { return GetInternalRepresentation(TYPE_TINYINT); } > Changing the interface first makes sense, we should switch over the impleme Done -- To view, visit http://gerrit.cloudera.org:8080/9063 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib146ca21af82023b0b460f813eae3435b4b2eb77 Gerrit-Change-Number: 9063 Gerrit-PatchSet: 1 Gerrit-Owner: Csaba Ringhofer <csringho...@cloudera.com> Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com> Gerrit-Reviewer: Lars Volker <l...@cloudera.com> Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com> Gerrit-Comment-Date: Thu, 08 Feb 2018 22:12:32 +0000 Gerrit-HasComments: Yes