Skip to content

Commit

Permalink
feat(android): change compiler options based on LLVM 12
Browse files Browse the repository at this point in the history
change compiler options based on LLVM 12
and fix related code issues
  • Loading branch information
medns committed Jul 11, 2022
1 parent 45fd192 commit 6abf2b5
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 30 deletions.
14 changes: 6 additions & 8 deletions buildconfig/cmake/compiler_toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,28 @@
# limitations under the License.
#

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # based on LLVM 12
set(COMPILE_OPTIONS
-fomit-frame-pointer
-fno-threadsafe-statics
-fno-strict-aliasing
-fno-short-enums
-fno-unique-section-names
-fno-trigraphs
# warning group flags
-Werror
-Wall
-Wextra
-Wextra-semi
-Wdeprecated
-Wconversion
-Wshadow
-Wunreachable-code-aggressive
-Wimplicit-fallthrough
-Wloop-analysis
-Wmissing-field-initializers
-Wunused-local-typedefs
-Wstring-conversion
-Wthread-safety
-Wtautological-overlap-compare
-Wunreachable-code
-Wenum-compare-conditional
# warning flags
-Wheader-hygiene
-Wshadow
-Wno-unused-parameter
-Wno-trigraphs
--param=ssp-buffer-size=4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ class Serializable {
* @return string data organized in a regular way
*/
virtual std::string Serialize() const = 0;
virtual ~Serializable() {}
virtual ~Serializable() = default;
};
} // namespace hippy::devtools
6 changes: 6 additions & 0 deletions devtools/devtools-backend/include/tunnel/tcp/frame_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class FrameCodec {
public:
FrameCodec() { stream_buffer_.reserve(kTunnelBufferSize); }
~FrameCodec() { stream_buffer_.clear(); }
FrameCodec& operator=(const FrameCodec& rhs) {
encode_callback_ = rhs.encode_callback_;
decode_callback_ = rhs.decode_callback_;
stream_buffer_ = rhs.stream_buffer_;
return *this;
}
void Encode(void *data, int32_t len, uint8_t flag);
void Decode(void *data, int32_t len);
inline void SetEncodeCallback(std::function<void(void *, int32_t)> callback) { encode_callback_ = callback; }
Expand Down
10 changes: 4 additions & 6 deletions devtools/devtools-backend/include/tunnel/ws/web_socket_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@
#include "devtools_base/logging.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
#pragma clang diagnostic ignored "-Wimplicit-int-conversion"
#pragma clang diagnostic ignored "-Wdeprecated"
#pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#define ASIO_STANDALONE
#include "websocketpp/client.hpp"
#include "websocketpp/config/asio_no_tls_client.hpp"
Expand Down
2 changes: 1 addition & 1 deletion dom/include/dom/animation/animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Animation {
double start_value);
Animation(int32_t cnt);
Animation();
virtual ~Animation();
virtual ~Animation() = default;

inline uint32_t GetId() {
return id_;
Expand Down
2 changes: 1 addition & 1 deletion dom/include/dom/animation/cubic_bezier_animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class CubicBezierAnimation : public Animation {
int32_t cnt,
uint32_t related_id = kInvalidAnimationId);
CubicBezierAnimation();
~CubicBezierAnimation();
~CubicBezierAnimation() = default;

inline double GetCurrentValue() {
return current_value_;
Expand Down
2 changes: 0 additions & 2 deletions dom/src/dom/animation/animation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ Animation::Animation(int32_t cnt) : Animation(cnt,

Animation::Animation() : Animation(0, 0, 0, 0) {}

Animation::~Animation() = default;

double Animation::Calculate(uint64_t time) {
return start_value_;
}
Expand Down
2 changes: 0 additions & 2 deletions dom/src/dom/animation/cubic_bezier_animation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ CubicBezierAnimation::CubicBezierAnimation() : CubicBezierAnimation(Mode::kTimin
kAnimationTimingFunctionLinear,
0) {}

CubicBezierAnimation::~CubicBezierAnimation() = default;

void CubicBezierAnimation::Init() {
/**
* startValue : The value at the start of the animation, which can be of type Number or
Expand Down
1 change: 1 addition & 0 deletions driver/js/core/include/core/runtime/v8/bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#if defined(ENABLE_INSPECTOR) && !defined(V8_WITHOUT_INSPECTOR)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wshadow"
#include "v8/v8-inspector.h"
#pragma clang diagnostic pop
#endif
Expand Down
4 changes: 0 additions & 4 deletions layout/engine/HPStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ HPStyle::HPStyle() {
lineSpace = 0;
}

HPStyle::~HPStyle() {
// TODO(ianwang): Auto-generated destructor stub
}

std::string edge2String(int type, CSSValue &edges, CSSFrom &edgesFrom) {
std::string prefix = "";
if (type == 0) { // margin
Expand Down
2 changes: 1 addition & 1 deletion layout/engine/HPStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class HPStyle {
public:
HPStyle();
virtual ~HPStyle();
virtual ~HPStyle() = default;
std::string toString();
void setDirection(HPDirection direction_) { direction = direction_; }

Expand Down
4 changes: 0 additions & 4 deletions modules/footstone/src/deserializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,6 @@ uint32_t Deserializer::ReadObjectProperties(HippyValueObjectType& property, Seri
property = object;
}
}

return num_properties;
}

uint32_t Deserializer::ReadObjectProperties(SerializationTag end_tag) {
Expand All @@ -358,8 +356,6 @@ uint32_t Deserializer::ReadObjectProperties(SerializationTag end_tag) {
return num_properties;
}
}

return num_properties;
}

} // namespace base
Expand Down

0 comments on commit 6abf2b5

Please sign in to comment.