@@ -128,32 +128,6 @@ BareMetal::BareMetal(const Driver &D, const llvm::Triple &Triple,
128128 }
129129}
130130
131- namespace clang {
132- namespace driver {
133- namespace toolchains {
134- // / Is the triple {arm,armeb,thumb,thumbeb}-none-none-{eabi,eabihf} ?
135- bool isARMEABIBareMetal (const llvm::Triple &Triple) {
136- auto arch = Triple.getArch ();
137- if (arch != llvm::Triple::arm && arch != llvm::Triple::thumb &&
138- arch != llvm::Triple::armeb && arch != llvm::Triple::thumbeb)
139- return false ;
140-
141- if (Triple.getVendor () != llvm::Triple::UnknownVendor)
142- return false ;
143-
144- if (Triple.getOS () != llvm::Triple::UnknownOS)
145- return false ;
146-
147- if (Triple.getEnvironment () != llvm::Triple::EABI &&
148- Triple.getEnvironment () != llvm::Triple::EABIHF)
149- return false ;
150-
151- return true ;
152- }
153- } // namespace toolchains
154- } // namespace driver
155- } // namespace clang
156-
157131// / Is the triple {aarch64.aarch64_be}-none-elf?
158132static bool isAArch64BareMetal (const llvm::Triple &Triple) {
159133 if (Triple.getArch () != llvm::Triple::aarch64 &&
@@ -272,7 +246,7 @@ void BareMetal::findMultilibs(const Driver &D, const llvm::Triple &Triple,
272246}
273247
274248bool BareMetal::handlesTarget (const llvm::Triple &Triple) {
275- return isARMEABIBareMetal (Triple) || isAArch64BareMetal (Triple) ||
249+ return arm:: isARMEABIBareMetal (Triple) || isAArch64BareMetal (Triple) ||
276250 isRISCVBareMetal (Triple) || isPPCBareMetal (Triple);
277251}
278252
@@ -566,7 +540,7 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA,
566540 // The R_ARM_TARGET2 relocation must be treated as R_ARM_REL32 on arm*-*-elf
567541 // and arm*-*-eabi (the default is R_ARM_GOT_PREL, used on arm*-*-linux and
568542 // arm*-*-*bsd).
569- if (isARMEABIBareMetal (TC.getTriple ()))
543+ if (arm:: isARMEABIBareMetal (TC.getTriple ()))
570544 CmdArgs.push_back (" --target2=rel" );
571545
572546 CmdArgs.push_back (" -o" );
0 commit comments