diff options
author | dim <dim@FreeBSD.org> | 2015-01-18 14:14:47 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-18 14:14:47 +0000 |
commit | c074a2b0d05fdd11d61e6c5ffa970c806be2f31a (patch) | |
tree | 0e56d6fc0fbb158ec2ac946d1e22170e0107492d /contrib/llvm/patches/patch-20-llvm-r223147-arm-cpu-directive.diff | |
parent | 814696f72012ae32daa581d7a1d5253a9b439b09 (diff) | |
parent | 3c7e7a1538a873b0d3b012ef8811969ac4552c2a (diff) | |
download | FreeBSD-src-c074a2b0d05fdd11d61e6c5ffa970c806be2f31a.zip FreeBSD-src-c074a2b0d05fdd11d61e6c5ffa970c806be2f31a.tar.gz |
Upgrade our copy of clang and llvm to 3.5.1 release. This is a bugfix
only release, no new features have been added.
Please note that this version requires C++11 support to build; see
UPDATING for more information.
Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.5.1/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.5.1/tools/clang/docs/ReleaseNotes.html>
MFC after: 1 month
X-MFC-With: 276479
Diffstat (limited to 'contrib/llvm/patches/patch-20-llvm-r223147-arm-cpu-directive.diff')
-rw-r--r-- | contrib/llvm/patches/patch-20-llvm-r223147-arm-cpu-directive.diff | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/contrib/llvm/patches/patch-20-llvm-r223147-arm-cpu-directive.diff b/contrib/llvm/patches/patch-20-llvm-r223147-arm-cpu-directive.diff new file mode 100644 index 0000000..e97dc2e --- /dev/null +++ b/contrib/llvm/patches/patch-20-llvm-r223147-arm-cpu-directive.diff @@ -0,0 +1,79 @@ +Pull in r223147, r223255 and r223390 from upstream llvm trunk (by Roman +Divacky): + + Introduce CPUStringIsValid() into MCSubtargetInfo and use it for ARM + .cpu parsing. + + Previously .cpu directive in ARM assembler didnt switch to the new + CPU and therefore acted as a nop. This implemented real action for + .cpu and eg. allows to assembler FreeBSD kernel with -integrated-as. + + Change the name to be in style. + + Add a FIXME as requested by Renato Golin. + +Introduced here: http://svnweb.freebsd.org/changeset/base/275654 + +Index: include/llvm/MC/MCSubtargetInfo.h +=================================================================== +--- include/llvm/MC/MCSubtargetInfo.h ++++ include/llvm/MC/MCSubtargetInfo.h +@@ -132,6 +132,15 @@ class MCSubtargetInfo { + + /// Initialize an InstrItineraryData instance. + void initInstrItins(InstrItineraryData &InstrItins) const; ++ ++ /// Check whether the CPU string is valid. ++ bool isCPUStringValid(StringRef CPU) { ++ auto Found = std::find_if(ProcDesc.begin(), ProcDesc.end(), ++ [=](const SubtargetFeatureKV &KV) { ++ return CPU == KV.Key; ++ }); ++ return Found != ProcDesc.end(); ++ } + }; + + } // End llvm namespace +Index: lib/Target/ARM/AsmParser/ARMAsmParser.cpp +=================================================================== +--- lib/Target/ARM/AsmParser/ARMAsmParser.cpp ++++ lib/Target/ARM/AsmParser/ARMAsmParser.cpp +@@ -8618,6 +8618,20 @@ bool ARMAsmParser::parseDirectiveEabiAttr(SMLoc L) + bool ARMAsmParser::parseDirectiveCPU(SMLoc L) { + StringRef CPU = getParser().parseStringToEndOfStatement().trim(); + getTargetStreamer().emitTextAttribute(ARMBuildAttrs::CPU_name, CPU); ++ ++ if (!STI.isCPUStringValid(CPU)) { ++ Error(L, "Unknown CPU name"); ++ return false; ++ } ++ ++ // FIXME: This switches the CPU features globally, therefore it might ++ // happen that code you would not expect to assemble will. For details ++ // see: http://llvm.org/bugs/show_bug.cgi?id=20757 ++ STI.InitMCProcessorInfo(CPU, ""); ++ STI.InitCPUSchedModel(CPU); ++ unsigned FB = ComputeAvailableFeatures(STI.getFeatureBits()); ++ setAvailableFeatures(FB); ++ + return false; + } + +Index: test/MC/ARM/cpu-test.s +=================================================================== +--- test/MC/ARM/cpu-test.s ++++ test/MC/ARM/cpu-test.s +@@ -0,0 +1,13 @@ ++// RUN: not llvm-mc -o - -triple arm-gnueabi-freebsd11.0 < %s > %t 2> %t2 ++// RUN: FileCheck %s < %t ++// RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t2 ++ ++// CHECK: .cpu cortex-a8 ++.cpu cortex-a8 ++// CHECK: dsb sy ++dsb ++.cpu arm9 ++// CHECK-ERROR: error: instruction requires: data-barriers ++dsb ++// CHECK-ERROR: error: Unknown CPU name ++.cpu foobar |