Commit Graph

174094 Commits

Author SHA1 Message Date
Benjamin Kramer 53156af57c Another try at making MSVC happy again.
llvm-svn: 208497
2014-05-11 16:03:08 +00:00
David Blaikie c0a2841e2f DwarfUnit: Factor out calling isUnsignedDIType into a utility function so each caller of emitConstantValue doesn't have to call it separately.
llvm-svn: 208496
2014-05-11 15:56:59 +00:00
David Blaikie c05c8f483b DwarfUnit: Share common constant value emission between APInts of small (<= 64 bit) and MCOperand immediates.
Doesn't seem a good reason to duplicate this code (it was more literally
duplicated prior to r208494, and while the dataN code /does/ actually
fire in this case, it doesn't seem necessary (and the DWARF standard
recommends using udata/sdata pervasively instead of dataN, so as to
indicate signedness of the values))

llvm-svn: 208495
2014-05-11 15:47:39 +00:00
David Blaikie 958647c36d DebugInfo: Simplify constant value emission.
This code looks to have become dead at some time in the past. I tried to
reproduce cases where LLVM would emit constants with dataN, but could
not. Upon inspection it seems the code doesn't do that anymore - the
only time a size is provided by isTypeSigned is when the type is signed,
and in those cases we use sdata. dataN is only used for unsigned types
and isTypeSigned doesn't provide a value for sizeInBits in that case.

Remove the dead cases/size plumbing.

llvm-svn: 208494
2014-05-11 15:06:20 +00:00
Benjamin Kramer 062bf473c1 Put back raw_ostream.h include.
Some configurations of MSVC get horribly confused by the forward declaration
and explode.

llvm-svn: 208493
2014-05-11 10:41:20 +00:00
Benjamin Kramer 1fef64214c SLPVectorizer: Instead of just performing CSE on dead blocks ignore them completely.
Turns out that there is a very cheap way of testing whether a block is dead,
just look it up in the DomTree. We have to do this anyways so just ignore
unreachable blocks before sorting by domination. This restores a proper
ordering for std::stable_sort when dead code is present.

Covered by existing tests & buildbots running in STL debug mode (MSVC).

llvm-svn: 208492
2014-05-11 10:28:58 +00:00
Benjamin Kramer b7ee689f91 Silence warning in Release builds. This function is only used in an assert.
llvm-svn: 208491
2014-05-11 09:31:47 +00:00
Simon Atanasyan 20b043b24c [Mips] Update test case expectations to reflect changes in the
llvm-readobj output format.

llvm-svn: 208490
2014-05-11 08:54:30 +00:00
Simon Atanasyan ca8b562709 [llvm-readobj] Print values of FLAGS and MIPS_FLAGS dynamic table tags
in a human readable form.

llvm-svn: 208489
2014-05-11 08:48:09 +00:00
Serge Pavlov 9ef66a8266 Reorder shuffle and binary operation.
This patch enables transformations:

    BinOp(shuffle(v1), shuffle(v2)) -> shuffle(BinOp(v1, v2))
    BinOp(shuffle(v1), const1) -> shuffle(BinOp, const2)

They allow to eliminate extra shuffles in some cases.

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

llvm-svn: 208488
2014-05-11 08:46:12 +00:00
Filipe Cabecinhas 0e3d1cb5d6 Fixed a bug when lowering build_vector (PR19694)
When lowering build_vector to an insertps, we would still lower it, even
if the source vectors weren't v4x32. This would break on avx if the source
was a v8x32. We now check the type of the source vectors.

llvm-svn: 208487
2014-05-11 08:12:56 +00:00
Saleem Abdulrasool 8ab3e83efa CodeGen: support dll{ex,im}port on WoA
Add ARM support for dllexport and dllimport attributes.  This is a relatively
conservative change.  The alternative is to entirely drop the architecture
requirement.  The dllimport and dllexport attributes are not restricted to any
architecture, simply to platforms that support this attribute (currently
Windows).

llvm-svn: 208486
2014-05-11 01:31:57 +00:00
Nico Weber e8e53116f8 Wrap at 80 columns. No code change.
llvm-svn: 208485
2014-05-11 01:04:02 +00:00
Nico Weber 7aeab6022f Follow-up to r208481: Free all default arguments, not just the first one.
Also add test coverage for this case.  Found by Richard Smith!

llvm-svn: 208484
2014-05-11 00:28:16 +00:00
Nico Weber 3fddae75c7 Don't leak CXStrings for replacement fix-its in c-index-test.
The loop body used to contain a switch statement; it looks like r96685 replaced
that with an if/else if/else but accidentally left one of the three break
statements from the switch behind, skipping the clang_disposeString() call
for replacements (and the rest of the loop too, which apparently doesn't make
a differences for the test cases we have).

r96685: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100215/027754.html

This too might possibly the last leak in clang (PR19521).

llvm-svn: 208483
2014-05-10 23:56:43 +00:00
Benjamin Kramer ef316ee8df Try to bring the 32 bit buildbots back to life.
llvm-svn: 208482
2014-05-10 20:57:56 +00:00
Nico Weber e2b5e40203 Don't leak default arg tokens on invalid destructors or conversion functions.
Fixes PR19689, and possibly the last leak in clang (PR19521). PR19689 contains
a few suggestions on how to make the default argument token code a bit more
solid, these changes can possibly be landed in follow-ups.

llvm-svn: 208481
2014-05-10 19:23:28 +00:00
Vincent Lejeune 29c0c210fc R600/SI: Fold fabs/fneg into src input modifier
llvm-svn: 208480
2014-05-10 19:18:39 +00:00
Vincent Lejeune 94af31fbe8 R600/SI: Prettier display of input modifiers
llvm-svn: 208479
2014-05-10 19:18:33 +00:00
Vincent Lejeune 79a5834647 R600/SI: Use pseudo instruction for fabs/clamp/fneg
llvm-svn: 208478
2014-05-10 19:18:25 +00:00
Nico Weber cf596d8fa8 Add test coverage for invalid conversion functions with default args.
This currently leaks memory (PR19689) but wasn't covered by tests, so LSan
couldn't find it.

llvm-svn: 208477
2014-05-10 19:15:24 +00:00
Benjamin Kramer 8cff45aa20 SCEV: Use range-based for loop and fold variable into assert.
llvm-svn: 208476
2014-05-10 17:47:18 +00:00
Nico Weber 77c76c54fc Wrap to 80 columns. No behavior change.
llvm-svn: 208475
2014-05-10 17:43:15 +00:00
Fariborz Jahanian c70a54366e Objective-C ARC. Add support for toll-free bridge
type ,and bridge attribute, checking with static_cast. 
// rdar://16756639

llvm-svn: 208474
2014-05-10 17:40:11 +00:00
Benjamin Kramer e6f743f9ab Analyzer: Make helper function static.
llvm-svn: 208473
2014-05-10 17:13:34 +00:00
Jim Cownie 18d8473f18 Add testsuite from OpenUH
llvm-svn: 208472
2014-05-10 17:02:09 +00:00
Benjamin Kramer 281f9d0e97 Update for Clang API change and move ClangTidyDiagnosticRenderer into an anonymous namespace while there.
llvm-svn: 208471
2014-05-10 16:32:07 +00:00
Benjamin Kramer f3ca269839 Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.
Required pulling LambdaExpr::Capture into its own header.
No functionality change.

llvm-svn: 208470
2014-05-10 16:31:55 +00:00
Tim Northover 55b3e22927 ARM64: fix SELECT_CC lowering in absence of NaNs.
We were swapping the true & false results while testing for FMAX/FMIN,
but not putting them back to the original state if the later checks
failed.

Should fix PR19700.

llvm-svn: 208469
2014-05-10 07:37:50 +00:00
David Blaikie 9c8821bbef Add FIXME describing the limitation of using column info to disambiguate inlining.
Also tidy up, simplify, and extend the test coverage to demonstrate the
limitations. This test should now fail if the bugs are fixed (&
hopefully whoever ends up in this situation sees the FIXMEs and realizes
that the test needs to be updated to positively test their change that
has fixed some or all of these issues).

I do wonder whether I could demonstrate breakage without a macro here,
but any way I slice it I can't think of a way to get two calls to the
same function on the same line/column in non-macro C++ - implicit
conversions happen at the same location as an explicit function, but
you'd never get an implicit conversion on the result of an explicit call
to the same implicit conversion operator (since the value is already
converted to the desired result)...

llvm-svn: 208468
2014-05-10 02:44:57 +00:00
Richard Smith d7af8a334c Stop all the Decl classes poking at Redeclarable's data member directly, and make getNextRedeclaration follow the pattern of its friends getPreviousDecl and getMostRecentDecl.
llvm-svn: 208467
2014-05-10 01:17:36 +00:00
Logan Chien dc65ab4cef Implement ARM EHABI exception handling.
This commit implements the ARM zero-cost exception handling
support for libc++abi.

llvm-svn: 208466
2014-05-10 00:42:10 +00:00
Logan Chien cc24fc546b Check exception specification with __cplusplus.
To allow the compilation with gcc, we can't use the
__has_feature(cxx_noexcept) to detect the default destructor
exception specification, which is noexcept(true) by default
in C++11.  We should use __cplusplus >= 201103L instead.

llvm-svn: 208465
2014-05-10 00:40:54 +00:00
Duncan P. N. Exon Smith 59ad79601b InstrProf: Remove redundant declaration
llvm-svn: 208464
2014-05-10 00:22:58 +00:00
Kevin Enderby 6abc2e58ac Fix llvm-nm to print the full 64-bit address for symbols in 64-bit object files.
The implementation might be better to have a method is64Bit() in the class
SymbolicFile instead of having the static routine isSymbolList64Bit() in
llvm-nm.cpp .  But this is very much in the sprit of isObject() and
getNMTypeChar() in llvm-nm.cpp that has a series of if else statements
based on the specific class of the SymbolicFile.  I can update this if
folks would like.

Also the tests were updated to be explicit about checking the address for
64-bits or 32-bits from object files.

llvm-svn: 208463
2014-05-09 23:57:49 +00:00
Duncan P. N. Exon Smith b6bd2f6cf7 InstrProf: Pacify buildbots after r208460
llvm-svn: 208462
2014-05-09 23:47:49 +00:00
Benjamin Kramer 8722aa5754 SLPVectorizer: When sorting by domination for CSE don't assert on unreachable code.
There is no total ordering if the CFG is disconnected. We don't care if we
catch all CSE opportunities in dead code either so just exclude ignore them in
the assert.

PR19646

llvm-svn: 208461
2014-05-09 23:28:49 +00:00
Duncan P. N. Exon Smith 238137294f InstrProf: Test the functions in the runtime
Check that the profile runtime works as expected.  This tests the
functions that are meant to be available to advanced users.

In particular, check that the `atexit()` hook can be disabled by
defining a custom `__llvm_profile_runtime` variable, that the libc
dependencies are optional, and that the various functions for writing
out files work for basic cases.

llvm-svn: 208460
2014-05-09 23:14:58 +00:00
Reid Kleckner c487d73f41 Revert "[ms-cxxabi] Add a new calling convention that swaps 'this' and 'sret'"
This reverts commit r200561.

This calling convention was an attempt to match the MSVC C++ ABI for
methods that return structures by value.  This solution didn't scale,
because it would have required splitting every CC available on Windows
into two: one for methods and one for free functions.

Now that we can put sret on the second arg (r208453), and Clang does
that (r208458), revert this hack.

llvm-svn: 208459
2014-05-09 22:56:42 +00:00
Reid Kleckner 37abaca3c2 MS ABI: Pass 'sret' as the second parameter of instance methods
Summary:
MSVC always passes 'sret' after 'this', unlike GCC.  This required
changing a number of places in Clang that assumed the sret parameter was
always first in LLVM IR.

This fixes win64 MSVC ABI compatibility for methods returning structs.

Reviewers: rsmith, majnemer

Subscribers: cfe-commits

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

llvm-svn: 208458
2014-05-09 22:46:15 +00:00
Sebastian Pop 46e1ecdecc delinearize together all accesses to the same array
llvm-svn: 208457
2014-05-09 22:45:15 +00:00
Sebastian Pop 47fe7de1b5 move findArrayDimensions to ScalarEvolution
we do not use the information from SCEVAddRecExpr to compute the shape of the array,
so a better place for this function is in ScalarEvolution.

llvm-svn: 208456
2014-05-09 22:45:07 +00:00
Sebastian Pop 444621abe1 fix typo in debug message
llvm-svn: 208455
2014-05-09 22:45:02 +00:00
Nico Weber 7dd96c23fd Don't leak the CXStoredDiagnostics returned by clang_codeCompleteGetDiagnostic()
r144269 changed clang_disposeDiagnostic() to be a no-op, but didn't update
code completion diagnostics.  Let CXCodeCompleteResults store all diagnostics
returned by clang_codeCompleteGetDiagnostic() and then free them up in
clang_disposeCodeCompleteResults().

Code completion diagnostics referred to data stored in CXCodeCompleteResults
before already, so it wasn't possible to refer to the results of
clang_codeCompleteGetDiagnostic() after clang_disposeCodeCompleteResults()
before this change already -- hence this should be a safe, backwards-compatible
change.

Leak found by LSan, fixes PR19690.

llvm-svn: 208454
2014-05-09 22:33:11 +00:00
Reid Kleckner 7941856445 Allow sret on the second parameter as well as the first
MSVC always places the implicit sret parameter after the implicit this
parameter of instance methods.  We used to handle this for
x86_thiscallcc by allocating the sret parameter on the stack and leaving
the this pointer in ecx, but that doesn't handle alternative calling
conventions like cdecl, stdcall, fastcall, or the win64 convention.

Instead, change the verifier to allow sret on the second parameter.

This also requires changing the Mips and X86 backends to return the
argument with the sret parameter, instead of assuming that the sret
parameter comes first.

The Sparc backend also returns sret parameters in a register, but I
wasn't able to update it to handle secondary sret parameters.  It
currently calls report_fatal_error if you feed it an sret in the second
parameter.

Reviewers: rafael.espindola, majnemer

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

llvm-svn: 208453
2014-05-09 22:32:13 +00:00
Rui Ueyama 629d201c97 [PECOFF] Resolve dllexported symbols.
We did not actively try to resolve dllexported symbols specified
by /export or by a module definition file. So if exported symbols
would be resolved for other reasons, like other symbols refer to
them, that was fine, but if (unreferenced) exported symbols were
in an archive file, and no one refers to that file in the archive,
they remained unresolved.

That would obviously cause the issue that dllexported symbols are
not in a resultant DLL.

In this patch, we create an undefined symbol for each dllexported
symbol, to let the core linker to resolve it.

llvm-svn: 208452
2014-05-09 22:19:49 +00:00
Alexey Samsonov eacb4d8417 [CMake] Use ExternalProject to build MSan-ified version of libcxx for unit tests.
This change lets MSan rely on libcxx's own build system instead of manually
compiling its sources and setting up all the necessary compile flags. It would
also simplify compiling libcxx with another sanitizers (in particular, TSan).

The tricky part is to make sure libcxx is reconfigured/rebuilt when Clang or
MSan runtime library is changed. "clobber" step used in this patch works well
for me, but it's possible it would break for other configurations - will
watch the buildbots.

llvm-svn: 208451
2014-05-09 22:11:03 +00:00
David Blaikie 04e2e665cb Don't emit -Wnon-virtual-dtor on final classes, since it's not a problem there.
The base class is the culprit/risk here - a sealed/final derived class
with virtual functions and a non-virtual dtor can't accidentally be
polymorphically destroyed (if the base class's dtor is protected - which
also suppresses this warning).

llvm-svn: 208449
2014-05-09 22:02:28 +00:00
Reid Kleckner d0eda92845 Fix ARM intrinsics-overflow.ll test on Windows
Windows on ARM only supports thumb mode execution, so we have to
explicitly pick some non-Windows OS to test ARM mode codegen.

llvm-svn: 208448
2014-05-09 21:52:48 +00:00
Rafael Espindola aa2738291b Don't crash on redefinitions.
One error we were not deleting the alias or putting it in the Module. The
end result is that there was an use left of the aliasee when the module was
deleted.

llvm-svn: 208447
2014-05-09 21:49:17 +00:00