Commit Graph

1265 Commits

Author SHA1 Message Date
Saleem Abdulrasool d3bafe3e41 MCJIT: ensure that cygwin is identified properly
Cygwin is now a proper environment rather than an OS.  This updates the MCJIT
tests to avoid execution on Cygwin.  This fixes native cygwin tests.

llvm-svn: 205266
2014-03-31 23:42:23 +00:00
Saleem Abdulrasool 28b82bc39e Support: generalise object type handling for Windows
This generalises the object file type parsing to all Windows environments.  This
is used by cygwin as well as MSVC environments for MCJIT.  This also makes the
triple more similar to Chandler's suggestion of a separate field for the object
file format.

llvm-svn: 205219
2014-03-31 16:34:41 +00:00
Chandler Carruth 9df0fd4018 [Allocator] Lift the slab size and size threshold into template
parameters rather than runtime parameters.

There is only one user of these parameters and they are compile time for
that user. Making these compile time seems to better reflect their
intended usage as well.

llvm-svn: 205143
2014-03-30 12:07:07 +00:00
Chandler Carruth a05a221e63 [Allocator] Simplify unittests by using the default size parameters in
more places.

llvm-svn: 205141
2014-03-30 11:36:32 +00:00
Tim Northover af6bfb21cd ARM64: remove -m32/-m64 mapping with ARM.
This is causing the ARM build-bots to fail since they only include
the ARM backend and can't create an ARM64 target.

llvm-svn: 205132
2014-03-30 07:25:23 +00:00
Saleem Abdulrasool f80b49b5d2 Support: correct Windows normalisation
If the environment is unknown and no object file is provided, then assume an
"MSVC" environment, otherwise, set the environment to the object file format.

In the case that we have a known environment but a non-native file format for
Windows (COFF) which is used for MCJIT, then append the custom file format to
the triple as an additional component.

This fixes the MCJIT tests on Windows.

llvm-svn: 205130
2014-03-30 07:19:31 +00:00
Tim Northover 00ed9964c6 ARM64: initial backend import
This adds a second implementation of the AArch64 architecture to LLVM,
accessible in parallel via the "arm64" triple. The plan over the
coming weeks & months is to merge the two into a single backend,
during which time thorough code review should naturally occur.

Everything will be easier with the target in-tree though, hence this
commit.

llvm-svn: 205090
2014-03-29 10:18:08 +00:00
Saleem Abdulrasool edbdd2e5df Canonicalise Windows target triple spellings
Construct a uniform Windows target triple nomenclature which is congruent to the
Linux counterpart.  The old triples are normalised to the new canonical form.
This cleans up the long-standing issue of odd naming for various Windows
environments.

There are four different environments on Windows:

MSVC: The MS ABI, MSVCRT environment as defined by Microsoft
GNU: The MinGW32/MinGW32-W64 environment which uses MSVCRT and auxiliary libraries
Itanium: The MSVCRT environment + libc++ built with Itanium ABI
Cygnus: The Cygwin environment which uses custom libraries for everything

The following spellings are now written as:

i686-pc-win32 => i686-pc-windows-msvc
i686-pc-mingw32 => i686-pc-windows-gnu
i686-pc-cygwin => i686-pc-windows-cygnus

This should be sufficiently flexible to allow us to target other windows
environments in the future as necessary.

llvm-svn: 204977
2014-03-27 22:50:05 +00:00
NAKAMURA Takumi cb5ebf66df Untabify.
llvm-svn: 204916
2014-03-27 11:38:28 +00:00
NAKAMURA Takumi cce8a58202 SmallVector<3> may be used here.
llvm-svn: 204915
2014-03-27 11:33:11 +00:00
NAKAMURA Takumi be8556d17a IRTests/InstructionsTest.cpp: Avoid initializer list.
llvm-svn: 204914
2014-03-27 11:32:41 +00:00
Reid Kleckner 23798a9731 CloneFunction: Clone all attributes, including the CC
Summary:
Tested with a unit test because we don't appear to have any transforms
that use this other than ASan, I think.

Fixes PR17935.

Reviewers: nicholas

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3194

llvm-svn: 204866
2014-03-26 22:26:35 +00:00
Eli Bendersky 8474162f2c Add a unit test for Invoke iteration, similar to the one for Call
The tests are refactored to use the same fixture.

llvm-svn: 204860
2014-03-26 21:46:24 +00:00
Eli Bendersky c35c4b3ddb Fix bot breakage in InstructionsTest.
Makes sure the Call dies before the Function

llvm-svn: 204856
2014-03-26 21:11:34 +00:00
Eli Bendersky 84aa5e555f Fix problem with r204836
In CallInst, op_end() points at the callee, which we don't want to iterate over
when just iterating over arguments. Now take this into account when returning
a iterator_range from arg_operands. Similar reasoning for InvokeInst.

Also adds a unit test to verify this actually works as expected.

llvm-svn: 204851
2014-03-26 20:41:15 +00:00
Rafael Espindola 663ac28603 Fix these tests on windows.
It is impossible to create a hard link to a non existing file, so create a
dummy file, create the link an delete the dummy file.

On windows one cannot remove the current directory, so chdir first.

llvm-svn: 204719
2014-03-25 13:19:03 +00:00
NAKAMURA Takumi 126a6c0238 SupportTests.LockFileManagerTest: Add assertions for Win32.
- create_link doesn't work for nonexistent file.
  - remove cannot remove working directory.

llvm-svn: 204579
2014-03-23 23:55:57 +00:00
NAKAMURA Takumi d1c22bef6f Suppress SupportTests.LockFileManagerTest on win32 for investigating.
llvm-svn: 204533
2014-03-22 00:27:17 +00:00
Argyrios Kyrtzidis 531a5be4d0 [Support] Make sure LockFileManager works correctly with relative paths.
llvm-svn: 204426
2014-03-21 02:31:56 +00:00
Argyrios Kyrtzidis 3757569318 [Support] Make sure sys::fs::remove can remove symbolic links and make sure LockFileManager can handle a symbolic link that points nowhere.
llvm-svn: 204422
2014-03-21 01:25:37 +00:00
David Majnemer d9eb2d1401 Object: Don't double-escape empty hexdata
We would emit a pair of double quotes inside a pair of single quotes.
Just use a pair of single quotes.

llvm-svn: 204312
2014-03-20 06:28:52 +00:00
NAKAMURA Takumi a87ed3cf4c DebugIRTests: Fixup for r204130.
llvm-svn: 204132
2014-03-18 09:58:28 +00:00
Alon Mishne ad312155a6 [C++11] Change DebugInfoFinder to use range-based loops
Also changes the iterators to return actual DI type over MDNode.

llvm-svn: 204130
2014-03-18 09:41:07 +00:00
Chandler Carruth 999b92d5aa [PM] As was pointed out in review, I need to define a custom swap in
order to use the single assignment. That's probably worth doing for
a lot of these types anyways as they may have non-trivial moves and so
getting copy elision in more places seems worthwhile.

I've tried to add some tests that actually catch this mistake, and one
of the types is now well tested but the others' tests still fail to
catch this. I'll keep working on tests, but this gets the core pattern
right.

llvm-svn: 203780
2014-03-13 10:42:18 +00:00
Justin Bogner f404b93576 unittests: Fix -Werror build
llvm-svn: 203679
2014-03-12 17:00:52 +00:00
Eli Bendersky 09a95e0b12 Add parens around && clauses in a || to appease the compiler.
Otherwise gcc 4.8.2 generates a warning.

llvm-svn: 203671
2014-03-12 16:14:53 +00:00
Alon Mishne 07d949f39a Cloning a function now also clones its debug metadata if 'ModuleLevelChanges' is true.
llvm-svn: 203662
2014-03-12 14:42:51 +00:00
Saleem Abdulrasool afc50b3ed4 support: add a utility function to normalise path separators
Add a utility function to convert the Windows path separator to Unix style path
separators.  This is used by a subsequent change in clang to enable the use of
Windows SDK headers on Linux.

llvm-svn: 203611
2014-03-11 22:05:42 +00:00
Rafael Espindola 83f858e578 Cleanup the interface for creating soft or hard links.
Before this patch the unix code for creating hardlinks was unused. The code
for creating symbolic links was implemented in lib/Support/LockFileManager.cpp
and the code for creating hard links in lib/Support/*/Path.inc.

The only use we have for these is in LockFileManager.cpp and it can use both
soft and hard links. Just have a create_link function that creates one or the
other depending on the platform.

llvm-svn: 203596
2014-03-11 18:40:24 +00:00
NAKAMURA Takumi 8800becdd1 MultiJITTest.cpp: Tweak getPointerToNamedFunction() to be aware of also Windows x64.
In import thunk, jmp is:
  - On x86, 0xFF 0x25 [disp32].
  - On x64, 0xFF 0x25 [pcrel32].

See also my r144178.

llvm-svn: 203523
2014-03-11 00:34:38 +00:00
NAKAMURA Takumi 8346167fab ADT/PointerIntPairTest.cpp: Appease msc17.
- Use constructor instead of initializer list.
  - Disable ManyUnusedBits for now.

llvm-svn: 203436
2014-03-10 02:33:17 +00:00
Chandler Carruth 5ae74a6af2 [PM] While I'm here, fix a few other clang-format issues. Pulls some
lines under 80-columns, etc.

llvm-svn: 203434
2014-03-10 02:12:14 +00:00
Chandler Carruth 3056818033 [C++11] Now that we have C++11 and I've replaced the use of this
horrible smart pointer by std::unique_ptr and strict move semantics, rip
this out.

llvm-svn: 203392
2014-03-09 11:51:11 +00:00
Chandler Carruth c3f3da3d21 [PM] Switch new pass manager from polymorphic_ptr to unique_ptr now that
it is available. Also make the move semantics sufficiently correct to
tolerate move-only passes, as the PassManagers *are* move-only passes.

llvm-svn: 203391
2014-03-09 11:49:53 +00:00
Ahmed Charles f9d26f1b78 [C++11] Add llvm::make_unique, according to N3656.
llvm-svn: 203387
2014-03-09 11:20:17 +00:00
David Blaikie 259a5a649f Revert "Clean up SmallString a bit"
This reverts commit r203374.

Ambiguities in assign... oh well. I'm just going to revert this and
probably not try to recommit it as it's not terribly important.

llvm-svn: 203375
2014-03-09 06:22:58 +00:00
David Blaikie d028adf7bc Clean up SmallString a bit
Move a common utility (assign(iter, iter)) into SmallVector (some of the
others could be moved there too, but this one seemed particularly
generic) and replace repetitions overrides with using directives.

And simplify SmallVector::assign(num, element) while I'm here rather
than thrashing these files (that cause everyone to rebuild) again.

llvm-svn: 203374
2014-03-09 06:17:01 +00:00
Ahmed Charles 007bf9a541 Fix 80 cols.
llvm-svn: 203346
2014-03-08 12:51:31 +00:00
Eli Bendersky 4ccce1b728 Fix EXPECT_* to not produce a compile warning.
EXPECT_TRUE/FALSE is also more idiomatic for booleans than EXPECT_EQ

llvm-svn: 203284
2014-03-07 21:04:24 +00:00
Jordan Rose 05f44b4d1c [ADT] Update PointerIntPair to handle pointer types with more than 31 bits free.
Previously, the assertions in PointerIntPair would try to calculate the value
(1 << NumLowBitsAvailable); the inferred type here is 'int', so if there were
more than 31 bits available we'd get a shift overflow.

Also, add a rudimentary unit test file for PointerIntPair.

llvm-svn: 203273
2014-03-07 19:19:56 +00:00
Benjamin Kramer bcc77b04bb [C++11] Now that the users are gone, rip out the duplicated traits from type_traits.h
Simplify the remaining ones a bit.

llvm-svn: 203249
2014-03-07 15:54:23 +00:00
Benjamin Kramer f04ddd01c9 [C++11] Replace LLVM-style type traits with C++11 standard ones.
No functionality change.

llvm-svn: 203242
2014-03-07 14:42:25 +00:00
Saleem Abdulrasool 35476334e9 Support: split object format out of environment
This is a preliminary setup change to support a renaming of Windows target
triples.  Split the object file format information out of the environment into a
separate entity.  Unfortunately, file format was previously treated as an
environment with an unknown OS.  This is most obvious in the ARM subtarget where
the handling for macho on an arbitrary platform switches to AAPCS rather than
APCS (as per Apple's needs).

llvm-svn: 203160
2014-03-06 20:47:11 +00:00
Ahmed Charles 56440fd820 Replace OwningPtr<T> with std::unique_ptr<T>.
This compiles with no changes to clang/lld/lldb with MSVC and includes
overloads to various functions which are used by those projects and llvm
which have OwningPtr's as parameters. This should allow out of tree
projects some time to move. There are also no changes to libs/Target,
which should help out of tree targets have time to move, if necessary.

llvm-svn: 203083
2014-03-06 05:51:42 +00:00
Chandler Carruth 6cc07df4ec [Layering] Sink Linker.h into a Linker subdirectory to make it
consistent with every other sub-library header in LLVM.

llvm-svn: 203065
2014-03-06 03:42:23 +00:00
Chandler Carruth 9a4c9e597b [Layering] Move DebugInfo.h into the IR library where its implementation
already lives.

llvm-svn: 203046
2014-03-06 00:46:21 +00:00
Chandler Carruth 12664a0b17 [Layering] Move DIBuilder.h into the IR library where its implementation
already lives.

llvm-svn: 203038
2014-03-06 00:22:06 +00:00
Ben Langmuir 8d11639612 Fix an inconsistency in treatment of trailing / in path::const_iterator
When using a //net/ path, we were transforming the trailing / into a '.'
when the path was just the root path and we were iterating backwards.
Forwards iteration and other kinds of root path (C:\, /) were already
correct.

llvm-svn: 202999
2014-03-05 19:56:30 +00:00
Ahmed Charles fba066461f [C++11] Add overloads for externally used OwningPtr functions.
This will allow external callers of these functions to switch over time
rather than forcing a breaking change all a once. These particular
functions were determined by building clang/lld/lldb.

llvm-svn: 202959
2014-03-05 10:27:34 +00:00
Ahmed Charles 96c9d95f51 [C++11] Replace OwningPtr::take() with OwningPtr::release().
llvm-svn: 202957
2014-03-05 10:19:29 +00:00