Commit Graph

160072 Commits

Author SHA1 Message Date
David Majnemer a543308ce5 [-fms-extensions] Permit 'override' in C++98 and 'sealed' as a synonym for 'final'
Summary: Some MS headers use these features.

Reviewers: rnk, rsmith

CC: cfe-commits

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

llvm-svn: 192936
2013-10-18 00:33:31 +00:00
DeLesley Hutchins 6939177cea Consumed analysis: Add param_typestate attribute, which specifies that
function parameters must be in a particular state.  Patch by
chris.wailes@gmail.com.  Reviewed by delesley@google.com.

llvm-svn: 192934
2013-10-17 23:23:53 +00:00
Fariborz Jahanian 403425bba8 ObjectiveC migrator. Minor clean up of my last patch.
No functional change.

llvm-svn: 192933
2013-10-17 23:13:13 +00:00
DeLesley Hutchins 36ea1dd4fc Consumed Analysis: Allow parameters that are passed by non-const reference
to be treated as return values, and marked with the "returned_typestate"
attribute.  Patch by chris.wailes@gmail.com; reviewed by delesley@google.com.

llvm-svn: 192932
2013-10-17 22:53:04 +00:00
Richard Smith c1d5471291 Make the big array in the UBSan C++ runtime be zero-initialized to dramatically
shrink the binary size of the ubsan runtime.

Also fix a bug where long-running processes could eventually trigger a crash in
the runtime by filling up the cache. I've not found a nice way to add a test for
this crasher; ideas welcome.

llvm-svn: 192931
2013-10-17 22:51:04 +00:00
Rui Ueyama cf671439be Fill gap in .text with NOP.
llvm-svn: 192930
2013-10-17 22:45:16 +00:00
Richard Mitton 665068b379 Removed unnecessary call to OpenFirstAvailableMaster.
::Fork already does this internally, so this was simply leaking file handles.

This fixes the problem where the test suite would occasionally run out of file handles.

llvm-svn: 192929
2013-10-17 22:36:28 +00:00
Enrico Granata 52b4b6cddc This is the last piece of work for "formats in categories": we now cache formats as well as summaries and synthetics
llvm-svn: 192928
2013-10-17 22:27:19 +00:00
Fariborz Jahanian de79e81686 ObjectiveC migrator. In infering NS_ENUM/NS_OPTIONS
macros, prefer the typedef immediately following the
enum declaration to the one preceeding it.
// rdar://15200915

llvm-svn: 192927
2013-10-17 22:23:32 +00:00
DeLesley Hutchins db67ec3c27 Consumed analysis: update to previous test case.
llvm-svn: 192926
2013-10-17 22:21:03 +00:00
David Blaikie 01fae51fef DIEHash: Add more things (and remove one character) from the COLLECT_ATTR macro
Makes the uses more terse and requires that they use a semicolon at the
end that helps editors indent proceeding lines correctly.

llvm-svn: 192925
2013-10-17 22:14:08 +00:00
David Blaikie ca353be652 DIEHash: Support for simple (non-recursive, non-reused) type references
llvm-svn: 192924
2013-10-17 22:07:09 +00:00
Reid Kleckner 5a823d5f05 [ms-cxxabi] Error out on virtual function memptrs
These are uncommon and this is better than miscompiling.

llvm-svn: 192923
2013-10-17 21:30:27 +00:00
Richard Mitton 0a55835755 Added support for reading thread-local storage variables, as defined using the __thread modifier.
To make this work this patch extends LLDB to:

- Explicitly track the link_map address for each module. This is effectively the module handle, not sure why it wasn't already being stored off anywhere. As an extension later, it would be nice if someone were to add support for printing this as part of the modules list.

- Allow reading the per-thread data pointer via ptrace. I have added support for Linux here. I'll be happy to add support for FreeBSD once this is reviewed. OS X does not appear to have __thread variables, so maybe we don't need it there. Windows support should eventually be workable along the same lines.

- Make DWARF expressions track which module they originated from.

- Add support for the DW_OP_GNU_push_tls_address DWARF opcode, as generated by gcc and recent versions of clang. Earlier versions of clang (such as 3.2, which is default on Ubuntu right now) do not generate TLS debug info correctly so can not be supported here.

- Understand the format of the pthread DTV block. This is where it gets tricky. We have three basic options here:

  1) Call "dlinfo" or "__tls_get_addr" on the inferior and ask it directly. However this won't work on core dumps, and generally speaking it's not a good idea for the debugger to call functions itself, as it has the potential to not work depending on the state of the target.

  2) Use libthread_db. This is what GDB does. However this option requires having a version of libthread_db on the host cross-compiled for each potential target. This places a large burden on the user, and would make it very hard to cross-debug from Windows to Linux, for example. Trying to build a library intended exclusively for one OS on a different one is not pleasant. GDB sidesteps the problem and asks the user to figure it out.

  3) Parse the DTV structure ourselves. On initial inspection this seems to be a bad option, as the DTV structure (the format used by the runtime to manage TLS data) is not in fact a kernel data structure, it is implemented entirely in useerland in libc. Therefore the layout of it's fields are version and OS dependent, and are not standardized.

  However, it turns out not to be such a problem. All OSes use basically the same algorithm (a per-module lookup table) as detailed in Ulrich Drepper's TLS ELF ABI document, so we can easily write code to decode it ourselves. The only question therefore is the exact field layouts required. Happily, the implementors of libpthread expose the structure of the DTV via metadata exported as symbols from the .so itself, designed exactly for this kind of thing. So this patch simply reads that metadata in, and re-implements libthread_db's algorithm itself. We thereby get cross-platform TLS lookup without either requiring third-party libraries, while still being independent of the version of libpthread being used.

Test case included.

llvm-svn: 192922
2013-10-17 21:14:00 +00:00
Alp Toker be2a55f5ac Revert "Fix missed exception spec checks and crashes"
The changes caused the sanitizer bot to hang:
  http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/2311

Needs investigation.

This reverts commit r192914.

llvm-svn: 192921
2013-10-17 21:00:19 +00:00
Ed Maste a0191d1101 Fix building with ENABLE_DEBUG_PRINTF
Clang tells me that "token pasting of ',' and __VA_ARGS__ is a GNU
extension".  Also catch up with changes in function args.

llvm-svn: 192920
2013-10-17 20:42:56 +00:00
Hans Wennborg cd2672c9b4 Make .asm a valid extension for assembly files
This is a common extension on Windows, and now clang will assemble them
instead of treating them as linker input which is the default for unknown
file types.

llvm-svn: 192919
2013-10-17 20:41:18 +00:00
Ed Maste 4c24b1264a Whitespace: replace 4-space-tabs with spaces
llvm-svn: 192918
2013-10-17 20:13:14 +00:00
Richard Mitton ec8b282bde Rearranged linker flags for test suite.
Some linkers (GNU ld) are picky about library order, so if we import libraries as part of our LDFLAGS then that needs to come after any DYLIB_NAME which might require that library.

llvm-svn: 192917
2013-10-17 20:09:33 +00:00
David Peixotto 8e5abc52cb 17309 ARM backend incorrectly lowers COPY_STRUCT_BYVAL_I32 for thumb1 targets
This commit implements the correct lowering of the
COPY_STRUCT_BYVAL_I32 pseudo-instruction for thumb1 targets.
Previously, the lowering of COPY_STRUCT_BYVAL_I32 generated the
post-increment forms of ldr/ldrh/ldrb instructions. Thumb1 does not
have the post-increment form of these instructions so the generated
assembly contained invalid instructions.

Passing the generated assembly to gcc caused it to complain with an
error like this:

  Error: cannot honor width suffix -- `ldrb r3,[r0],#1'

and the integrated assembler would generate an object file with an
invalid instruction encoding.

This commit contains a small test case that demonstrates the problem
with thumb1 targets as well as an expanded test case that more
throughly tests the lowering of byval struct passing for arm,
thumb1, and thumb2 targets.

llvm-svn: 192916
2013-10-17 19:52:05 +00:00
David Peixotto c32e24a1b7 Refactor lowering for COPY_STRUCT_BYVAL_I32
This commit refactors the lowering of the COPY_STRUCT_BYVAL_I32
pseudo-instruction in the ARM backend. We introduce a new helper
class that encapsulates all of the operations needed during the
lowering. The operations are implemented for each subtarget in
different subclasses. Currently only arm and thumb2 subtargets are
supported.

This refactoring was done to easily implement support for thumb1
subtargets. This initial patch does not add support for thumb1, but
is only a refactoring. A follow on patch will implement the support
for thumb1 subtargets.

No intended functionality change.

llvm-svn: 192915
2013-10-17 19:49:22 +00:00
Alp Toker de0be6232b Fix missed exception spec checks and crashes
Delayed exception specification checking for defaulted members and virtual
destructors are both susceptible to mutation during iteration so we need to
process the worklists fully.

This resolves both accepts-invalid and rejects-valid issues and moreover fixes
potential invalid memory access as the contents of the vectors change during
iteration and recursive template instantiation.

This patch also adds two assertions at end of TU to ensure no specs are left
unchecked as was happenning before the fix, plus a test case from Marshall Clow
for the defaulted member crash extracted from the libcxx headers.

Reviewed by Richard Smith.

llvm-svn: 192914
2013-10-17 19:12:03 +00:00
Anders Waldenborg 959f04077c llvm-c: Add LLVMIntPtrType{,ForAS}InContext
All of the Core API functions have versions which accept explicit context, in
addition to ones which work on global context. This commit adds functions
which accept explicit context to the Target API for consistency.

Patch by Peter Zotov

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

llvm-svn: 192913
2013-10-17 18:51:01 +00:00
Hans Wennborg bef50abea9 CMake: set stack size for MSVC in just one place
After r192904, Reid pointed out he thought we already set the stack
size for MSVC. Turns out we did, but it didn't seem to work.

This commit sets the stack size in a single place, using
CMAKE_EXE_LINKER_FLAGS because that seems to be the way that works
best.

llvm-svn: 192912
2013-10-17 18:39:47 +00:00
DeLesley Hutchins 6501320e72 Consumed analysis: fix ICE in handling of loop source locations.
llvm-svn: 192911
2013-10-17 18:19:31 +00:00
Rafael Espindola 045a78fa7e Rename fields of GlobalStatus to match the coding style.
llvm-svn: 192910
2013-10-17 18:18:52 +00:00
Chad Rosier e7465644c6 [AArch64] Add support for NEON scalar three register different instruction
class.  The instruction class includes the signed saturating doubling
multiply-add long, signed saturating doubling multiply-subtract long, and
the signed saturating doubling multiply long instructions.

llvm-svn: 192909
2013-10-17 18:12:50 +00:00
Chad Rosier 37d29173aa [AArch64] Add support for NEON scalar three register different instruction
class.  The instruction class includes the signed saturating doubling
multiply-add long, signed saturating doubling multiply-subtract long, and
the signed saturating doubling multiply long instructions.

llvm-svn: 192908
2013-10-17 18:12:29 +00:00
Rafael Espindola 27797baee7 rename SafeToDestroyConstant to isSafeToDestroyConstant and clang-format.
llvm-svn: 192907
2013-10-17 18:06:32 +00:00
Rafael Espindola 026c9cbefe Simplify the interface of AnalyzeGlobal a bit and rename to analyzeGlobal.
No functionality change.

llvm-svn: 192906
2013-10-17 18:00:25 +00:00
Edwin Vane dd8cc29ce5 Refactoring transform-specific options
Making the user null macros command-line option visible to the
UseNullptrTransform class instead of being visible only to the match callback.

llvm-svn: 192905
2013-10-17 17:57:36 +00:00
Hans Wennborg fd541f001b CMake: set stack size to 2MB for MSVC builds
Compiling under Visual C++ 2012 with the default stack size of 1MB, the stack
overflows at a depth of 216 template instantiations, well before the 256
default limit. This patch modifies the default MSVC stack size to 2MB.

Patch by Yaron Keren!

llvm-svn: 192904
2013-10-17 17:49:57 +00:00
Bill Wendling 16754ddc00 Add testcase to make sure we don't generate a compact unwind section for ELF binaries.
This tests r190354.

llvm-svn: 192903
2013-10-17 17:38:49 +00:00
Hans Wennborg 2c21f74f02 clang-cl: Add support for asm listings (/FA and /Fa)
This adds support for outputing the assembly to a file during compilation.
It does this by changing the compilation pipeling to not use the integrated
assembler, and keep the intermediate assembler file.

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

llvm-svn: 192902
2013-10-17 16:16:23 +00:00
Alexander Potapenko 1f5573cca2 [ASan] fix assign_large_valloc_to_global.cc to use the correct header for valloc() on OSX.
llvm-svn: 192901
2013-10-17 15:48:24 +00:00
Rafael Espindola 8db352d532 Rename some functions for consistency.
Every other function in Redeclarable.h was using Decl instead of Declaration.

llvm-svn: 192900
2013-10-17 15:37:26 +00:00
Daniel Sanders 9469417064 [mips] Added -mfp64 and -mfp32 options.
These options specify 64-bit FP registers and 32-bit FP registers respectively.

When using -mfp32, the FPU has 16x double-precision registers overlapping with
the 32x single-precision registers (each double-precision register overlaps
two single-precision registers).

When using -mfp64, the FPU has 32x double-precision registers overlapping with
the 32x single-precision registers (each double-precision register overlaps
with one single-precision register and has an additional 32-bits).

MSA requires -mfp64.

llvm-svn: 192899
2013-10-17 14:55:58 +00:00
Daniel Sanders 206bf6243c [mips][msa] Update -mmsa help text and removed the hidden flag to better match conventions used by other targets
llvm-svn: 192898
2013-10-17 14:35:42 +00:00
Ed Maste 4a1c279795 Correct log message typo: ended ad -> ended at
llvm-svn: 192897
2013-10-17 14:03:07 +00:00
Daniel Sanders c835a9fe80 [mips][msa] Added most of the remaining builtins
Includes:
and.v, bmnz.v, bmz.v, bnz.[bhwdv], bz.[bhwdv], cfcmsa, ctcmsa, fcaf,
fcor, fcueq, fcul[et], fcun, fcune, fsaf, fsueq, fsul[et], fsun, fsune, ftrunc
hadd_[su].[hwd], hsub_[su].[hwd], insert.[bhw], insve.[bhw], ld.[bhwd],
move.v, nor.v, or.v, srar.[bhwd], srari.[bhwd], srlr.[bhwd], srlri.[bhwd],
st.[bhwd], subsus_u.[bhwd], subsuu_s.[bhwd], vshf.[bhwd], xor.v

llvm-svn: 192896
2013-10-17 13:57:25 +00:00
Daniel Sanders a4eaf59f9e [mips][msa] Added lsa instruction
llvm-svn: 192895
2013-10-17 13:38:20 +00:00
Alexey Samsonov caabb0eac1 [DebugInfo] Delete dead code, simplify and fix code style for some existing code. No functionality change.
llvm-svn: 192894
2013-10-17 13:28:16 +00:00
Ed Maste 737e92b036 Remove unused DWARFCompileUnit::Extract variant
llvm-svn: 192893
2013-10-17 13:23:03 +00:00
Kostya Serebryany 8e2881d0c2 [asan] fix a failure with ASAN_OPTIONS=verbosity=1:use_sigaltstack=1
llvm-svn: 192892
2013-10-17 13:18:21 +00:00
NAKAMURA Takumi 1c19a0f4a8 Lit: LIT_PRESERVES_TMP should be aware of TMPDIR, too.
TMPDIR is preferred in Unix.

llvm-svn: 192891
2013-10-17 13:11:13 +00:00
Benjamin Kramer d687560d51 Fix tests not to depend on specific regalloc or instruction order.
They were failing with -mcpu=atom.

llvm-svn: 192890
2013-10-17 12:41:05 +00:00
Daniel Sanders 66f5e46a2d Fix r192888: test/CodeGen/Mips/msa/3r_ld_st.ll should have been deleted
llvm-svn: 192889
2013-10-17 12:36:35 +00:00
Daniel Sanders 0390568a09 [mips][msa] Removed ldx.[bhwd] and stx.[bhwd].
These were present in a previous version of the MSA spec but are not
present in the published version. There is no hardware that uses these
instructions.

llvm-svn: 192888
2013-10-17 12:16:03 +00:00
NAKAMURA Takumi 199f138a07 Lit: Introduce an environment variable, $LIT_PRESERVES_TMP, to preserve TMP (and TEMP).
This is intended to check how many temporary files would be generated in automated builders.

llvm-svn: 192887
2013-10-17 12:10:12 +00:00
Evgeniy Stepanov 4bbf273173 [sanitizer] Fix unpoisoning of msghdr::msg_name in recvmsg interceptor.
llvm-svn: 192886
2013-10-17 11:32:30 +00:00