Commit Graph

180861 Commits

Author SHA1 Message Date
Hal Finkel 0815a05fd7 Make isAliased property for fixed-offset stack objects adjustable
We used to assume that any fixed-offset stack object was not aliased. This
meant that no IR value could point to the memory contained in such an object.
This is a reasonable default, but is not a universally-correct
target-independent fact. For example, on PowerPC (both Darwin and non-Darwin),
some byval arguments are allocated at fixed offsets by the ABI. These, however,
certainly can be pointed to by IR values. This change moves the 'isAliased'
logic out of FixedStackPseudoSourceValue and into MFI, and allows the isAliased
property to be overridden for fixed-offset objects.

This will be used by an upcoming commit to the PowerPC backend to fix PR20280.

No functionality change intended (the behavior of
FixedStackPseudoSourceValue::isAliased has been made more conservative for
callers that don't pass an MFI object, but I don't see any in-tree callers that
do that).

llvm-svn: 215794
2014-08-16 00:17:02 +00:00
Hal Finkel dda588cdc1 [PowerPC] Darwin byval arguments are not immutable
On PPC/Darwin, byval arguments occur at fixed stack offsets in the callee's
frame, but are not immutable -- the pointer value is directly available to the
higher-level code as the address of the argument, and the value of the byval
argument can be modified at the IR level.

This is necessary, but not sufficient, to fix PR20280. When PR20280 is fixed in
a follow-up commit, its test case will cover this change.

llvm-svn: 215793
2014-08-16 00:16:29 +00:00
Zachary Turner 4ec5d0d0e1 In the CMake build, convert lldbHost to be a single static library.
Previously lldbHost was built as multiple static libraries such as
lldbHostCommon, lldbHostLinux, etc.  With this patch, the CMake
build produces only a single static library, lldbHost, whose file
set is dynamically created based on the platform.

llvm-svn: 215792
2014-08-15 23:50:36 +00:00
Sean Silva bcd500e09a Revert "Update for LLVM change (StringSaver)"
This reverts commit r215785 / 170ebf4f19459ae51a9561d0e65c87ee4c9b2c97.

LLD has some StringSavers that need to be updated. One of which takes a
lock and I need to investigate that more closely.

llvm-svn: 215791
2014-08-15 23:39:12 +00:00
Sean Silva db79484998 Revert "[Support] Promote cl::StringSaver to a separate utility"
This reverts commit r215784 / 3f8a26f6fe16cc76c98ab21db2c600bd7defbbaa.

LLD has 3 StringSaver's, one of which takes a lock when saving the
string... Need to investigate more closely.

llvm-svn: 215790
2014-08-15 23:39:01 +00:00
Robin Morisset d539f866ac Get rid of dead code: SelectAtomic64 in X86ISelDAGtoDAG.cpp
llvm-svn: 215789
2014-08-15 23:36:00 +00:00
Zachary Turner 76eddae8dd Still trying to fix the Make build. Link lldbHostPosix to liblldb
llvm-svn: 215788
2014-08-15 23:27:37 +00:00
Eric Fiselier 983484fb11 Readding FreeBSD support to lit.cfg. Patch from Pawel Worach.
Pawel has been using this patch on his buildbots for a while. This should
allow the testsuite to run on FreeBSD with libcxxrt.

llvm-svn: 215787
2014-08-15 23:24:00 +00:00
Nico Weber ae4bb8c8f4 Make sure that vtables referenced from delay-parsed templates get referenced.
This fixes PR20671, see the bug for details. In short, ActOnTranslationUnit()
calls DefineUsedVTables() and only then PerformPendingInstantiations(). But
PerformPendingInstantiations() is what does delayed template parsing, so
vtables only references from late-parsed templates weren't marked used.

As a fix, move the SavePendingInstantiationsAndVTableUsesRAII in
PerformPendingInstantiations() up above the delayed template parsing code.
That way, vtables referenced from templates end up in the RAII object, and the
call to DefineUsedVTables() in PerformPendingInstantiations() marks them used.

llvm-svn: 215786
2014-08-15 23:21:41 +00:00
Sean Silva 43bd97c77b Update for LLVM change (StringSaver)
There is more cleanup to be done here. Once
llvm::sys::Process::GetArgumentVector is switched over to StringSaver,
we can simplify this code a fair amount.

llvm-svn: 215785
2014-08-15 23:18:49 +00:00
Sean Silva 42ec6fdf58 [Support] Promote cl::StringSaver to a separate utility
This class is generally useful.

In breaking it out, the primary change is that it has been made
non-virtual. It seems like being abstract led to there being 3 different
(2 in llvm + 1 in clang) concrete implementations which disagreed about
the ownership of the saved strings (see the manual call to free() in the
unittest StrDupSaver; yes this is different from the CommandLine.cpp
StrDupSaver which owns the stored strings; which is different from
Clang's StringSetSaver which just holds a reference to a
std::set<std::string> which owns the strings).

I've identified 2 other places in the
codebase that are open-coding this pattern:

  memcpy(Alloc.Allocate<char>(strlen(S)+1), S, strlen(S)+1)

I'll be switching them over. They are
* llvm::sys::Process::GetArgumentVector
* The StringAllocator member of YAMLIO's Input class
This also will allow simplifying Clang's driver.cpp quite a bit.

Let me know if there are any other places that could benefit from
StringSaver. I'm also thinking of adding a saveStringRef member for
getting a stable StringRef.

llvm-svn: 215784
2014-08-15 23:18:33 +00:00
Enrico Granata e8bf749653 Add functions to ClangASTContext to get integer types of a given byte size
llvm-svn: 215783
2014-08-15 23:00:02 +00:00
Zachary Turner 3c19a6ac48 Try to fix the Make build
llvm-svn: 215782
2014-08-15 22:50:48 +00:00
Nick Kledzik 0cc040780e [mach-o] improve darwin driver 'usage' message when run with no args
llvm-svn: 215781
2014-08-15 22:42:46 +00:00
Nico Weber ccec9d8cee Add a RAII class for saving and restoring instantiations and uses. No behavior change.
llvm-svn: 215780
2014-08-15 22:29:14 +00:00
Robin Morisset 97e4218ffa Add two helper functions: isAtLeastAcquire, isAtLeastRelease
These methods are available on AtomicOrdering values, and will be used
in a later separate patch.

llvm-svn: 215779
2014-08-15 22:25:12 +00:00
Eric Christopher 29ebb01201 Remove another of the llvm given warnings from the list of
warnings we compile with because of SWIG generated code.

llvm-svn: 215778
2014-08-15 22:23:40 +00:00
Robin Morisset d18cda620c Fix typos in comments
llvm-svn: 215777
2014-08-15 22:17:28 +00:00
Nico Weber 55048cf141 Wrap to 80 columns, no behavior change.
llvm-svn: 215776
2014-08-15 22:15:00 +00:00
Zachary Turner c00cf4a068 Move FileSystem functions out of Host and into their own classes.
More specifically, this change can be summarized as follows:
1) Makes an lldbHostPosix library which contains code common to
   all posix platforms.
2) Creates Host/FileSystem.h which defines a common FileSystem
   interface.
3) Implements FileSystem.h in Host/windows and Host/posix.
4) Creates Host/FileCache.h, implemented in Host/common, which
   defines a class useful for storing handles to open files needed
   by the debugger.

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

llvm-svn: 215775
2014-08-15 22:04:21 +00:00
Sean Silva 5d62c26fa0 Rename as suggested by dblaikie
llvm-svn: 215774
2014-08-15 21:40:51 +00:00
Sean Silva 070cd2d9d4 ArrayRef'ize
I've shied away from ArrayRef'izing CompilerInvocation::CreateFromArgs
in this commit because that is a less localized change.

llvm-svn: 215773
2014-08-15 21:38:36 +00:00
Chad Rosier b1bbf6f8ce [AArch32] Add support for FP rounding operations for ARMv8/AArch32.
Phabricator Revision: http://reviews.llvm.org/D4935

llvm-svn: 215772
2014-08-15 21:38:16 +00:00
Jason Molenda f0e4c5e32b Fix dependency ordering for the xpc file installs.
llvm-svn: 215771
2014-08-15 21:38:13 +00:00
Nick Kledzik bcd6e2a943 [Option] Support MultiArg in --help
Currently, if you use a MultiArg<> option, then printing out the help/usage
message will cause an assert.  This fixes getOptionHelpName() to work with
MultiArg Options.

llvm-svn: 215770
2014-08-15 21:35:07 +00:00
Jonathan Roelofs f11170406e Tame a few enum size tests when using -fshort-enums on ARM.
llvm-svn: 215769
2014-08-15 21:34:52 +00:00
David Blaikie 0c8e3f2fdd DebugInfo: While loop backedge should be attribute to the start of the while statement.
A little test case simplification - this could be simplified further,
though there are certainly interesting connections to the if/else
construct so I'm hesitant to remove that entirely though it does appear
somewhat unrelated.

(similar fix to r215766, related to PR19864)

llvm-svn: 215768
2014-08-15 21:11:25 +00:00
Sean Silva 0ee846ff3c Rename this function to better reflect its purpose
Thanks to dblaikie for the impetus to look for a better name.

llvm-svn: 215767
2014-08-15 20:59:03 +00:00
David Blaikie 15c4956b3a DebugInfo: Fix PR19864 better - attribute the jump at the end of a range-for loop, to the start of the loop.
This avoids debuggers stepping to strange places (like the last
statement in the loop body, or the first statement in the if).

This is not the whole answer, though - similar bugs no doubt exist in
other loops (patches to follow) and attributing exception handling code
to the correct line is also tricky (based on the previous fix to
PR19864, exception handling is still erroneously attributed to the 'if'
line).

llvm-svn: 215766
2014-08-15 20:50:45 +00:00
Rafael Espindola 3931c28b03 Set comdats when lazily linking functions.
We were setting the comdat when functions were copied in the initial pass, but
not when they were linked only when we found out that they are needed.

llvm-svn: 215765
2014-08-15 20:17:08 +00:00
James Dennett 64fa12372c Typo fix in comments: definintion -> definition
llvm-svn: 215764
2014-08-15 20:04:40 +00:00
Alexey Samsonov cd21e2f7e4 [TSan] Initialize flags as early as possible. Disables back coredump, accidentally enabled in r215479. Add a test.
llvm-svn: 215763
2014-08-15 19:53:51 +00:00
Nick Kledzik 94174f755c [mach-o] Support -filelist option in darwin driver
The darwin linker has an option, heavily used by Xcode, in which, instead
of listing all input files on the command line, the input file paths are
written to a text file and the path of that text file is passed to the linker
with the -filelist option (similar to @file).

In order to make test cases for this, I generalized the -test_libresolution
option to become -test_file_usage.

llvm-svn: 215762
2014-08-15 19:53:41 +00:00
Sean Silva 6a9b0f9008 [cleanup] Rename this function to better reflect its purpose. NFC.
This also suggests some refactoring to simplify this code. Basically, a
ton of complexity in this argument handling code comes from the need to
save const char *'s in stable storage for pushing onto argv.
It seems like llvm:🆑:StringSaver can be improved to cover all the
needs here.

llvm-svn: 215761
2014-08-15 19:23:53 +00:00
Sean Silva bbabefe1b1 [cleanup] Range-for'ify this loop. NFC.
llvm-svn: 215760
2014-08-15 19:23:50 +00:00
Sean Silva 9a6bdf8187 [cleanup] Factor out handling CC1 tools. NFC.
llvm-svn: 215759
2014-08-15 19:23:47 +00:00
Samuel Benzaquen e1e749322f Add missing matchers to the dynamic registry.
Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 215757
2014-08-15 19:13:27 +00:00
Sean Silva b5060477e0 [cleanup] Factor out setting the driver's install dir. NFC.
llvm-svn: 215756
2014-08-15 18:58:15 +00:00
Sean Silva 22b4a3444c [cleanup] Factor out initializing the DianosticOptions. NFC.
llvm-svn: 215755
2014-08-15 18:58:12 +00:00
Sean Silva 965bb99180 [cleanup] Factor out adjusting "cl.exe" to "clang-cl.exe". NFC.
llvm-svn: 215754
2014-08-15 18:58:09 +00:00
Juergen Ributzka 6597d319fe [FastISel][AArch64] Fix a latent bug in floating-point materialization.
The floating-point value positive zero (+0.0) is a valid immedate value
according to isFPImmLegal. As a result AArch64 FastISel went ahead and
used the immediate version of fmov to materialize the constant.

The problem is that the immediate version of fmov cannot encode an imediate for
postive zero. Instead a fmov from the zero register was supposed to be used in
this case.

This fix adds handling for this special case and uses fmov from the zero
register to materialize a positive zero (negative zeroes go to the constant
pool).

There is no test case for this, because this code is currently dead. It will be
enabled in a future commit and I will add a test case in a separate commit
after that.

This fixes <rdar://problem/18027157>.

llvm-svn: 215753
2014-08-15 18:55:55 +00:00
Juergen Ributzka 6bca986ef1 Reapplying [FastISel][AArch64] Cleanup constant materialization code. NFCI.
Note: This reapplies r215582 without any modifications. The refactoring wasn't
responsible for the buildbot failures.

Original commit message:
Cleanup and prepare constant materialization code for future commits.

llvm-svn: 215752
2014-08-15 18:55:52 +00:00
Sean Silva 2103c38a99 [cleanup] Factor out some checks. NFC.
The core logic in main() is actually pretty simple, but there's lots of
stuff that has been added over time which obscures the flow of the code.
In upcoming patches, I'll be pulling more stuff out of the main
codepath.

I'm open to naming suggestions for these helper functions.

llvm-svn: 215751
2014-08-15 18:50:00 +00:00
Eric Fiselier db36dc23e4 Revert get testsuite running on FreeBSD.
There is a similar patch up for review. I'll submit my changes via that.

llvm-svn: 215750
2014-08-15 18:49:28 +00:00
Matt Arsenault fabf545299 R600/SI: Move all fabs / fneg handling to patterns
llvm-svn: 215749
2014-08-15 18:42:22 +00:00
Matt Arsenault 13623d0e28 R600/SI: Use source modifiers for f64 fneg
llvm-svn: 215748
2014-08-15 18:42:18 +00:00
Matt Arsenault a147438e37 R600/SI: Use source modifier for f64 fabs
llvm-svn: 215747
2014-08-15 18:42:15 +00:00
Matt Arsenault 9e7cf548ea R600/SI: Refactor fneg / fabs patterns
llvm-svn: 215746
2014-08-15 18:42:11 +00:00
Reid Kleckner b9538a6d09 MS ABI: Virtual member pointer thunks are not unnamed_addr
They can be compared for identity.

llvm-svn: 215745
2014-08-15 18:12:40 +00:00
Reid Kleckner a6b86bef4d Fix the build with MSVC 2013 after new shuffle code
MSVC gives this awesome diagnostic:

..\lib\Target\X86\X86ISelLowering.cpp(7085) : error C2971: 'llvm::VariadicFunction1' : template parameter 'Func' : 'isShuffleEquivalentImpl' : a local variable cannot be used as a non-type argument
        ..\include\llvm/ADT/VariadicFunction.h(153) : see declaration of 'llvm::VariadicFunction1'
        ..\lib\Target\X86\X86ISelLowering.cpp(7061) : see declaration of 'isShuffleEquivalentImpl'

Using an anonymous namespace makes the problem go away.

llvm-svn: 215744
2014-08-15 18:03:58 +00:00