1. Oct 18, 2013
    • Alexey Samsonov's avatar
    • Alp Toker's avatar
      Fix initialization order warning in mingw32 build · 153675b7
      Alp Toker authored
      No change in functionality.
      
      llvm-svn: 192953
      153675b7
    • Alexey Samsonov's avatar
      [DebugInfo] Remove dead code. · 5b5a7865
      Alexey Samsonov authored
      llvm-svn: 192952
      5b5a7865
    • Richard Smith's avatar
    • Richard Smith's avatar
      Basic ODR checking for C++ modules: · 2b9e3e39
      Richard Smith authored
      If we have multiple definitions of the same entity from different modules, we
      nominate the first definition which we see as being the canonical definition.
      If we load a declaration from a different definition and we can't find a
      corresponding declaration in the canonical definition, issue a diagnostic.
      
      This is insufficient to prevent things from going horribly wrong in all cases
      -- we might be in the middle of emitting IR for a function when we trigger some
      deserialization and discover that it refers to an incoherent piece of the AST,
      by which point it's probably too late to bail out -- but we'll at least produce
      a diagnostic.
      
      llvm-svn: 192950
      2b9e3e39
    • Jason Molenda's avatar
      Move the code which translates a dispatch_qaddr into a · 3dc4f44e
      Jason Molenda authored
      queue name out of ProcessGDBRemote and in to the Platform
      plugin, specifically PlatformDarwin.
      
      Also add a Platform method to translate a dispatch_quaddr
      to a QueueID, and a Thread::GetQueueID().
      
      I'll add an SBThread::GetQueueID() next.
      
      llvm-svn: 192949
      3dc4f44e
    • Alp Toker's avatar
      Check "late parsed" friend functions for redefinition · 19bff32e
      Alp Toker authored
      r177003 applied the late parsed template technique to friend functions
      but omitted the corresponding check for redefinitions.
      
      This patch adds the same check already in use for templates to the
      new code path in order to diagnose and reject invalid redefinitions
      that were being silently accepted.
      
      Fixes PR17324.
      
      Reviewed by Richard Smith.
      
      llvm-svn: 192948
      19bff32e
    • Alp Toker's avatar
      Fix missed exception spec checks and crashes · ae3a944a
      Alp Toker authored
      Delayed exception specification checking for defaulted members and virtual
      destructors are both susceptible to mutation during iteration so we need to
      swap and process the worklists.
      
      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.
      
      Checking can be further delayed where parent classes aren't yet fully defined.
      This patch 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: 192947
      ae3a944a
    • Nick Lewycky's avatar
      False. GCC does not accept [[gnu::warn_unused]], not to be confused with... · b01092f0
      Nick Lewycky authored
      False. GCC does not accept [[gnu::warn_unused]], not to be confused with [[gnu::warn_unused_result]] which does exist.
      
      llvm-svn: 192946
      b01092f0
    • Rui Ueyama's avatar
      Fill the atom gap with INT 3 instead of NOP. · f47fa51c
      Rui Ueyama authored
      INT 3 (machine code 0xCC) will raise an interrupt when executed. That is better
      for filling the gap than NOP because we want to stop the execution immediately
      when the control reached to non-code address.
      
      llvm-svn: 192945
      f47fa51c
    • Shankar Easwaran's avatar
      [Native] Fix fallback atoms when writing to Native file. · 0879c1e6
      Shankar Easwaran authored
      There is no test as currently there is no call to the NativeWriter.
      
      Future commits will add calls to the NativeWriter.
      
      llvm-svn: 192944
      0879c1e6
    • Rui Ueyama's avatar
      Fix -Wunused-function warning of release build. · 5206222f
      Rui Ueyama authored
      llvm-svn: 192943
      5206222f
    • Rui Ueyama's avatar
      Fix a layout pass debug message. · 4050b20b
      Rui Ueyama authored
      llvm-svn: 192942
      4050b20b
    • Rui Ueyama's avatar
      Improve debug message of the layout pass. · 6a607b6a
      Rui Ueyama authored
      Instead of showing multiple lines of debug messages, show only one message
      by CompareAtoms::operator(). Here is an example.
      
      Before:
        Sorting _main .text
        Sorting by sectionPos(2,2)
        Sorting by override
        Sorting _main .text
        Sorting by sectionPos(2,2)
        Sorting by override
      
      After:
        Layout: '_main' > '.text' (override (1, 0))
        Layout: '_main' > '.text' (override (1, 0))
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D1964
      
      llvm-svn: 192941
      6a607b6a
    • Hans Wennborg's avatar
      Revert "Re-commit r192758 - MC: quote tricky symbol names in asm output" · 7ddcdc82
      Hans Wennborg authored
      This caused the clang-native-mingw32-win7 buildbot to break.
      
      The assembler was complaining about the following lines that were showing up
      in the asm for CrashRecoveryContext.cpp:
      
        movl  $"__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4", 4(%eax)
        calll "_AddVectoredExceptionHandler@8"
        .def   "__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4";
        "__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4":
        calll "_RemoveVectoredExceptionHandler@4"
      
      Reverting for now.
      
      llvm-svn: 192940
      7ddcdc82
    • Shankar Easwaran's avatar
      [ELF] Set ordinals properly to all atoms. · b6c825a5
      Shankar Easwaran authored
      llvm-svn: 192939
      b6c825a5
    • Eric Christopher's avatar
      Temporarily revert r192749 as it is causing problems for LTO and · ffbc4dec
      Eric Christopher authored
      requires a more in depth change to the IR structure.
      
      llvm-svn: 192938
      ffbc4dec
    • Richard Smith's avatar
      Fix 80-column violation. · 77c5bb5e
      Richard Smith authored
      llvm-svn: 192937
      77c5bb5e
    • David Majnemer's avatar
      [-fms-extensions] Permit 'override' in C++98 and 'sealed' as a synonym for 'final' · a543308c
      David Majnemer authored
      Summary: Some MS headers use these features.
      
      Reviewers: rnk, rsmith
      
      CC: cfe-commits
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D1948
      
      llvm-svn: 192936
      a543308c
    • DeLesley Hutchins's avatar
      Consumed analysis: Add param_typestate attribute, which specifies that · 6939177c
      DeLesley Hutchins authored
      function parameters must be in a particular state.  Patch by
      chris.wailes@gmail.com.  Reviewed by delesley@google.com.
      
      llvm-svn: 192934
      6939177c
    • Fariborz Jahanian's avatar
      ObjectiveC migrator. Minor clean up of my last patch. · 403425bb
      Fariborz Jahanian authored
      No functional change.
      
      llvm-svn: 192933
      403425bb
    • DeLesley Hutchins's avatar
      Consumed Analysis: Allow parameters that are passed by non-const reference · 36ea1dd4
      DeLesley Hutchins authored
      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
      36ea1dd4
    • Richard Smith's avatar
      Make the big array in the UBSan C++ runtime be zero-initialized to dramatically · c1d54712
      Richard Smith authored
      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
      c1d54712
    • Rui Ueyama's avatar
      Fill gap in .text with NOP. · cf671439
      Rui Ueyama authored
      llvm-svn: 192930
      cf671439
    • Richard Mitton's avatar
      Removed unnecessary call to OpenFirstAvailableMaster. · 665068b3
      Richard Mitton authored
      ::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
      665068b3
    • Enrico Granata's avatar
      This is the last piece of work for "formats in categories": we now cache... · 52b4b6cd
      Enrico Granata authored
      This is the last piece of work for "formats in categories": we now cache formats as well as summaries and synthetics
      
      llvm-svn: 192928
      52b4b6cd
    • Fariborz Jahanian's avatar
      ObjectiveC migrator. In infering NS_ENUM/NS_OPTIONS · de79e816
      Fariborz Jahanian authored
      macros, prefer the typedef immediately following the
      enum declaration to the one preceeding it.
      // rdar://15200915
      
      llvm-svn: 192927
      de79e816
    • DeLesley Hutchins's avatar
      Consumed analysis: update to previous test case. · db67ec3c
      DeLesley Hutchins authored
      llvm-svn: 192926
      db67ec3c
    • David Blaikie's avatar
      DIEHash: Add more things (and remove one character) from the COLLECT_ATTR macro · 01fae51f
      David Blaikie authored
      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
      01fae51f
    • David Blaikie's avatar
      ca353be6
    • Reid Kleckner's avatar
      [ms-cxxabi] Error out on virtual function memptrs · 5a823d5f
      Reid Kleckner authored
      These are uncommon and this is better than miscompiling.
      
      llvm-svn: 192923
      5a823d5f
    • Richard Mitton's avatar
      Added support for reading thread-local storage variables, as defined using the __thread modifier. · 0a558357
      Richard Mitton authored
      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
      0a558357
    • Alp Toker's avatar
      Revert "Fix missed exception spec checks and crashes" · be2a55f5
      Alp Toker authored
      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
      be2a55f5
    • Ed Maste's avatar
      Fix building with ENABLE_DEBUG_PRINTF · a0191d11
      Ed Maste authored
      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
      a0191d11
    • Hans Wennborg's avatar
      Make .asm a valid extension for assembly files · cd2672c9
      Hans Wennborg authored
      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
      cd2672c9
    • Ed Maste's avatar
      Whitespace: replace 4-space-tabs with spaces · 4c24b126
      Ed Maste authored
      llvm-svn: 192918
      4c24b126
    • Richard Mitton's avatar
      Rearranged linker flags for test suite. · ec8b282b
      Richard Mitton authored
      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
      ec8b282b
    • David Peixotto's avatar
      17309 ARM backend incorrectly lowers COPY_STRUCT_BYVAL_I32 for thumb1 targets · 8e5abc52
      David Peixotto authored
      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
      8e5abc52
    • David Peixotto's avatar
      Refactor lowering for COPY_STRUCT_BYVAL_I32 · c32e24a1
      David Peixotto authored
      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
      c32e24a1
    • Alp Toker's avatar
      Fix missed exception spec checks and crashes · de0be623
      Alp Toker authored
      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
      de0be623