OBJDIR := $(OBJDIR)+Asserts
endif
-# Use g++ to compile, to check for errors/warnings that clang++ might have
-# missed. It's unlikely to link, unless LLVM was also built with g++, so the
-# compile_only target should be used.
-ifdef GPLUSPLUS
- CXX = CCACHE_CPP2=yes $(CCACHE) g++
- STDLIB_FLAGS =
- LLVM_EXTRA_WARNINGS="-Wno-unknown-pragmas -Wno-unused-parameter \
- -Wno-comment -Wno-enum-compare -Wno-strict-aliasing"
- OBJDIR := $(OBJDIR)+Gplusplus
-endif
-
ifdef UBSAN
OBJDIR := $(OBJDIR)+UBSan
CXX_EXTRA += -fsanitize=undefined -fno-sanitize=vptr \
# Extra warnings that LLVM's build system adds in addition to -Wall.
LLVM_EXTRA_WARNINGS := -Wcovered-switch-default
+# Use g++ to compile, to check for errors/warnings that clang++ might have
+# missed. It's unlikely to link, unless LLVM was also built with g++, so the
+# compile_only target should be used. Note: This ifdef section is deliberately
+# placed here instead of with the other ifdef sections, so that its redefinition
+# of CXX/STDLIB_FLAGS/LLVM_EXTRA_WARNINGS follows their normal definitions.
+ifdef GPLUSPLUS
+ CXX := CCACHE_CPP2=yes $(CCACHE) g++
+ STDLIB_FLAGS :=
+ LLVM_EXTRA_WARNINGS := -Wno-unknown-pragmas -Wno-unused-parameter \
+ -Wno-comment -Wno-enum-compare -Wno-strict-aliasing \
+ -Wno-return-type
+ OBJDIR := $(OBJDIR)+Gplusplus
+endif
+
BASE_CXXFLAGS := -std=gnu++11 -Wall -Wextra -Werror -fno-rtti \
-fno-exceptions $(OPTLEVEL) $(ASSERTIONS) -g -pedantic \
$(LLVM_EXTRA_WARNINGS) $(CXX_EXTRA)
case ROData: {
const IceString SectionName =
MangleSectionName(IsPIC ? ".data.rel.ro" : ".rodata", SectionSuffix);
- const Elf64_Xword ShFlags = SHF_ALLOC | (IsPIC ? SHF_WRITE : 0);
+ const Elf64_Xword ShFlags = IsPIC ? (SHF_ALLOC | SHF_WRITE) : SHF_ALLOC;
Section = createSection<ELFDataSection>(SectionName, SHT_PROGBITS, ShFlags,
ShAddralign, ShEntsize);
Section->setFileOffset(alignFileOffset(ShAddralign));
static constexpr struct TableType {
const char *Name;
- int32_t Encoding : 10;
- int32_t CCArg : 6;
- int32_t Scratch : 1;
- int32_t Preserved : 1;
- int32_t StackPtr : 1;
- int32_t FramePtr : 1;
- int32_t IsGPR : 1;
- int32_t IsInt : 1;
- int32_t IsI64Pair : 1;
- int32_t IsFP32 : 1;
- int32_t IsFP64 : 1;
- int32_t IsVec128 : 1;
+ unsigned Encoding : 10;
+ unsigned CCArg : 6;
+ unsigned Scratch : 1;
+ unsigned Preserved : 1;
+ unsigned StackPtr : 1;
+ unsigned FramePtr : 1;
+ unsigned IsGPR : 1;
+ unsigned IsInt : 1;
+ unsigned IsI64Pair : 1;
+ unsigned IsFP32 : 1;
+ unsigned IsFP64 : 1;
+ unsigned IsVec128 : 1;
#define NUM_ALIASES_BITS 3
SizeT NumAliases : (NUM_ALIASES_BITS + 1);
uint16_t Aliases[1 << NUM_ALIASES_BITS];
static constexpr struct {
uint16_t Val;
- int Is64 : 1;
- int Is32 : 1;
- int Is16 : 1;
- int Is8 : 1;
- int IsXmm : 1;
- int Is64To8 : 1;
- int Is32To8 : 1;
- int Is16To8 : 1;
- int IsTrunc8Rcvr : 1;
- int IsAhRcvr : 1;
- int Scratch : 1;
+ unsigned Is64 : 1;
+ unsigned Is32 : 1;
+ unsigned Is16 : 1;
+ unsigned Is8 : 1;
+ unsigned IsXmm : 1;
+ unsigned Is64To8 : 1;
+ unsigned Is32To8 : 1;
+ unsigned Is16To8 : 1;
+ unsigned IsTrunc8Rcvr : 1;
+ unsigned IsAhRcvr : 1;
+ unsigned Scratch : 1;
#define NUM_ALIASES_BITS 2
SizeT NumAliases : (NUM_ALIASES_BITS + 1);
uint16_t Aliases[1 << NUM_ALIASES_BITS];
static constexpr struct {
uint16_t Val;
- int Is64 : 1;
- int Is32 : 1;
- int Is16 : 1;
- int Is8 : 1;
- int IsXmm : 1;
- int Is64To8 : 1;
- int Is32To8 : 1;
- int Is16To8 : 1;
- int IsTrunc8Rcvr : 1;
- int IsAhRcvr : 1;
- int Scratch : 1;
+ unsigned Is64 : 1;
+ unsigned Is32 : 1;
+ unsigned Is16 : 1;
+ unsigned Is8 : 1;
+ unsigned IsXmm : 1;
+ unsigned Is64To8 : 1;
+ unsigned Is32To8 : 1;
+ unsigned Is16To8 : 1;
+ unsigned IsTrunc8Rcvr : 1;
+ unsigned IsAhRcvr : 1;
+ unsigned Scratch : 1;
#define NUM_ALIASES_BITS 2
SizeT NumAliases : (NUM_ALIASES_BITS + 1);
uint16_t Aliases[1 << NUM_ALIASES_BITS];
public:
using Traits = TraitsType;
- using BoolFolding = BoolFolding<Traits>;
using ConcreteTarget = typename Traits::ConcreteTarget;
using InstructionSetEnum = typename Traits::InstructionSet;
typename std::enable_if<!T::Is64Bit, void>::type
lowerIcmp64(const InstIcmp *Icmp, const Inst *Consumer);
- BoolFolding FoldingInfo;
+ BoolFolding<Traits> FoldingInfo;
static FixupKind PcRelFixup;
static FixupKind AbsFixup;
// Handle folding opportunities.
if (const Inst *Producer = FoldingInfo.getProducerFor(Cond)) {
assert(Producer->isDeleted());
- switch (BoolFolding::getProducerKind(Producer)) {
+ switch (BoolFolding<Traits>::getProducerKind(Producer)) {
default:
break;
- case BoolFolding::PK_Icmp32:
- case BoolFolding::PK_Icmp64: {
+ case BoolFolding<Traits>::PK_Icmp32:
+ case BoolFolding<Traits>::PK_Icmp64: {
lowerIcmpAndConsumer(llvm::dyn_cast<InstIcmp>(Producer), Br);
return;
}
- case BoolFolding::PK_Fcmp: {
+ case BoolFolding<Traits>::PK_Fcmp: {
lowerFcmpAndConsumer(llvm::dyn_cast<InstFcmp>(Producer), Br);
return;
}
- case BoolFolding::PK_Arith: {
+ case BoolFolding<Traits>::PK_Arith: {
lowerArithAndConsumer(llvm::dyn_cast<InstArithmetic>(Producer), Br);
return;
}
// Handle folding opportunities.
if (const Inst *Producer = FoldingInfo.getProducerFor(Condition)) {
assert(Producer->isDeleted());
- switch (BoolFolding::getProducerKind(Producer)) {
+ switch (BoolFolding<Traits>::getProducerKind(Producer)) {
default:
break;
- case BoolFolding::PK_Icmp32:
- case BoolFolding::PK_Icmp64: {
+ case BoolFolding<Traits>::PK_Icmp32:
+ case BoolFolding<Traits>::PK_Icmp64: {
lowerIcmpAndConsumer(llvm::dyn_cast<InstIcmp>(Producer), Select);
return;
}
- case BoolFolding::PK_Fcmp: {
+ case BoolFolding<Traits>::PK_Fcmp: {
lowerFcmpAndConsumer(llvm::dyn_cast<InstFcmp>(Producer), Select);
return;
}