- /// fitsInLegalInteger - This function returns true if the specified type fits
- /// in a native integer type supported by the CPU. For example, if the CPU
- /// only supports i32 as a native integer type, then i27 fits in a legal
- // integer type but i45 does not.
+ unsigned getStackAlignment() const { return StackNaturalAlign; }
+
+ bool hasMicrosoftFastStdCallMangling() const {
+ return ManglingMode == MM_WinCOFFX86;
+ }
+
+ bool hasLinkerPrivateGlobalPrefix() const { return ManglingMode == MM_MachO; }
+
+ const char *getLinkerPrivateGlobalPrefix() const {
+ if (ManglingMode == MM_MachO)
+ return "l";
+ return "";
+ }
+
+ char getGlobalPrefix() const {
+ switch (ManglingMode) {
+ case MM_None:
+ case MM_ELF:
+ case MM_Mips:
+ case MM_WinCOFF:
+ return '\0';
+ case MM_MachO:
+ case MM_WinCOFFX86:
+ return '_';
+ }
+ llvm_unreachable("invalid mangling mode");
+ }
+
+ const char *getPrivateGlobalPrefix() const {
+ switch (ManglingMode) {
+ case MM_None:
+ return "";
+ case MM_ELF:
+ return ".L";
+ case MM_Mips:
+ return "$";
+ case MM_MachO:
+ case MM_WinCOFF:
+ case MM_WinCOFFX86:
+ return "L";
+ }
+ llvm_unreachable("invalid mangling mode");
+ }
+
+ static const char *getManglingComponent(const Triple &T);
+
+ /// \brief Returns true if the specified type fits in a native integer type
+ /// supported by the CPU.
+ ///
+ /// For example, if the CPU only supports i32 as a native integer type, then
+ /// i27 fits in a legal integer type but i45 does not.