Skip to content
  1. May 24, 2013
    • Joey Gouly's avatar
      Run clang-format over the scalarizePHI function. · b34294d0
      Joey Gouly authored
      llvm-svn: 182640
      b34294d0
    • Joey Gouly's avatar
      scalarizePHI needs to insert the next ExtractElement in the same block · 83699284
      Joey Gouly authored
      as the BinaryOperator, *not* in the block where the IRBuilder is currently
      inserting into. Fixes a bug where scalarizePHI would create instructions
      that would not dominate all uses.
      
      llvm-svn: 182639
      83699284
    • Diego Novillo's avatar
      Add a new function attribute 'cold' to functions. · c6399539
      Diego Novillo authored
      Other than recognizing the attribute, the patch does little else.
      It changes the branch probability analyzer so that edges into
      blocks postdominated by a cold function are given low weight.
      
      Added analysis and code generation tests.  Added documentation for the
      new attribute.
      
      llvm-svn: 182638
      c6399539
    • Alexey Samsonov's avatar
      Disable init-order checking before destructors are run. · 646ec67e
      Alexey Samsonov authored
      We don't want to report initialization-order bugs when a destructor of a global
      variable accesses dynamically initialized global from another
      (not necessarily initialized) module. We do this by intercepting __cxa_atexit and
      registrering our own callback that unpoisons shadow for all dynamically initialized
      global variables.
      
      llvm-svn: 182637
      646ec67e
    • Benjamin Kramer's avatar
      Remove the Copied parameter from MemoryObject::readBytes. · 534d3a46
      Benjamin Kramer authored
      There was exactly one caller using this API right, the others were relying on
      specific behavior of the default implementation. Since it's too hard to use it
      right just remove it and standardize on the default behavior.
      
      Defines away PR16132.
      
      llvm-svn: 182636
      534d3a46
    • Daniel Jasper's avatar
      Fix unused warning in opt builds. · 01a8079b
      Daniel Jasper authored
      In these builds, the asserts() are completely compiled out of the code
      leaving "End" unused. Directly accessing it, should not have a
      performance impact, as it is just a data member.
      
      llvm-svn: 182634
      01a8079b
    • Argyrios Kyrtzidis's avatar
      User correct case for 'FileCheck'. · 1811021f
      Argyrios Kyrtzidis authored
      llvm-svn: 182632
      1811021f
    • Argyrios Kyrtzidis's avatar
      [modules] If we hit a failure while loading a PCH/module, abort parsing... · dc9fdaf2
      Argyrios Kyrtzidis authored
      [modules] If we hit a failure while loading a PCH/module, abort parsing instead of trying to continue in an invalid state.
      
      Also don't let libclang create a PCH with such an error.
      
      Fixes rdar://13953768
      
      llvm-svn: 182629
      dc9fdaf2
    • Ahmed Bougacha's avatar
      MC: Disassembled CFG reconstruction. · aa790681
      Ahmed Bougacha authored
      This patch builds on some existing code to do CFG reconstruction from
      a disassembled binary:
      - MCModule represents the binary, and has a list of MCAtoms.
      - MCAtom represents either disassembled instructions (MCTextAtom), or
        contiguous data (MCDataAtom), and covers a specific range of addresses.
      - MCBasicBlock and MCFunction form the reconstructed CFG. An MCBB is
        backed by an MCTextAtom, and has the usual successors/predecessors.
      - MCObjectDisassembler creates a module from an ObjectFile using a
        disassembler. It first builds an atom for each section. It can also
        construct the CFG, and this splits the text atoms into basic blocks.
      
      MCModule and MCAtom were only sketched out; MCFunction and MCBB were
      implemented under the experimental "-cfg" llvm-objdump -macho option.
      This cleans them up for further use; llvm-objdump -d -cfg now generates
      graphviz files for each function found in the binary.
      
      In the future, MCObjectDisassembler may be the right place to do
      "intelligent" disassembly: for example, handling constant islands is just
      a matter of splitting the atom, using information that may be available
      in the ObjectFile. Also, better initial atom formation than just using
      sections is possible using symbols (and things like Mach-O's
      function_starts load command).
      
      This brings two minor regressions in llvm-objdump -macho -cfg:
      - The printing of a relocation's referenced symbol.
      - An annotation on loop BBs, i.e., which are their own successor.
      
      Relocation printing is replaced by the MCSymbolizer; the basic CFG
      annotation will be superseded by more related functionality.
      
      llvm-svn: 182628
      aa790681
    • Greg Clayton's avatar
      <rdar://problem/13643315> · 7bcb93d5
      Greg Clayton authored
      Fixed performance issues that arose after changing SBTarget, SBProcess, SBThread and SBFrame over to using a std::shared_ptr to a ExecutionContextRef. The ExecutionContextRef doesn't store a std::weak_ptr to a stack frame because stack frames often get replaced with new version, so it held onto a StackID object that would allow us to ask the thread each time for the frame for the StackID. The linear function was too slow for large recursive stacks. We also fixed an issue where anytime the std::shared_ptr<ExecutionContextRef> in any SBTarget, SBProcess, SBThread objects was turned into an ExecutionContext object, it would try to resolve all items in the ExecutionContext which are shared pointers. Even if the StackID in the ExecutionContextRef was invalid, it was looking through all frames in every thread. This causes a lot of unnecessary frame accesses.
      
      llvm-svn: 182627
      7bcb93d5
    • Ted Kremenek's avatar
      Update static analyzer build to checker-275. · 48ed4b61
      Ted Kremenek authored
      llvm-svn: 182626
      48ed4b61
    • Ahmed Bougacha's avatar
      Add MCSymbolizer for symbolic/annotated disassembly. · ad1084de
      Ahmed Bougacha authored
      This is a basic first step towards symbolization of disassembled
      instructions. This used to be done using externally provided (C API)
      callbacks. This patch introduces:
      - the MCSymbolizer class, that mimics the same functions that were used
        in the X86 and ARM disassemblers to symbolize immediate operands and
        to annotate loads based off PC (for things like c string literals).
      - the MCExternalSymbolizer class, which implements the old C API.
      - the MCRelocationInfo class, which provides a way for targets to
        translate relocations (either object::RelocationRef, or disassembler
        C API VariantKinds) to MCExprs.
      - the MCObjectSymbolizer class, which does symbolization using what it
        finds in an object::ObjectFile. This makes simple symbolization (with
        no fancy relocation stuff) work for all object formats!
      - x86-64 Mach-O and ELF MCRelocationInfos.
      - A basic ARM Mach-O MCRelocationInfo, that provides just enough to
        support the C API VariantKinds.
      
      Most of what works in otool (the only user of the old symbolization API
      that I know of) for x86-64 symbolic disassembly (-tvV) works, namely:
      - symbol references: call _foo; jmp 15 <_foo+50>
      - relocations:       call _foo-_bar; call _foo-4
      - __cf?string:       leaq 193(%rip), %rax ## literal pool for "hello"
      Stub support is the main missing part (because libObject doesn't know,
      among other things, about mach-o indirect symbols).
      
      As for the MCSymbolizer API, instead of relying on the disassemblers
      to call the tryAdding* methods, maybe this could be done automagically
      using InstrInfo? For instance, even though PC-relative LEAs are used
      to get the address of string literals in a typical Mach-O file, a MOV
      would be used in an ELF file. And right now, the explicit symbolization
      only recognizes PC-relative LEAs. InstrInfo should have already have
      most of what is needed to know what to symbolize, so this can
      definitely be improved.
      
      I'd also like to remove object::RelocationRef::getValueString (it seems
      only used by relocation printing in objdump), as simply printing the
      created MCExpr is definitely enough (and cleaner than string concats).
      
      llvm-svn: 182625
      ad1084de
    • Richard Smith's avatar
      Fix crash-on-invalid if list-initialization works, but we bail out when · cd09065e
      Richard Smith authored
      building the resulting expression because it invokes a deleted constructor.
      
      llvm-svn: 182624
      cd09065e
    • Bill Wendling's avatar
      48143175
    • Filipe Cabecinhas's avatar
      Adds PT_TLS and PT_GNU_EH_FRAME names to DumpELFProgramHeaders · 477d86d8
      Filipe Cabecinhas authored
      llvm-svn: 182619
      477d86d8
    • Ulrich Weigand's avatar
      · 99485469
      Ulrich Weigand authored
      [PowerPC] Remove symbolLo/symbolHi instruction operand types
      
      Now that there is no longer any distinction between symbolLo
      and symbolHi operands in either printing, encoding, or parsing,
      the operand types can be removed in favor of simply using
      s16imm.
      
      This completes the patch series to decouple lo/hi operand part
      processing from the particular instruction whose operand it is.
      
      No change in code generation expected from this patch.
      
      llvm-svn: 182618
      99485469
    • Daniel Malea's avatar
      Re-implement DebugIR in a way that does not subclass AssemblyWriter: · fddddbea
      Daniel Malea authored
      - move AsmWriter.h from public headers into lib
      - marked all AssemblyWriter functions as non-virtual; no need to override them
      - DebugIR now "plugs into" AssemblyWriter with an AssemblyAnnotationWriter helper
      - exposed flags to control hiding of a) debug metadata b) debug intrinsic calls
      
      C/R: Paul Redmond
      
      llvm-svn: 182617
      fddddbea
    • Ulrich Weigand's avatar
      · 41789de1
      Ulrich Weigand authored
      [PowerPC] Clean up generation of ha16() / lo16() markers
      
      When targeting the Darwin assembler, we need to generate markers ha16() and
      lo16() to designate the high and low parts of a (symbolic) immediate.  This
      is necessary not just for plain symbols, but also for certain symbolic
      expression, typically along the lines of ha16(A - B).  The latter doesn't
      work when simply using VariantKind flags on the symbol reference.
      This is why the current back-end uses hacks (explicitly called out as such
      via multiple FIXMEs) in the symbolLo/symbolHi print methods.
      
      This patch uses target-defined MCExpr codes to represent the Darwin
      ha16/lo16 constructs, following along the lines of the equivalent solution
      used by the ARM back end to handle their :upper16: / :lower16: markers.
      This allows us to get rid of special handling both in the symbolLo/symbolHi
      print method and in the common code MCExpr::print routine.  Instead, the
      ha16 / lo16 markers are printed simply in a custom print routine for the
      target MCExpr types.  (As a result, the symbolLo/symbolHi print methods
      can now replaced by a single printS16ImmOperand routine that also handles
      symbolic operands.)
      
      The patch also provides a EvaluateAsRelocatableImpl routine to handle
      ha16/lo16 constructs.  This is not actually used at the moment by any
      in-tree code, but is provided as it makes merging into David Fang's
      out-of-tree Mach-O object writer simpler.
      
      Since there is no longer any need to treat VK_PPC_GAS_HA16 and
      VK_PPC_DARWIN_HA16 differently, they are merged into a single
      VK_PPC_ADDR16_HA (and likewise for the _LO16 types).
      
      llvm-svn: 182616
      41789de1
  2. May 23, 2013
Loading