Commit 839c4cea by Jan Voung

A couple of fixes for using Makefile.standalone on Mac.

(*) PNaCl toolchain_build builds 64-bit libraries for LLVM on Mac. That won't link with subzero code if subzero is built with -m32, so add an option to override the -m32. (*) include locale header (*) Mark xMacroIntegrityCheck unused to avoid clang compiler warning. (*) virtual dtor, for inheritable class (*) Mark compare function const BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/428733003
parent 78282f6c
......@@ -18,9 +18,19 @@ LLVM_SRC_PATH ?= ../llvm
LLVM_BIN_PATH ?= $(shell readlink -e \
../../out/llvm_i686_linux_work/Release+Asserts/bin)
HOST_ARCH ?= x86
ifeq ($(HOST_ARCH),x86_64)
HOST_FLAGS = -m64
else
ifeq ($(HOST_ARCH),x86)
HOST_FLAGS = -m32
endif
endif
$(info -----------------------------------------------)
$(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH))
$(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH))
$(info Using HOST_ARCH = $(HOST_ARCH))
$(info -----------------------------------------------)
LLVM_CXXFLAGS := `$(LLVM_BIN_PATH)/llvm-config --cxxflags`
......@@ -29,9 +39,11 @@ LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --ldflags --libs`
# It's recommended that CXX matches the compiler you used to build LLVM itself.
OPTLEVEL := -O0
CXX := g++
CXXFLAGS := -Wall -Wextra -Werror -fno-rtti -fno-exceptions \
$(OPTLEVEL) -g $(LLVM_CXXFLAGS) -m32 -Wno-error=unused-parameter
LDFLAGS := -m32
$(OPTLEVEL) -g $(LLVM_CXXFLAGS) $(HOST_FLAGS) \
-Wno-error=unused-parameter
LDFLAGS := $(HOST_FLAGS)
SRCS= \
IceCfg.cpp \
......
......@@ -13,6 +13,7 @@
//===----------------------------------------------------------------------===//
#include <ctype.h> // isdigit(), isupper()
#include <locale> // locale
#include "IceDefs.h"
#include "IceTypes.h"
......@@ -61,7 +62,7 @@ public:
private:
typedef std::pair<Type, KeyType> TupleType;
struct TupleCompare {
bool operator()(const TupleType &A, const TupleType &B) {
bool operator()(const TupleType &A, const TupleType &B) const {
if (A.first != B.first)
return A.first < B.first;
if (KeyTypeHasFP)
......
......@@ -198,4 +198,6 @@ TargetGlobalInitLowering::createLowering(TargetArch Target,
return NULL;
}
TargetGlobalInitLowering::~TargetGlobalInitLowering() {}
} // end of namespace Ice
......@@ -211,6 +211,8 @@ class TargetGlobalInitLowering {
public:
static TargetGlobalInitLowering *createLowering(TargetArch Target,
GlobalContext *Ctx);
virtual ~TargetGlobalInitLowering();
// TODO: Allow relocations to be represented as part of the Data.
virtual void lower(const IceString &Name, SizeT Align, bool IsInternal,
bool IsConst, bool IsZeroInitializer, SizeT Size,
......
......@@ -143,7 +143,7 @@ IceString typeIdentString(const Type Ty) {
// could get out of sync if enum values are reordered or if entries
// are added or deleted. This dummy function uses static_assert to
// ensure everything is kept in sync.
void xMacroIntegrityCheck() {
void __attribute__((unused)) xMacroIntegrityCheck() {
// Validate the enum values in FCMPX8632_TABLE.
{
// Define a temporary set of enum values based on low-level
......
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