summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-04-10 03:19:47 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-04-10 03:19:47 +0000
commit9b5ba547f15224ee2b6106926fa6f3eab3c7fe41 (patch)
tree3ba37bd60672ac4005a2ce0b8c23c86b50b41445 /clang/lib/Basic/Targets.cpp
parenta3e0d45bfd384e31d0af1c2a06fccf0331276849 (diff)
downloadbcm5719-llvm-9b5ba547f15224ee2b6106926fa6f3eab3c7fe41.tar.gz
bcm5719-llvm-9b5ba547f15224ee2b6106926fa6f3eab3c7fe41.zip
Add support for __gnu_mcount_nc as the pg interface
This adds support to optionally support using `__gnu_mcount_nc` as the mcount interface rather than `mcount` for Linux and EABI. The other targets do not provide an implementation for `__gnu_mcount_nc`. This can be activated via the `-meabi gnu` flag. Resolves PR23969. llvm-svn: 265888
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r--clang/lib/Basic/Targets.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 6768e75941d..7c5c7bbe6b3 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -4675,6 +4675,11 @@ public:
// that follows it, `bar', `bar' will be aligned as the type of the
// zero length bitfield.
UseZeroLengthBitfieldAlignment = true;
+
+ if (Triple.getOS() == llvm::Triple::Linux ||
+ Triple.getOS() == llvm::Triple::UnknownOS)
+ this->MCountName =
+ Opts.EABIVersion == "gnu" ? "\01__gnu_mcount_nc" : "\01mcount";
}
StringRef getABI() const override { return ABI; }
@@ -5423,9 +5428,8 @@ class AArch64TargetInfo : public TargetInfo {
std::string ABI;
public:
- AArch64TargetInfo(const llvm::Triple &Triple, const TargetOptions &)
+ AArch64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: TargetInfo(Triple), ABI("aapcs") {
-
if (getTriple().getOS() == llvm::Triple::NetBSD) {
WCharType = SignedInt;
@@ -5460,6 +5464,11 @@ public:
// AArch64 targets default to using the ARM C++ ABI.
TheCXXABI.set(TargetCXXABI::GenericAArch64);
+
+ if (Triple.getOS() == llvm::Triple::Linux ||
+ Triple.getOS() == llvm::Triple::UnknownOS)
+ this->MCountName =
+ Opts.EABIVersion == "gnu" ? "\01__gnu_mcount_nc" : "\01mcount";
}
StringRef getABI() const override { return ABI; }
OpenPOWER on IntegriCloud