aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic
AgeCommit message (Collapse)AuthorFilesLines
2015-01-11Basic: [asmSymbolicName] follows the same rule as numbers in asm inputsDavid Majnemer1-0/+4
Input constraints like "0" and "[foo]" should be treated the same when it comes to their corresponding output constraint. This fixes PR21850. llvm-svn: 225605
2015-01-11Basic: The asm constraint '#m' isn't valid, reject itDavid Majnemer1-1/+7
llvm-svn: 225603
2015-01-11Basic: The asm constraint '+#r' isn't valid, reject itDavid Majnemer1-1/+5
llvm-svn: 225600
2015-01-10Sema: The asm constraint '+&m' isn't valid, reject itDavid Majnemer1-0/+7
Don't permit '+&m' to make it to CodeGen, it's invalid. llvm-svn: 225586
2015-01-08When the diagnostic text is simply "%0", sanitize the string for anyRichard Trieu1-0/+15
unprintable characters. Fixes PR22048. llvm-svn: 225423
2015-01-06R600: Handle amdgcn tripleTom Stellard1-0/+1
For now there is no difference between amdgcn and r600. llvm-svn: 225294
2015-01-06Sema: analyze I,J,K,M,N,O constraintsSaleem Abdulrasool2-0/+57
Add additional constraint checking for target specific behaviour for inline assembly constraints. We would previously silently let all arguments through for these constraints. In cases where the constraints were violated, we could end up failing to select instructions and triggering assertions or worse, silently ignoring instructions. llvm-svn: 225244
2014-12-27Fix formatting. NFC.Craig Topper1-2/+2
llvm-svn: 224877
2014-12-18Update for llvm front end change and use the TargetOptions structEric Christopher1-5/+0
for ABI. llvm-svn: 224493
2014-12-18Make sure that arm-linux-gnu is still the apcs-gnu ABI when weEric Christopher1-0/+3
use clang -cc1 matching the front end and backend. Fix up a couple of tests that were testing aapcs for arm-linux-gnu. The test that removes the aapcs abi calling convention removes them because the default triple matches what the backend uses for the calling convention there and so it doesn't need to be explicitly stated - see the code in TargetInfo.cpp. llvm-svn: 224491
2014-12-17Destroy the diagnostic client first in ~DiagnosticEngineReid Kleckner1-0/+6
Add a comment and a test to ~DiagnosticEngine about the ordering requirements on the teardown of DiagnosticConsumer. This could also be accomplished by rearranging the fields of ~DiagnosticEngine, but I felt that this was a better, more explicit solution. This fixes PR21911, an issue that occurred after the unique_ptr migration in r222193. llvm-svn: 224454
2014-12-17[mips] Always clobber $1 for MIPS inline asm.Toma Tabacu1-2/+1
Summary: Because GCC doesn't use $1 for code generation, inline assembly code can use $1 without having to add it to the clobbers list. LLVM, on the other hand, does not shy away from using $1, and this can cause conflicts with inline assembly which assumes GCC-like code generation. A solution to this problem is to make Clang automatically clobber $1 for all MIPS inline assembly. This is not the optimal solution, but it seems like a necessary compromise, for now. Reviewers: dsanders Reviewed By: dsanders Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6638 llvm-svn: 224428
2014-12-11[modules] When constructing paths relative to a module, strip out /./ directoryRichard Smith1-4/+39
components. These sometimes get synthetically added, and we don't want -Ifoo and -I./foo to be treated fundamentally differently here. llvm-svn: 224055
2014-12-11Emit warning if define or undef reserved identifier or keyword.Serge Pavlov1-2/+27
Recommit of r223114, reverted in r223120. llvm-svn: 224012
2014-12-10Revert r223578, perf data collection depends on the old symbol name.Paul Robinson3-11/+11
llvm-svn: 223987
2014-12-10cmake: Make SVNVersion.inc step depend on GetSVN.cmake.Nico Weber1-2/+4
This way, the step generating SVNVersion.inc gets rerun every time someone changes GetSVN.cmake (which is the file that decides how the contents of SVNVersion.inc look). This makes hacking on GetSVN.cmake a bit easier. llvm-svn: 223861
2014-12-09Re-work the Clang system for classifying Intel x86 CPUs to use theirChandler Carruth1-38/+71
basic microarchitecture names, and add support (with tests) for parsing all of the masic microarchitecture names for CPUs documented to be accepted by GCC with -march. I didn't go back through the 32-bit-only old microarchitectures, but this at least brings the recent architecture names up to speed. This is essentially the follow-up to the LLVM commit r223769 which did similar cleanups for the LLVM CPUs. One particular benefit is that you can now use -march=westmere in Clang and get the LLVM westmere processor which is a different ISA variant (!) and so quite significant. Much like with r223769, I would appreciate the Intel folks carefully thinking about the macros defined, names used, etc for the atom chips and newest primary x86 chips. The current patterns seem quite strange to me, especially here in Clang. Note that I haven't replicated the per-microarchitecture macro defines provided by GCC. I'm really opposed to source code using these rather than using ISA feature macros. llvm-svn: 223776
2014-12-06Rename a couple of preprocessor symbols to be more descriptive. NFC.Paul Robinson3-11/+11
Review feedback from recent changes to GetSVN.cmake. llvm-svn: 223578
2014-12-05Specify the name of the generated header only once. NFC.Paul Robinson1-4/+7
This will also simplify a private patch that we have. llvm-svn: 223537
2014-12-05Make DiagnosticErrorTrap work even if SuppressAllDiagnostics is enabled.Richard Smith1-10/+11
Patch by Brad King! llvm-svn: 223525
2014-12-05Have the driver and the target code agree on what the default ABIEric Christopher1-1/+36
is for each machine. Fix up darwin tests that were testing for aapcs on armv7-ios when the actual ABI is apcs. Should be no user visible change without -cc1. llvm-svn: 223429
2014-12-03CUDA host device code with two code pathsReid Kleckner1-8/+41
Summary: Allow CUDA host device functions with two code paths using __CUDA_ARCH__ to differentiate between code path being compiled. For example: __host__ __device__ void host_device_function(void) { #ifdef __CUDA_ARCH__ device_only_function(); #else host_only_function(); #endif } Patch by Jacques Pienaar. Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D6457 llvm-svn: 223271
2014-12-02Make le64 DescriptionString consistent with other targets.JF Bastien1-1/+1
Summary: In particular, remove the defaults and reorder fields so it matches the result of DataLayout::getStringDescription(). Change by David Neto. Reviewers: dschuff, sdt Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6482 llvm-svn: 223140
2014-12-02Reverted r223114, it caused failure on on clang-native-arm-cortex-a9.Serge Pavlov1-27/+2
llvm-svn: 223120
2014-12-02Emit warning if define or undef reserved identifier or keyword.Serge Pavlov1-2/+27
Summary: This change implements warnings if macro name is identical to a keyword or reserved identifier. The warnings are different depending on the "danger" of the operation. Defining macro that replaces a keyword is on by default. Other cases produce warning that is off by default but can be turned on using option -Wreserved-id-macro. This change fixes PR11488. Reviewers: rnk Reviewed By: rnk Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D6194 llvm-svn: 223114
2014-12-02[modules] Track how 'header' directives were written in module map files,Richard Smith1-12/+13
rather than trying to extract this information from the FileEntry after the fact. This has a number of beneficial effects. For instance, diagnostic messages for failed module builds give a path relative to the "module root" rather than an absolute file path, and the contents of the module includes file is no longer dependent on what files the including TU happened to inspect prior to triggering the module build. llvm-svn: 223095
2014-12-01Update R600 address space map to include genericMatt Arsenault1-2/+1
llvm-svn: 223046
2014-11-26[OpenCL] Generic address space has been added in OpenCL v2.0.Anastasia Stulova1-0/+7
To support it in the frontend, the following has been added: - generic address space type attribute; - documentation for the OpenCL address space attributes; - parsing of __generic(generic) keyword; - test code for the parser and diagnostics. llvm-svn: 222831
2014-11-25[ARM] Define __ARM_FEATURE_DSP macro for CPUs that have DSP instructionsSergey Dmitrouk1-0/+7
Summary: This resolves [[ http://llvm.org/bugs/show_bug.cgi?id=17391 | PR17391 ]]. GCC's sources were used as a guide (couldn't find much information in ARM documentation). Reviewers: doug.gregor, asl Reviewed By: asl Subscribers: asl, aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D6339 llvm-svn: 222741
2014-11-20[CMake] Use .svn/wc.db as our VC dependency if it's available.Jordan Rose1-6/+10
In order to keep SVNVersion.inc from being regenerated on every build, we need to specify as a dependency a file that only changes when the VC state updates. I previously just had .svn/entries, but that's only used by Subversion 1.6. 1.7 uses .svn/wc.db instead; prefer that if it's present. (Thanks, Nico!) llvm-svn: 222407
2014-11-19[CMake] Always include the Clang repo version, just like the autoconf build.Jordan Rose1-25/+43
Now that LLVM's helper script GetSVN.cmake actually works consistently, there's no reason not to use it. We avoid having to regenerate SVNVersion.inc every time by marking it as dependent on Git's reflog or SVN's entries file. This should end most of the issues of the AST format changing and breaking old module files: CMake-Clang should now detect that the version changed just like Autoconf-Clang has. Based on r190557. Depends on LLVM r222391. llvm-svn: 222393
2014-11-19Standardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue.David Blaikie2-45/+40
llvm-svn: 222306
2014-11-19Update for LLVM API changeDavid Blaikie1-1/+1
llvm-svn: 222303
2014-11-18Fix 80-column violations, trailing whitespace, comment text.Eric Christopher1-63/+74
llvm-svn: 222269
2014-11-17Make DiagnosticsEngine::takeClient return std::unique_ptr<>Alexander Kornienko1-15/+5
Summary: Make DiagnosticsEngine::takeClient return std::unique_ptr<>. Updated callers to store conditional ownership using a pair of pointer and unique_ptr instead of a pointer + bool. Updated code that temporarily registers clients to use the non-owning registration (+ removed extra calls to takeClient). Reviewers: dblaikie Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6294 llvm-svn: 222193
2014-11-17Basic: tweak commentSaleem Abdulrasool1-0/+1
Add a missing surrounding brace for doxygen group. This messes with pair jumping in vim and is annoying. NFC. llvm-svn: 222155
2014-11-14Remove some redundant virtual specifiers on overriden functions.David Blaikie1-7/+7
llvm-svn: 222024
2014-11-14Complete support for the SD-6 standing document (based off N4200) with ↵Aaron Ballman1-2/+2
support for __has_cpp_attribute. llvm-svn: 221991
2014-11-14[Sanitizer] Refactor SanitizerArgs parsing in Driver.Alexey Samsonov1-0/+4
Remove flag parsing details from the public header. Use SanitizerSet to represent the set of enabled sanitizers. Cleanup the implementation: update the comments to reflect reality, remove dead code. No functionality change. llvm-svn: 221968
2014-11-14Remove -fseh-exceptions in favor of checking the tripleReid Kleckner1-0/+4
This option was misleading because it looked like it enabled the language feature of SEH (__try / __except), when this option was really controlling which EH personality function to use. Mingw only supports SEH and SjLj EH on x86_64, so we can simply do away with this flag. llvm-svn: 221963
2014-11-13Hook up FreeBSD AArch64 supportEd Maste1-0/+4
Patch from Andrew Turner. llvm-svn: 221900
2014-11-11[Sanitizer] Refactor sanitizer options in LangOptions.Alexey Samsonov3-18/+33
Get rid of ugly SanitizerOptions class thrust into LangOptions: * Make SanitizeAddressFieldPadding a regular language option, and rely on default behavior to initialize/reset it. * Make SanitizerBlacklistFile a regular member LangOptions. * Introduce the helper class "SanitizerSet" to represent the set of enabled sanitizers and make it a member of LangOptions. It is exactly the entity we want to cache and modify in CodeGenFunction, for instance. We'd also be able to reuse SanitizerSet in CodeGenOptions for storing the set of recoverable sanitizers, and in the Driver to represent the set of sanitizers turned on/off by the commandline flags. No functionality change. llvm-svn: 221653
2014-11-07Introduce a SanitizerKind enum to LangOptions.Alexey Samsonov2-5/+13
Use the bitmask to store the set of enabled sanitizers instead of a bitfield. On the negative side, it makes syntax for querying the set of enabled sanitizers a bit more clunky. On the positive side, we will be able to use SanitizerKind to eventually implement the new semantics for -fsanitize-recover= flag, that would allow us to make some sanitizers recoverable, and some non-recoverable. No functionality change. llvm-svn: 221558
2014-11-06Remove references to the cortex-a9-mp CPU.Charlie Turner1-3/+2
This CPU definition is redundant. The Cortex-A9 is defined as supporting multiprocessing extensions. Remove references to this CPU. This CPU was recently removed from LLVM. See http://reviews.llvm.org/D6057 Change-Id: I62ae7cc656fcae54fbaefc4b6976e77e694a8678 llvm-svn: 221458
2014-11-06[X86] Slightly refactor default features for AMD bdver cpus (NFC). Also add ↵Andrea Di Biagio1-12/+7
missing checks to test for target features. This patch simplifies how default target features are set for AMD bdver2 and bdver1. In particular, method 'getDefaultFeatures' now implements a fallthrough from case 'CK_BDVER2' to case 'CK_BDVER1'. That is because 'bdver2' has the same features available in bdver1 plus BMI, FMA, F16C and TBM. This patch also adds missing checks for predefined macros in test predefined-arch-macros.c. In the case of BTVER2, the test now also checks for F16C, BMI and PCLMUL. In the case of BDVER3 and BDVER4, the test now also checks for the presence of FSGSBASE. Differential Revision: http://reviews.llvm.org/D6134 llvm-svn: 221449
2014-11-06[X86] Use fallthroughs to reduce the number of calls to setFeatureEnabled ↵Craig Topper1-98/+45
for different CPUs. llvm-svn: 221437
2014-11-03[x86] Add cx16 feature to KNL, SKX, and CoreAVXi CPUs.Craig Topper1-2/+5
llvm-svn: 221132
2014-11-03[x86] Realphabetize the feature string decoding function since it was mostly ↵Craig Topper1-4/+4
in alphabetical order. llvm-svn: 221131
2014-11-03Add FSGSBASE intrinsics to x86 intrinsic headers.Craig Topper1-7/+24
llvm-svn: 221130
2014-11-02[PowerPC] Change PPCTargetInfo::hasFeature() to use StringSwitchBill Schmidt1-3/+5
Implement post-commit comment on r220989 from Eric Christopher. llvm-svn: 221099