summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/clang/lib/Basic
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-05-25 13:43:03 +0000
committerdim <dim@FreeBSD.org>2015-05-25 13:43:03 +0000
commit9f7fffcc5b3bcf5932d21d2c7a6fe6ff3586ebb7 (patch)
treeae4e0278591951934639733b0f93324644a9ee4a /contrib/llvm/tools/clang/lib/Basic
parent2c52296aaa76fb2fba542afba29865f67b00663a (diff)
downloadFreeBSD-src-9f7fffcc5b3bcf5932d21d2c7a6fe6ff3586ebb7.zip
FreeBSD-src-9f7fffcc5b3bcf5932d21d2c7a6fe6ff3586ebb7.tar.gz
Upgrade our copy of clang and llvm to 3.6.1 release.
This release contains the following cherry-picked revisions from upstream trunk: 226124 226151 226164 226165 226166 226407 226408 226409 226652 226905 226983 227084 227087 227089 227208 227209 227210 227211 227212 227213 227214 227269 227430 227482 227503 227519 227574 227822 227986 227987 227988 227989 227990 228037 228038 228039 228040 228188 228189 228190 228273 228372 228373 228374 228403 228765 228848 228918 229223 229225 229226 229227 229228 229230 229234 229235 229236 229238 229239 229413 229507 229680 229750 229751 229752 229911 230146 230147 230235 230253 230255 230469 230500 230564 230603 230657 230742 230748 230956 231219 231237 231245 231259 231280 231451 231563 231601 231658 231659 231662 231984 231986 232046 232085 232142 232176 232179 232189 232382 232386 232389 232425 232438 232443 232675 232786 232797 232943 232957 233075 233080 233351 233353 233409 233410 233508 233584 233819 233904 234629 234636 234891 234975 234977 235524 235641 235662 235931 236099 236306 236307 Please note that from 3.5.0 onwards, clang and llvm require C++11 support to build; see UPDATING for more information.
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Basic')
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp39
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp1
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/Targets.cpp20
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/Version.cpp2
4 files changed, 45 insertions, 17 deletions
diff --git a/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp b/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp
index 305dcd4..118e3f3 100644
--- a/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp
@@ -2076,22 +2076,33 @@ bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS,
return IsBeforeInTUCache.getCachedResult(LOffs.second, ROffs.second);
}
- // This can happen if a location is in a built-ins buffer.
- // But see PR5662.
+ // If we arrived here, the location is either in a built-ins buffer or
+ // associated with global inline asm. PR5662 and PR22576 are examples.
+
// Clear the lookup cache, it depends on a common location.
IsBeforeInTUCache.clear();
- bool LIsBuiltins = strcmp("<built-in>",
- getBuffer(LOffs.first)->getBufferIdentifier()) == 0;
- bool RIsBuiltins = strcmp("<built-in>",
- getBuffer(ROffs.first)->getBufferIdentifier()) == 0;
- // built-in is before non-built-in
- if (LIsBuiltins != RIsBuiltins)
- return LIsBuiltins;
- assert(LIsBuiltins && RIsBuiltins &&
- "Non-built-in locations must be rooted in the main file");
- // Both are in built-in buffers, but from different files. We just claim that
- // lower IDs come first.
- return LOffs.first < ROffs.first;
+ llvm::MemoryBuffer *LBuf = getBuffer(LOffs.first);
+ llvm::MemoryBuffer *RBuf = getBuffer(ROffs.first);
+ bool LIsBuiltins = strcmp("<built-in>", LBuf->getBufferIdentifier()) == 0;
+ bool RIsBuiltins = strcmp("<built-in>", RBuf->getBufferIdentifier()) == 0;
+ // Sort built-in before non-built-in.
+ if (LIsBuiltins || RIsBuiltins) {
+ if (LIsBuiltins != RIsBuiltins)
+ return LIsBuiltins;
+ // Both are in built-in buffers, but from different files. We just claim that
+ // lower IDs come first.
+ return LOffs.first < ROffs.first;
+ }
+ bool LIsAsm = strcmp("<inline asm>", LBuf->getBufferIdentifier()) == 0;
+ bool RIsAsm = strcmp("<inline asm>", RBuf->getBufferIdentifier()) == 0;
+ // Sort assembler after built-ins, but before the rest.
+ if (LIsAsm || RIsAsm) {
+ if (LIsAsm != RIsAsm)
+ return RIsAsm;
+ assert(LOffs.first == ROffs.first);
+ return false;
+ }
+ llvm_unreachable("Unsortable locations found");
}
void SourceManager::PrintStats() const {
diff --git a/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp b/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp
index 6987cd7..871bbd5 100644
--- a/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp
@@ -655,6 +655,7 @@ bool TargetCXXABI::tryParse(llvm::StringRef name) {
.Case("ios", iOS)
.Case("itanium", GenericItanium)
.Case("microsoft", Microsoft)
+ .Case("mips", GenericMIPS)
.Default(unknown);
if (kind == unknown) return false;
diff --git a/contrib/llvm/tools/clang/lib/Basic/Targets.cpp b/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
index bf60bbf..a7a0057 100644
--- a/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
@@ -419,6 +419,7 @@ protected:
public:
NetBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
this->UserLabelPrefix = "";
+ this->MCountName = "_mcount";
}
};
@@ -919,6 +920,10 @@ public:
if (RegNo == 1) return 4;
return -1;
}
+
+ bool hasSjLjLowering() const override {
+ return true;
+ }
};
const Builtin::Info PPCTargetInfo::BuiltinInfo[] = {
@@ -2181,6 +2186,10 @@ public:
CallingConv getDefaultCallingConv(CallingConvMethodType MT) const override {
return MT == CCMT_Member ? CC_X86ThisCall : CC_C;
}
+
+ bool hasSjLjLowering() const override {
+ return true;
+ }
};
bool X86TargetInfo::setFPMath(StringRef Name) {
@@ -3354,7 +3363,10 @@ public:
: WindowsTargetInfo<X86_32TargetInfo>(Triple) {
WCharType = UnsignedShort;
DoubleAlign = LongLongAlign = 64;
- DescriptionString = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32";
+ bool IsWinCOFF =
+ getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
+ DescriptionString = IsWinCOFF ? "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
+ : "e-m:e-p:32:32-i64:64-f80:32-n8:16:32-S32";
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
@@ -5628,7 +5640,9 @@ public:
const std::string &CPUStr)
: TargetInfo(Triple), CPU(CPUStr), IsMips16(false), IsMicromips(false),
IsNan2008(false), IsSingleFloat(false), FloatABI(HardFloat),
- DspRev(NoDSP), HasMSA(false), HasFP64(false), ABI(ABIStr) {}
+ DspRev(NoDSP), HasMSA(false), HasFP64(false), ABI(ABIStr) {
+ TheCXXABI.set(TargetCXXABI::GenericMIPS);
+ }
bool isNaN2008Default() const {
return CPU == "mips32r6" || CPU == "mips64r6";
@@ -6662,6 +6676,8 @@ static TargetInfo *AllocateTarget(const llvm::Triple &Triple) {
switch (os) {
case llvm::Triple::Linux:
return new LinuxTargetInfo<PPC64TargetInfo>(Triple);
+ case llvm::Triple::NetBSD:
+ return new NetBSDTargetInfo<PPC64TargetInfo>(Triple);
default:
return new PPC64TargetInfo(Triple);
}
diff --git a/contrib/llvm/tools/clang/lib/Basic/Version.cpp b/contrib/llvm/tools/clang/lib/Basic/Version.cpp
index 982410b..ae9eb1a 100644
--- a/contrib/llvm/tools/clang/lib/Basic/Version.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/Version.cpp
@@ -36,7 +36,7 @@ std::string getClangRepositoryPath() {
// If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us
// pick up a tag in an SVN export, for example.
- StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/final/lib/Basic/Version.cpp $");
+ StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_361/final/lib/Basic/Version.cpp $");
if (URL.empty()) {
URL = SVNRepository.slice(SVNRepository.find(':'),
SVNRepository.find("/lib/Basic"));
OpenPOWER on IntegriCloud