Commit Graph

180629 Commits

Author SHA1 Message Date
Reid Kleckner 3d4eae74e7 APInt: Make self-move-assignment a no-op to fix stage3 clang-cl
It's not clear what the semantics of a self-move should be.  The
consensus appears to be that a self-move should leave the object in a
moved-from state, which is what our existing move assignment operator
does.

However, the MSVC 2013 STL will perform self-moves in some cases.  In
particular, when doing a std::stable_sort of an already sorted APSInt
vector of an appropriate size, one of the merge steps will self-move
half of the elements.

We don't notice this when building with MSVC, because MSVC will not
synthesize the move assignment operator for APSInt.  Presumably MSVC
does this because APInt, the base class, has user-declared special
members that implicitly delete move special members.  Instead, MSVC
selects the copy-assign operator, which defends against self-assignment.
Clang, on the other hand, selects the move-assign operator, and we get
garbage APInts.

llvm-svn: 215478
2014-08-12 22:01:39 +00:00
Adrian Prantl 5e1fa85ec6 Remove a condition that can never be true, as wittnessed by the assert
above.

llvm-svn: 215477
2014-08-12 21:55:58 +00:00
Samuel Benzaquen 788674f964 Fix the \param comments to have the parameter name.
Summary: This fixes the build break introduced in rL215472

Reviewers: pcc

Subscribers: klimek, cfe-commits

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

llvm-svn: 215476
2014-08-12 21:49:59 +00:00
Greg Clayton bc76668142 Fixed launching in shell on haswell enabled Macs to work more than once when you do:
% lldb -x /bin/ls
(lldb) r
(lldb) r

Prior to this fix the first time it would run /usr/bin/arch with "-arch x86_64" the first time and succeed, and fail the second when the target had updated its architecture to x86_64h. We can't specify x86_64h to /usr/bin/arch, it doesn't handle it.

Also fixed it so /usr/bin/arch is only used for Apple triples.

<rdar://problem/17951312>

llvm-svn: 215475
2014-08-12 21:38:59 +00:00
Samuel Benzaquen d7349439d5 [clang-query] Use the new API for named values from the Parser.
Summary: This finishes the support for autocomplete for user defined values..

Reviewers: pcc

Subscribers: cfe-commits

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

llvm-svn: 215474
2014-08-12 21:22:58 +00:00
Adam Nemet cee9d0a460 [AVX512] Handle valign masking intrinsic via C++ lowering
I think that this will scale better in most cases than adding a Pat<> for each
mapping from the intrinsic DAG to the intruction (i.e. rri, rrik, rrikz).  We
can just lower to the SDNode and have the resulting DAG be matches by the DAG
patterns.

Alternatively (long term), we could keep the Pat<>s but generate them via the
new AVX512_masking multiclass.  The difficulty is that in order to formulate
that we would have to concatenate DAGs.  Currently this is only supported if
the operators of the input DAGs are identical.

llvm-svn: 215473
2014-08-12 21:13:12 +00:00
Samuel Benzaquen 646f23b809 Support named values in the autocomplete feature.
Summary:
This includes:
 - Passing a Sema to completeExpression to allow for named values in the
   expression.
 - Passing a map of names to values to the parser.
 - Update the Sema interface to include completion for matchers.
 - Change the parser to use the Sema for completion, instead of going
   directly to Registry.

Reviewers: pcc

Subscribers: klimek, cfe-commits

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

llvm-svn: 215472
2014-08-12 21:11:37 +00:00
Richard Trieu 4834ad2609 Improve -Wuninitialized to catch const classes being used in their own copy
constructors.

llvm-svn: 215471
2014-08-12 21:05:04 +00:00
Alexey Samsonov b9ec65cd4d [Sanitizer] Kill deprecated allocator interfaces in ASan, MSan and TSan in favor of
a unified interface in <sanitizer/allocator_interface.h>.

llvm-svn: 215469
2014-08-12 20:28:20 +00:00
Hans Wennborg a03feadeb2 Fix the CMake build when setting MACOSX_DEPLOYMENT_TARGET
If we don't reset CMAKE_OSX_DEPLOYMENT_TARGET, it will end up in
CFLAGS together with the -mmacosx-version-min that we set,
and the compiler errors about the conflict.

llvm-svn: 215468
2014-08-12 20:03:33 +00:00
Matt Arsenault 4815f09bbe Allwo bitcast + struct GEP transform to work with addrspacecast
llvm-svn: 215467
2014-08-12 19:46:13 +00:00
Johannes Doerfert 9744c4af16 [Refactor] Cleanup runtime code generation
+ Use regexp in two test case.
  + Refactor the runtime condition build function

llvm-svn: 215466
2014-08-12 18:35:54 +00:00
Hans Wennborg d57db6e877 Fix the CMake build on Mac when setting MACOSX_DEPLOYMENT_TARGET=10.6
The build file was trying to use LIBCXXABI_VERSION, which isn't set
anywhere.

llvm-svn: 215465
2014-08-12 18:18:07 +00:00
David Majnemer 2f6a96e1b6 MS ABI: Mangle this qualifiers on function types
C++11 allows this qualifiers to exist on function types when used in
template arguments.  Previously, I believed it wasn't possible because
MSVC rejected declarations like: S<int () const &> s;

However, it turns out MSVC properly allows them in using declarations;
updated clang to be compatible with this mangling.

llvm-svn: 215464
2014-08-12 17:53:10 +00:00
Hans Wennborg 4714826262 [libc++] Fix the CMake build on Mac when setting MACOSX_DEPLOYMENT_TARGET=10.6
The build file was trying to use LIBCXX_VERSION, which isn't set
anywhere, and also forgot to split the 'compile_flags' list.

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

llvm-svn: 215463
2014-08-12 17:32:07 +00:00
Jan Vesely e5ca27d716 R600: Use optimized 24bit path in udivrem
v2: drop enum keyword
    use correct extension mode
    don't bother computing the sign in unsinged case

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 215462
2014-08-12 17:31:20 +00:00
Jan Vesely e377a6b59a R600: Remove unused code.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 215461
2014-08-12 17:31:19 +00:00
Jan Vesely 4a33bc6206 R600: Use i24 optimized path for SREM
v2: add tests
    rename LowerSDIV24 to LowerSDIVREM24
    handle the rem part in this function

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 215460
2014-08-12 17:31:17 +00:00
Quentin Colombet 8427df974e Fix a parentheses warning introduced in r215394.
llvm-svn: 215459
2014-08-12 17:11:26 +00:00
Todd Fiala 58a2f6692b llgs: corrected Linux signal reception notification for SIGABRT, SIGSEGV and their ilk.
Added llgs/debugserver gdb-remote tests around SIGABRT and SIGSEGV signal reception
notification.  Found a few bugs in exception signal handling in Linux llgs.  Fixed those.

llvm-svn: 215458
2014-08-12 17:02:07 +00:00
Duncan P. N. Exon Smith 09d84addb7 Don't upgrade global constructors when reading bitcode
An optional third field was added to `llvm.global_ctors` (and
`llvm.global_dtors`) in r209015.  Most of the code has been changed to
deal with both versions of the variables.  Users of the C API might
create either version, the helper functions in LLVM create the two-field
version, and clang now creates the three-field version.

However, the BitcodeReader was changed to always upgrade to the
three-field version.  This created an unnecessary inconsistency in the
IR before/after serializing to bitcode.

This commit resolves the inconsistency by making the third field truly
optional (and not upgrading in the bitcode reader).  Since `llvm-link`
was relying on this upgrade code, rather than deleting it I've moved it
into `ModuleLinker`, where it upgrades these arrays as necessary to
resolve inconsistencies between modules.

The ideal resolution would be to remove the 2-field version and make the
third field required.  I filed PR20506 to track that.

I changed `test/Bitcode/upgrade-global-ctors.ll` to a negative test and
duplicated the `llvm-link` check in `test/Linker/global_ctors.ll` to
check both upgrade directions.

Since I came across this as part of PR5680 (serializing use-list order),
I've also added the missing `verify-uselistorder` RUN line to
`test/Bitcode/metadata-2.ll`.

llvm-svn: 215457
2014-08-12 16:46:37 +00:00
Jordan Rose 1a9c0d141c [analyzer] Check for negative values used as the size of a C variable-length array.
Patch by Daniel Fahlgren!

llvm-svn: 215456
2014-08-12 16:44:22 +00:00
Ben Langmuir 4b8a9e951e Verify all the module map files for a pcm are the same on load
We already verified the primary module map file (either the one that
defines the top-level module, or the one that allows inferring it if it
is an inferred framework module). Now we also verify any other module
map files that define submodules, such as when there is a
module.private.modulemap file.

llvm-svn: 215455
2014-08-12 16:42:33 +00:00
Ben Langmuir 87ecb89f3b Add a module cache path to test/Headers/cxx11
Don't depend on the serialization format remaining the same.

llvm-svn: 215454
2014-08-12 16:42:25 +00:00
Jordan Rose 5790d5295e Allow @synchronized to contextually convert a C++ object to an ObjC object pointer.
Patch by Grant Paul!

llvm-svn: 215453
2014-08-12 16:20:36 +00:00
Rafael Espindola ee8155d01a Update for API change in clang.
llvm-svn: 215452
2014-08-12 16:01:34 +00:00
Sanjay Patel 8687f320e0 fixed typos
llvm-svn: 215451
2014-08-12 16:00:06 +00:00
Rafael Espindola daa117be4c Make the test a bit more strict.
Before it would pass even if @b or @c ended up pointing to a variable named
@a123.

llvm-svn: 215450
2014-08-12 15:55:27 +00:00
Fariborz Jahanian 9c56fc956f Objective-C. Fixes an assert where because of captured
variable in block is over-aligned with an align
attribute causing block metadata size not be multiple
of alignment. rdar://17878679

llvm-svn: 215449
2014-08-12 15:51:49 +00:00
Rafael Espindola cd0b380a3c Use StringRef instead of MemoryBuffer&.
This code doesn't care where the data it is processing comes from, so a
StringRef is probably the most natural interface.

llvm-svn: 215448
2014-08-12 15:46:24 +00:00
Rafael Espindola cb9cd7f913 Add a plugin testcase for merging weak variables.
I initially thought I could implement COMDATs with aliases by just
internalizing GVs instead of dropping them. This is a counter
example: Internalizing one of the @a would make @b and @c point
to different variables.

llvm-svn: 215447
2014-08-12 15:39:14 +00:00
Todd Fiala a3b89e272c Fix iohandler prompt race condition.
This issue caused the lldb prompt to not show up in certain cases, very
noticeable on Linux systems.

See details on this review:
http://reviews.llvm.org/D4863

And on this lldb-commits thread:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140811/012306.html

Change by Shawn Best.

(Much useful help and testing by the rest of the community, thanks all!)

llvm-svn: 215446
2014-08-12 14:33:19 +00:00
NAKAMURA Takumi 01d9e24f70 llvm/test/TableGen/*Foreach*.td: Remove XFAIL:vg_leak. They have not been failing since r215176.
llvm-svn: 215445
2014-08-12 14:06:21 +00:00
Aaron Ballman 3ed2fb1ab6 Adding some test cases to test attribute-related source range diagnostics. This augments r214722, r214723 and r214507.
llvm-svn: 215444
2014-08-12 14:00:40 +00:00
Alexander Kornienko 092cb21046 Add documentation on how Language option in .clang-format files work.
llvm-svn: 215443
2014-08-12 13:34:22 +00:00
Daniel Jasper 598dd330e8 clang-format: Avoid bad line break.
Before:
  int
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaa(const
                                typename aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa);

After:
  int aaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      const typename aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa);

llvm-svn: 215442
2014-08-12 13:22:26 +00:00
Toma Tabacu 9ea5582816 Reverted my "Testing commit access" commit.
llvm-svn: 215441
2014-08-12 12:41:44 +00:00
Toma Tabacu 2bf228eb47 Testing commit access.
llvm-svn: 215440
2014-08-12 12:29:40 +00:00
Benjamin Kramer 242b5b808b [clang-tidy] Disable the warning on implicit bool* to bool conversion in macros.
It's just too noisy and the warning isn't very helpful in those cases.

llvm-svn: 215439
2014-08-12 12:12:57 +00:00
Benjamin Kramer 6318f7614f Allow specifying file names and extra arguments when running clang-tidy unit tests.
Will become useful soon.

llvm-svn: 215438
2014-08-12 12:12:54 +00:00
Tim Northover 39c70bbf56 llvm-objdump: print contents of MachO __unwind_info sections
llvm-svn: 215437
2014-08-12 11:52:59 +00:00
Timur Iskhodzhanov 6963686c47 [ASan] Use more appropriate return types for strlen/wcslen to avoid MSVC warnings
llvm-svn: 215436
2014-08-12 11:02:53 +00:00
Timur Iskhodzhanov de1718d355 [ASan/Win] Fix PR18987: warning about overriding '/MD' with '/MT'
llvm-svn: 215435
2014-08-12 09:44:56 +00:00
NAKAMURA Takumi 70e3646d22 clang/test/Frontend/print-header-includes.c REQUIRES shell due to "cd".
llvm-svn: 215434
2014-08-12 09:31:27 +00:00
Manuel Klimek 9af34aeac1 Correctly implement -include search logic.
According to the gcc docs, -include uses the current working directory
for the lookup instead of the main source file.

This patch gets rid of NormalizeIncludePath (which relied on an
implementation detail of FileManager / FileEntry for the include path
logic to work), and instead hands the correct lookup information down to
LookupFile.

This will allow us to change the FileEntry's behavior regarding its Name
caching.

llvm-svn: 215433
2014-08-12 08:25:57 +00:00
Eric Christopher ce40dbcbaa Have MachineRegisterInfo take and store the MachineFunction it
was created for rather than the TargetMachine since we only
needed the TM for the subtarget and we can get that from the
MF.

llvm-svn: 215432
2014-08-12 08:00:56 +00:00
Gerolf Hoflehner eb90500d06 [MachineCombiner] Fix for ICE bug 20598
The combiner ignored DBG nodes when checking
the uses of a virtual register.

It combined a sequence like
   %vreg1 = madd %vreg2, %vreg3,...
   DBG_VALUE (%vreg1 ...)
   %vreg4 = add %vreg1,...
to
  %vreg4 = madd %vreg2, %vreg3

leaving behind a dangling DBG_VALUE with
a definition. This triggered an assertion
in the MachineTraceMetrics.cpp module.

llvm-svn: 215431
2014-08-12 07:54:12 +00:00
Todd Fiala 7116562d0a Fix incorrect Linux i386 register info initialization on x86_64.
Fix by Tong Shen.

llvm-svn: 215424
2014-08-12 05:26:52 +00:00
Frederic Riss 787d9d640e Debuginfo: Correctly tag variadic ObjC methods with DW_TAG_unspecified_parameter.
Fixes rdar://13690847

llvm-svn: 215423
2014-08-12 04:42:23 +00:00
Johannes Doerfert fab63f7791 [Minor] Change the number of cut lines for new tests
This should cut all metadata community clang produces.

llvm-svn: 215422
2014-08-12 03:31:23 +00:00