llvm.org GIT mirror llvm / 600bf16
Use a dedicated IsLinux flag instead of an ELFLinux TargetType. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50649 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 12 years ago
3 changed file(s) with 15 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
278278 else
279279 DarwinVers = 8; // Minimum supported darwin is Tiger.
280280 } else if (TT.find("linux") != std::string::npos) {
281 TargetType = isELFLinux;
281 // Linux doesn't imply ELF, but we don't currently support anything else.
282 TargetType = isELF;
283 IsLinux = true;
282284 } else if (TT.find("cygwin") != std::string::npos) {
283285 TargetType = isCygwin;
284286 } else if (TT.find("mingw") != std::string::npos) {
305307 TargetType = isWindows;
306308 #elif defined(__linux__)
307309 // Linux doesn't imply ELF, but we don't currently support anything else.
308 TargetType = isELFLinux;
310 TargetType = isELF;
311 IsLinux = true;
309312 #endif
310313 }
311314
6666
6767 /// DarwinVers - Nonzero if this is a darwin platform: the numeric
6868 /// version of the platform, e.g. 8 = 10.4 (Tiger), 9 = 10.5 (Leopard), etc.
69 unsigned char DarwinVers; // Is any darwin-ppc platform.
69 unsigned char DarwinVers; // Is any darwin-x86 platform.
70
71 /// isLinux - true if this is a "linux" platform.
72 bool IsLinux;
7073
7174 /// stackAlignment - The minimum alignment known to hold of the stack frame on
7275 /// entry to the function and which must be maintained by every function.
8386
8487 public:
8588 enum {
86 isELF, isELFLinux, isCygwin, isDarwin, isWindows, isMingw
89 isELF, isCygwin, isDarwin, isWindows, isMingw
8790 } TargetType;
8891
8992 /// This constructor initializes the data members to match that
132135
133136 bool isTargetDarwin() const { return TargetType == isDarwin; }
134137 bool isTargetELF() const {
135 return TargetType == isELF || TargetType == isELFLinux;
136 }
137 bool isTargetLinux() const {
138 return TargetType == isELFLinux;
138 return TargetType == isELF;
139139 }
140140 bool isTargetWindows() const { return TargetType == isWindows; }
141141 bool isTargetMingw() const { return TargetType == isMingw; }
168168 /// getDarwinVers - Return the darwin version number, 8 = tiger, 9 = leopard.
169169 unsigned getDarwinVers() const { return DarwinVers; }
170170
171 /// isLinux - Return true if the target is "Linux".
172 bool isLinux() const { return IsLinux; }
173
171174 /// True if accessing the GV requires an extra load. For Windows, dllimported
172175 /// symbols are indirect, loading the value at address GV rather then the
173176 /// value of GV itself. This means that the GlobalAddress must be in the base
127127 break;
128128
129129 case X86Subtarget::isELF:
130 case X86Subtarget::isELFLinux:
131130 ReadOnlySection = "\t.section\t.rodata";
132131 FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\",@progbits,4";
133132 EightByteConstantSection = "\t.section\t.rodata.cst8,\"aM\",@progbits,8";
230229 }
231230
232231 // On Linux we must declare when we can use a non-executable stack.
233 if (Subtarget->isTargetLinux())
232 if (Subtarget->isLinux())
234233 NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits";
235234
236235 AssemblerDialect = Subtarget->getAsmFlavor();