Emit ARM build-attributes in the file scope (as header). The ARM linker will check that .o files declare compatible build attributes (e.g., all claim hard-float calling convention, all claim VFP-vX ,etc.). Thus, in order to set up cross tests that link LLC generated code against and Subzero generated code, we need the build attributes to be compatible. Pick ARMv7, hard-float calling convention, and neon, etc. which we use for PNaCl LLVM. Will probably have to reorganize to keep in sync once the ELF writer also emits this. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076 R=kschimpf@google.com, stichnot@chromium.org Review URL: https://codereview.chromium.org/1171563002.
diff --git a/src/IceTargetLoweringMIPS32.h b/src/IceTargetLoweringMIPS32.h index cb583b5..b6c325a 100644 --- a/src/IceTargetLoweringMIPS32.h +++ b/src/IceTargetLoweringMIPS32.h
@@ -56,18 +56,23 @@ const char *getConstantPrefix() const final { return ""; } void emit(const ConstantUndef *C) const final { + (void)C; llvm::report_fatal_error("Not yet implemented"); } void emit(const ConstantInteger32 *C) const final { + (void)C; llvm::report_fatal_error("Not yet implemented"); } void emit(const ConstantInteger64 *C) const final { + (void)C; llvm::report_fatal_error("Not yet implemented"); } void emit(const ConstantFloat *C) const final { + (void)C; llvm::report_fatal_error("Not yet implemented"); } void emit(const ConstantDouble *C) const final { + (void)C; llvm::report_fatal_error("Not yet implemented"); } @@ -128,8 +133,8 @@ TargetDataMIPS32 &operator=(const TargetDataMIPS32 &) = delete; public: - static TargetDataLowering *create(GlobalContext *Ctx) { - return new TargetDataMIPS32(Ctx); + static std::unique_ptr<TargetDataLowering> create(GlobalContext *Ctx) { + return std::unique_ptr<TargetDataLowering>(new TargetDataMIPS32(Ctx)); } void lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) const final; @@ -144,6 +149,23 @@ template <typename T> static void emitConstantPool(GlobalContext *Ctx); }; +class TargetHeaderMIPS32 final : public TargetHeaderLowering { + TargetHeaderMIPS32() = delete; + TargetHeaderMIPS32(const TargetHeaderMIPS32 &) = delete; + TargetHeaderMIPS32 &operator=(const TargetHeaderMIPS32 &) = delete; + +public: + static std::unique_ptr<TargetHeaderLowering> create(GlobalContext *Ctx) { + return std::unique_ptr<TargetHeaderLowering>(new TargetHeaderMIPS32(Ctx)); + } + +protected: + explicit TargetHeaderMIPS32(GlobalContext *Ctx); + +private: + ~TargetHeaderMIPS32() = default; +}; + } // end of namespace Ice #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H