Commit Graph

3254 Commits

Author SHA1 Message Date
Damián Silvani
d436bd8dc8 Add missing switch case for mos6502 2015-08-03 18:48:43 -03:00
Damián Silvani
964a041a08 Eliminate big-endian subtargets of Mos6502
They were copied from SPARC V8 and V9.
2015-08-03 17:13:53 -03:00
Damián Silvani
36ee8fe697 Register Mos6502 target
Also add mos6502 subtargets on Triple class
2015-08-02 22:47:30 -03:00
Matt Arsenault
d8c145fd49 Add amdopencl environment to triple
This is used by the AMD x86 OpenCL implementation
to change some ABI details on Windows and Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243627 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30 08:16:51 +00:00
Alexandros Lamprineas
10da90aaf3 - Added support for parsing HWDiv features using Target Parser.
- Architecture extensions are represented as a bitmap.

Phabricator: http://reviews.llvm.org/D11457

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243335 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-27 22:26:59 +00:00
Yaron Keren
c9cbb9371f Remove unnecessary in C++11 c_str() calls
While theoratically required in pre-C++11 to avoid re-allocation upon call,
C++11 guarantees that c_str() returns a pointer to the internal array so
pre-calling c_str() is no longer required.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242983 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 05:49:29 +00:00
Yaron Keren
27513fc040 Rename RunCallBacksToRun to llvm::sys::RunSignalHandlers
And expose it in Signals.h, allowing clients to call it directly,
possibly LLVMErrorHandler which currently calls RunInterruptHandlers
but not RunSignalHandlers, thus for example not printing the stack
backtrace on Unixish OSes. On Windows it does happen because
RunInterruptHandlers ends up calling the callbacks as well via 
Cleanup(). This difference in behaviour and code structures in
*/Signals.inc should be patched in the future.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242936 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 21:11:17 +00:00
Yaron Keren
1d5c214e84 De-duplicate Unix & Windows CallBacksToRun
Move CallBacksToRun into the common Signals.cpp, create RunCallBacksToRun()
and use these in both Unix/Signals.inc and Windows/Signals.inc.

Lots of potential code to be merged here.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242925 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 19:01:14 +00:00
Rafael Espindola
bd58d4eb97 Identify thin archives as archives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242921 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 18:29:39 +00:00
Yaron Keren
1a737f5714 Remove C++98 workaround in llvm::sys::DontRemoveFileOnSignal()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242920 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 18:23:51 +00:00
Alexandros Lamprineas
96ac935e6d Edited the CPUNames table of TargetParser
- Changed the default FPU of cortex-m4.
- Removed "cortex-m4f" entry. Currently not supported.

Change-Id: I73121e358aa9e7ba68eb001c2143df390ff2352a
Phabricator: http://reviews.llvm.org/D11100

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242528 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-17 15:49:32 +00:00
Alexandros Lamprineas
e0117a90cf - TargetParser does not handle armv7l in parseArchProfile().
- ARM V7L matches the 'A' profile of ARM architecture.

Change-Id: I80c8b973f5c93fb040c177a227644d56b1b83ea8
Phabricator: http://reviews.llvm.org/D11261

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242406 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-16 14:54:41 +00:00
Rafael Espindola
a0458b67ae Simplify a few uses of remove_filename by using parent_path instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242334 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-15 21:24:07 +00:00
Alexandros Lamprineas
4aa2f4514c -Added API for retrieving the default FPU of a CPU from TargetParser.
-Implemented as a table lookup.

Change-Id: Iaad0eaf4b29b06827e6700269496dc1ba20e9018
Phabricator: http://reviews.llvm.org/D11100

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242284 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-15 10:46:21 +00:00
Alexandros Lamprineas
b83440104d Caused regressions: compile Release+Asserts failed on clang-native-arm-cortex-a9
Revert "-Added API for retrieving the default FPU of a CPU from TargetParser."

This reverts commit 01199ab0c6.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242147 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 14:34:06 +00:00
Alexandros Lamprineas
01199ab0c6 -Added API for retrieving the default FPU of a CPU from TargetParser.
-Implemented as a table lookup.

Change-Id: Ibf7217f6bd2769e9c06835a5aede3d072dee6757
Phabricator: http://reviews.llvm.org/D11100

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242141 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 13:20:48 +00:00
Benjamin Kramer
0ed5091742 Remove macro guards for extern template instantiations.
This is a C++11 feature that both GCC and MSVC have supported as ane extension
long before C++11 was approved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242042 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-13 17:21:31 +00:00
Tamas Berghammer
6055ca7bf4 Add getSizeInBits function to the APFloat class
The newly added function returns the size of the specified floating
point semantics in bits.

Differential revision: http://reviews.llvm.org/D8413

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241793 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 10:13:39 +00:00
Benjamin Kramer
32f3dc455b [Triple] Add a helper to switch between big/little endian variants
This will be used from clang's driver.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 23:58:14 +00:00
Leny Kholodov
479dc2c0fe [Support] Lazy load of dbghlp.dll on Windows
This patch changes linkage with dbghlp.dll for clang from static (at load time)
to on demand (at the first use of required functions). Clang uses dbghlp.dll
only in minor use-cases. First of all in case of crash and in case of plugin load.
The dbghlp.dll library can be absent on system. In this case clang will fail
to load. With lazy load of dbghlp.dll clang can work even if dbghlp.dll
is not available.

Differential Revision: http://reviews.llvm.org/D10737



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241271 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 14:34:57 +00:00
Charlie Turner
8992bae990 [GraphWriter] Don't wait on xdg-open when not on Apple.
By default, the GraphWriter code assumes that the generic file open
program (`open` on Apple, `xdg-open` on other systems) can wait on the
forked proces to complete. When the fork ends, the code would delete
the temporary dot files created, and return.

On GNU/Linux, the xdg-open program does not have a "wait for your fork
to complete before dying" option. So the behaviour was that xdg-open
would launch a process, quickly die itself, and then the GraphWriter
code would think its OK to quickly delete all the temporary files.
Once the temporary files were deleted, the dot viewers would get very
upset, and often give you weird errors.

This change only waits on the generic open program on Apple platforms.
Elsewhere, we don't wait on the process, and hence we don't try and
clean up the temporary files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241250 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 09:32:07 +00:00
Dan Gohman
06bc362502 Drop the OS from the WebAssembly target triple for now.
This unbreaks TripleTest.Normalization. We'll have to come up with a new
plan for the OS component of the target triple for WebAssembly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241041 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 03:52:25 +00:00
Adrian Prantl
85cd16c88e Debug info: Add dwarf backend support for DIModule.
rdar://problem/20965932

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241034 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 02:13:04 +00:00
Dan Gohman
a74341308f [WebAssembly] Initial WebAssembly backend
This WebAssembly backend is just a skeleton at this time and is not yet
functional.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241022 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 23:51:55 +00:00
Ben Langmuir
fce3cfb784 Reapply "Use gethostuuid() on Mac to identify hosts for LockFileManager"
Reapplies r241005 after fixing the build on non-Mac platforms. Original
commit message below.

The hostname can be very unstable when there are many machines on the
network competing for the same name. Using the hardware UUID makes it
less likely to have collisions or to consider files written by the
current host to be owned by a different one at a later time.

rdar://problem/21512307

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241012 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 22:16:39 +00:00
Ben Langmuir
cb936df2a9 Revert "Use gethostuuid() on Mac to identify hosts for LockFileManager"
Broke non-Mac builds.

This reverts commit r241005.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241007 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 21:56:03 +00:00
Ben Langmuir
d5c333b731 Use gethostuuid() on Mac to identify hosts for LockFileManager
The hostname can be very unstable when there are many machines on the
network competing for the same name. Using the hardware UUID makes it
less likely to have collisions or to consider files written by the
current host to be owned by a different one at a later time.

rdar://problem/21512307

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241005 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 21:47:44 +00:00
Ben Langmuir
4081538b2e Clean up unique lock files on signal and always release the lock
Make sure to remove the unique lock file, which is what the .lock
symlink points to, if there is a signal while the lock is held. This
will release the lock, since the symlink will point to nothing (already
tested in unit tests). For good measure, also clean up the unique lock
file if there is an error or signal before the lock is acquired.

I will add a clang test.

rdar://problem/21512307

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240967 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 17:08:41 +00:00
Javed Absar
23fd3d6afc [ARM]: Extend -mfpu options for half-precision and vfpv3xd
removing default label in switch as it results.
This is part of earlier commit http://reviews.llvm.org/D1064

Subscribers: llvm-commits



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240932 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 09:53:33 +00:00
Javed Absar
263dd533ee [ARM]: Extend -mfpu options for half-precision and vfpv3xd
Some of the the permissible ARM -mfpu options, which are supported in GCC,
are currently not present in llvm/clang.This patch adds the options:
'neon-fp16', 'vfpv3-fp16', 'vfpv3-d16-fp16', 'vfpv3xd' and 'vfpv3xd-fp16.
These are related to half-precision floating-point and single precision.

Reviewers: rengolin, ranjeet.singh

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10645



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240930 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 09:32:29 +00:00
Alex Lorenz
1c5cf241af ADT: Add a string APSInt constructor.
This commit moves the APSInt initialization code that's used by
the LLLexer class into a new APSInt constructor that constructs
APSInts from strings.

This change is useful for MIR Serialization, as it would allow
the MILexer class to use the same APSInt initialization as 
LLexer when parsing immediate machine operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240436 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 18:22:10 +00:00
Alexander Kornienko
cd52a7a381 Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Apparently, the style needs to be agreed upon first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240390 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 09:49:53 +00:00
Alexander Kornienko
cf0db29df2 Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:

tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
  -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
  llvm/lib/


Thanks to Eugene Kosov for the original patch!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240137 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 15:57:42 +00:00
Eric Christopher
933d2bd391 Fix "the the" in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240112 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 01:53:21 +00:00
Rafael Espindola
4a4558e436 Use std::unique_ptr to manage the DataStreamer in bitcode parsing.
We were already deleting it, this just makes it explicit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239867 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-16 23:29:49 +00:00
Alex Lorenz
a15d888abf MIR Serialization: Connect the machine function analysis pass to the MIR parser.
This commit connects the machine function analysis pass (which creates machine
functions) to the MIR parser, which will initialize the machine functions 
with the state from the MIR file and reconstruct the machine IR.

This commit introduces a new interface called 'MachineFunctionInitializer',
which can be used to provide custom initialization for the machine functions.

This commit also introduces a new diagnostic class called 
'DiagnosticInfoMIRParser' which is used for MIR parsing errors.
This commit modifies the default diagnostic handling in LLVMContext - now the
the diagnostics are printed directly into llvm::errs() so that the MIR parsing 
errors can be printed with colours.  

Reviewers: Justin Bogner

Differential Revision: http://reviews.llvm.org/D9928


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239753 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-15 20:30:22 +00:00
Rafael Espindola
803fe19680 Don't use std::errc.
As noted on Errc.h:

// * std::errc is just marked with is_error_condition_enum. This means that
//   common patters like AnErrorCode == errc::no_such_file_or_directory take
//   4 virtual calls instead of two comparisons.

And on some libstdc++ those virtual functions conclude that

------------------------
int main() {
  std::error_code foo = std::make_error_code(std::errc::no_such_file_or_directory);
  return foo == std::errc::no_such_file_or_directory;
}
-------------------------

should exit with 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239683 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 17:23:04 +00:00
Rafael Espindola
8e2ed1643a Bring in a BumpPtrStringSaver from lld and simplify the interface.
StringSaver now always saves to a BumpPtrAllocator.

The only reason for having the virtual saveImpl is so lld can have a
thread safe version.

The reason for the distinct BumpPtrStringSaver class is to avoid the
virtual destructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239669 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 12:49:52 +00:00
Douglas Katzman
2086b2e76a Add 'shave' processor name to Triple
Based on ArchType, Clang's driver can select a non-Clang compiler.
String parsing in Clang would have sufficed if it were only that,
however this change anticipates true llvm support.

Differential Revision: http://reviews.llvm.org/D10413

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239631 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-12 18:31:38 +00:00
John Brawn
14d0411acb [ARM] Disabling vfp4 should disable fp16
ARMTargetParser::getFPUFeatures should disable fp16 whenever it
disables vfp4, as otherwise something like -mcpu=cortex-a7 -mfpu=none
leaves us with fp16 enabled (though the only effect that will have is
a wrong build attribute).

Differential Revision: http://reviews.llvm.org/D10397


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239599 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-12 09:38:51 +00:00
Reid Kleckner
5e9819c5bd [Support] Fix a race initializing a static local in MSVC
static local initialization isn't thread safe with MSVC and a race was
reported in PR23817. We can't use std::atomic because it's not trivially
constructible, so instead do some lame volatile global integer
manipulation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239566 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-11 22:22:45 +00:00
Eli Bendersky
a0c9e11a2b Add more wrappers for symbol APIs to the C API.
This represents some of the functionality we expose in the llvmlite Python
binding.

Patch by Antoine Pitrou

Differential Revision: http://reviews.llvm.org/D10222


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239411 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-09 15:57:30 +00:00
Daniel Sanders
07ce69ae7d [ADT] Assert that SmallVectorBase::grow_pod() successfully reallocates memory.
Summary:
If malloc/realloc fails then the SmallVector becomes unusable since begin() and
end() will return NULL. This is unlikely to occur but was the cause of recent
bugpoint test failures on my machine.

It is not clear whether not checking for malloc/realloc failure is a deliberate
decision and adding checks has the potential to impact compiler performance.
Therefore, this patch only adds the check to builds with assertions enabled for
the moment.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: bkramer, llvm-commits

Differential Revision: http://reviews.llvm.org/D9520

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239392 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-09 09:47:46 +00:00
NAKAMURA Takumi
4fb638b527 TargetParser: Fix comments in enum(s) introduced in r239150. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239211 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 01:41:35 +00:00
Alexei Starovoitov
b6ebf678ac [bpf] rename triple names bpf_be -> bpfeb
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239162 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 16:11:14 +00:00
Benjamin Kramer
cdb8c729f2 [TargetParser] Properly attach functions of ARMTargetParser to the class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239158 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 14:33:02 +00:00
John Brawn
272d7fdf42 [ARM] Add support for -sp- FPUs and FPU none to TargetParser
These are added mainly for the benefit of clang, but this also means that they
are now allowed in .fpu directives and we emit the correct .fpu directive when
single-precision-only is used.

Differential Revision: http://reviews.llvm.org/D10238


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239151 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 13:31:19 +00:00
John Brawn
c1c9bc1df7 [ARM] Add knowledge of FPU subtarget features to TargetParser
Add getFPUFeatures to TargetParser, which gets the list of subtarget features
that are enabled/disabled for each FPU, and use it when handling the .fpu
directive.

No functional change in this commit, though clang will start behaving
differently once it starts using this.

Differential Revision: http://reviews.llvm.org/D10237


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239150 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 13:29:24 +00:00
Artyom Skrobov
b4435accd5 [ARMTargetParser] Follow-up for r239099: one case was missed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239147 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 12:39:28 +00:00
Artyom Skrobov
6782fc61ca Simplify ARMTargetParser::getArchSynonym
Summary:
1) The only caller, ARMTargetParser::parseArch, uses the results for an "endswith" test; so, including the "arm" prefix into the result is unnecessary.
2) Most ARMTargetParser::parseArch callers pass it the output from ARMTargetParser::getCanonicalArchName; so, make this behaviour the default. Then, including the "arm" prefix into the cases is unnecessary.

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10249


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239099 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 21:26:58 +00:00