Skip to content
  1. Nov 20, 2016
  2. Nov 19, 2016
    • Mehdi Amini's avatar
      Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC) · 6f408368
      Mehdi Amini authored
      Summary:
      This makes it explicit that ownership is taken. Also replace all `new`
      with make_unique<> at call sites.
      
      Reviewers: anemet
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D26884
      
      llvm-svn: 287449
      6f408368
    • Chris Bieneman's avatar
      [CMake] llvm-lto2 depends on intrinsics_gen · 671a1279
      Chris Bieneman authored
      llvm-lto2.cpp has the following include chain:
      
      llvm/LTO/Caching.h
      llvm/LTO/LTO.h
      llvm/CodeGen/Analysis.h
      llvm/IR/CallSite.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-lto2 needs to depend on intrinsics_gen.
      
      llvm-svn: 287434
      671a1279
    • Chris Bieneman's avatar
      [CMake] opt depends on intrinsics_gen · 367cf3c2
      Chris Bieneman authored
      AnalysisWrappers.cpp has the following include chain:
      
      llvm/Analysis/CallGraph.h
      llvm/IR/CallSite.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means opt needs to depend on intrinsics_gen.
      
      llvm-svn: 287433
      367cf3c2
    • Chris Bieneman's avatar
      [CMake] llvm-nm depends on intrinsics_gen · 458796dd
      Chris Bieneman authored
      llvm-nm.cpp has the following include chain:
      
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-nm needs to depend on intrinsics_gen.
      
      llvm-svn: 287432
      458796dd
    • Chris Bieneman's avatar
      [CMake] llvm-link depends on intrinsics_gen · b2b18d2a
      Chris Bieneman authored
      llvm-link.cpp has the following include chain:
      
      llvm/Bitcode/BitcodeWriter.h
      llvm/IR/ModuleSummaryIndex.h
      llvm/IR/Module.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-link needs to depend on intrinsics_gen.
      
      llvm-svn: 287431
      b2b18d2a
    • Chris Bieneman's avatar
      [CMake] llvm-extract depends on intrinsics_gen · 1bc4fab8
      Chris Bieneman authored
      llvm-extract.cpp has the following include chain:
      
      llvm/Bitcode/BitcodeWriterPass.h
      llvm/IR/PassManager.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-extract needs to depend on intrinsics_gen.
      
      llvm-svn: 287430
      1bc4fab8
    • Chris Bieneman's avatar
      [CMake] llvm-dwp depends on intrinsics_gen · 4e826e09
      Chris Bieneman authored
      llvm-dwp.cpp has the following include chain:
      
      llvm/CodeGen/AsmPrinter.h
      llvm/CodeGen/MachineFunctionPass.h
      llvm/CodeGen/MachineFunction.h
      llvm/CodeGen/MachineBasicBlock.h
      llvm/CodeGen/MachineInstr.h
      llvm/Analysis/AliasAnalysis.h
      llvm/IR/CallSite.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-dwp needs to depend on intrinsics_gen.
      
      llvm-svn: 287429
      4e826e09
    • Chris Bieneman's avatar
      [CMake] llvm-dis depends on intrinsics_gen · e525ef9c
      Chris Bieneman authored
      llvm-dis.cpp has the following include chain:
      
      llvm/Bitcode/BitcodeReader.h
      llvm/IR/ModuleSummaryIndex.h
      llvm/IR/Module.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-dis needs to depend on intrinsics_gen.
      
      llvm-svn: 287428
      e525ef9c
    • Chris Bieneman's avatar
      [CMake] llvm-diff depends on intrinsics_gen · 041c1102
      Chris Bieneman authored
      llvm-diff.cpp has the following include chain:
      
      llvm/IR/Module.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-diff needs to depend on intrinsics_gen.
      
      llvm-svn: 287427
      041c1102
    • Chris Bieneman's avatar
      [CMake] llvm-stress depends on intrinsics_gen · 70390f5d
      Chris Bieneman authored
      llvm-stress.cpp has the following include chain:
      
      llvm/Analysis/CallGraphSCCPass.h
      llvm/Analysis/CallGraph.h
      llvm/IR/CallSite.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-stress needs to depend on intrinsics_gen.
      
      llvm-svn: 287426
      70390f5d
    • Chris Bieneman's avatar
      [CMake] bugpoint-passes depends on intrinsics_gen · d9d28a74
      Chris Bieneman authored
      TestPasses.cpp has the following include chain:
      
      llvm/IR/InstVisitor.h
      llvm/IR/CallSite.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means bugpoint-passes needs to depend on intrinsics_gen.
      
      llvm-svn: 287425
      d9d28a74
    • Chris Bieneman's avatar
      [CMake] llvm-bcanalyzer depends on intrinsics_gen · a3acfaa5
      Chris Bieneman authored
      llvm-bcanalyzer.cpp has the following include chain:
      
      llvm/Bitcode/BitcodeReader.h
      llvm/IR/ModuleSummaryIndex.h
      llvm/IR/Module.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-bcanalyzer needs to depend on intrinsics_gen.
      
      llvm-svn: 287424
      a3acfaa5
    • Chris Bieneman's avatar
      [CMake] llvm-as depends on intrinsics_gen · ac6ab6fd
      Chris Bieneman authored
      llvm-as.cpp has the following include chain:
      
      llvm/Bitcode/BitcodeWriter.h
      llvm/IR/ModuleSummaryIndex.h
      llvm/IR/Module.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-as needs to depend on intrinsics_gen.
      
      llvm-svn: 287423
      ac6ab6fd
    • Chris Bieneman's avatar
      [CMake] llc depends on intrinsics_gen · e5cb14cf
      Chris Bieneman authored
      llc.cpp has the following include chain:
      
      llvm/Analysis/TargetLibraryInfo.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llc needs to depend on intrinsics_gen.
      
      llvm-svn: 287422
      e5cb14cf
    • Chris Bieneman's avatar
      [CMake] lli-child-target depends on intrinsics gen · d7f71b51
      Chris Bieneman authored
      Messed up in r287420, it isn't just lli, but also but lli-child-target that need to depend on intrinsics_gen.
      
      llvm-svn: 287421
      d7f71b51
    • Chris Bieneman's avatar
      [CMake] lli depends on intrinsics_gen · 3bd0191c
      Chris Bieneman authored
      ChildTarget.cpp has the following include chain:
      
      llvm/ExecutionEngine/Orc/OrcABISupport.h
      llvm/ExecutionEngine/Orc/IndirectionUtils.h
      llvm/IR/IRBuilder.h
      llvm/IR/ConstantFolder.h
      llvm/IR/InstrTypes.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means lli needs to depend on intrinsics_gen.
      
      llvm-svn: 287420
      3bd0191c
    • Chris Bieneman's avatar
      [CMake] llvm-dsymutil depends on intrinsics_gen · d22fa509
      Chris Bieneman authored
      DwarfLinker.cpp has the following include chain:
      
      llvm/CodeGen/AsmPrinter.h
      llvm/CodeGen/MachineFunctionPass.h
      llvm/CodeGen/MachineFunction.h
      llvm/CodeGen/MachineBasicBlock.h
      llvm/CodeGen/MachineInstr.h
      llvm/Analysis/AliasAnalysis.h
      llvm/IR/CallSite.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-dsymutil needs to depend on intrinsics_gen.
      
      llvm-svn: 287419
      d22fa509
    • Chris Bieneman's avatar
      [CMake] verify-uselistorder depends on intrinsics_gen · 9c520d75
      Chris Bieneman authored
      verify-uselistorder.cpp has the following include chain:
      
      llvm/Bitcode/BitcodeReader.h
      llvm/IR/ModuleSummaryIndex.h
      llvm/IR/Module.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means verify-uselistorder needs to depend on intrinsics_gen.
      
      llvm-svn: 287405
      9c520d75
    • Chris Bieneman's avatar
      [CMake] sanstats depends on intrinsics_gen · 585b4a3e
      Chris Bieneman authored
      sanstats.cpp has the following include chain:
      
      llvm/Transforms/Utils/SanitizerStats.h
      llvm/IR/IRBuilder.h
      llvm/IR/ConstantFolder.h
      llvm/IR/InstrTypes.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means sanstats needs to depend on intrinsics_gen.
      
      llvm-svn: 287404
      585b4a3e
    • Chris Bieneman's avatar
      [CMake] bugpoint depends on intrinsics_gen · 6cc58e09
      Chris Bieneman authored
      CrashDebugger.cpp has the following include chain:
      
      llvm/Analysis/TargetTransformInfo.h
      llvm/IR/IntrinsicInst.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means bugpoint needs to depend on intrinsics_gen.
      
      llvm-svn: 287402
      6cc58e09
    • Chris Bieneman's avatar
      [CMake] llvm-split depends on intrinsics_gen · 93fa1860
      Chris Bieneman authored
      llvm-split.cpp has the following include chain:
      
      llvm/Bitcode/BitcodeWriter.h
      llvm/IR/ModuleSummaryIndex.h
      llvm/IR/Module.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-split needs to depend on intrinsics_gen.
      
      llvm-svn: 287399
      93fa1860
    • Chris Bieneman's avatar
      [CMake] llvm-lto depends on intrinsics_gen · 26df1177
      Chris Bieneman authored
      llvm-lto.cpp has the following include chain:
      
      llvm/Bitcode/BitcodeReader.h
      llvm/IR/ModuleSummaryIndex.h
      llvm/IR/Module.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-lto needs to depend on intrinsics_gen.
      
      llvm-svn: 287398
      26df1177
    • Chris Bieneman's avatar
      [CMake] llvm-ar depends on intrinsics_gen · 13c96391
      Chris Bieneman authored
      llvm-ar.cpp has the following include chain:
      
      llvm/IR/Module.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-ar needs to depend on intrinsics_gen.
      
      llvm-svn: 287395
      13c96391
    • Chris Bieneman's avatar
      [CMake] llvm-profdata depends on intrinsics_gen · 8e476049
      Chris Bieneman authored
      llvm-profdata.cpp has the following include chain:
      
      llvm/ProfileData/SampleProfReader.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means llvm-profdata needs to depend on intrinsics_gen.
      
      llvm-svn: 287394
      8e476049
    • Chris Bieneman's avatar
      [CMake] LTO depends on intrinsics_gen · caf299ff
      Chris Bieneman authored
      lto.cpp has the following include chain:
      
      llvm/Bitcode/BitcodeReader.h
      llvm/IR/ModuleSummaryIndex.h
      llvm/IR/Module.h
      llvm/IR/Function.h
      llvm/IR/Argument.h
      llvm/IR/Attributes.h
      llvm/IR/Attributes.gen
      
      This means LTO needs to depend on intrinsics_gen.
      
      llvm-svn: 287393
      caf299ff
  3. Nov 17, 2016
  4. Nov 16, 2016
    • Kevin Enderby's avatar
      General clean up of error handling in llvm-objdump to remove its use of report_fatal_error(). · 7fa40c9f
      Kevin Enderby authored
      No real functional change with this commit.
      
      The problem with report_fatal_error() is it does not include the tool name
      and the file name the for which the error message was generated.
      
      Uses of report_fatal_error() were change to report_error() or error()
      to get a better error and to make the code smaller and cleaner.
      
      Also changed things like error(errorToErrorCode(SOrErr.takeError())) to
      use report_error() with a file name and the llvm::Error (as well as the
      ArchitectureName if available) so the error message is printed.
      
      llvm-svn: 287163
      7fa40c9f
    • Vitaly Buka's avatar
      Fix "isn't a prototype" warning · e596986a
      Vitaly Buka authored
      llvm-svn: 287161
      e596986a
    • Davide Italiano's avatar
      [ELF] Convert ELF.h to Expected<T>. · 6cf09265
      Davide Italiano authored
      This has two advantages:
      1) We slowly move away from ErrorOr to the new handling interface,
      in the hope of having an uniform error handling in LLVM, eventually.
      2) We're starting to have *meaningful* error messages for invalid
      object ELF files, rather than a generic "parse error". At some point
      we should include also the offset to improve the quality of the
      diagnostic.
      
      llvm-svn: 287081
      6cf09265
    • Richard Smith's avatar
      Fix build break when the host C compiler is C89. · 6b335d19
      Richard Smith authored
      llvm-svn: 287075
      6b335d19
    • Kevin Enderby's avatar
      General clean up of Mach-O error handling in llvm-objdump. · 844c4ac5
      Kevin Enderby authored
      To get a good error message for all files that could contain Mach-O
      files the code in llvm-objdump needs to use the archive member name
      and name of the architecture of a slice of a universal file in those cases
      where the error come from a Mach-O file in an archive or a universal file.
      
      Most of this is fixed by moving the call to checkSymbolTable() into
      ProcessMachO() and calling it when the operation needs the symbol
      table.  And then calling the form of report_error() that has the
      ArchiveName and ArchitectureName arguments.  One other place
      needed to call this form of report_error() also with these arguments.
      
      Also changed the code in MachODump.cpp to not use report_fatal_error()
      and use report_error() instead to make the code smaller and cleaner.  All
      cases of this are for errors with the symbol table which should now never
      be tripped since checkSymbolTable() should be called first to get a good
      error message in these cases.
      
      llvm-svn: 287050
      844c4ac5
  5. Nov 15, 2016
    • Amaury Sechet's avatar
      [C API] Prevent nullptr dereferences in C API for counting attributes. · 003216b3
      Amaury Sechet authored
      See https://reviews.llvm.org/D26392
      
      Patch by @maleadt
      
      llvm-svn: 287044
      003216b3
    • Tim Northover's avatar
      llvm-objdump: deal with unexpected object files more gracefully. · bf55f7ea
      Tim Northover authored
      Specifically, we don't want to segfault on release builds, so print the problem
      instead.
      
      llvm-svn: 287022
      bf55f7ea
    • Greg Clayton's avatar
      Improve DWARF parsing speed by improving DWARFAbbreviationDeclaration · 6f6e4dbd
      Greg Clayton authored
      This patch gets a DWARF parsing speed improvement by having DWARFAbbreviationDeclaration instances know if they have a fixed byte size. If an abbreviation has a fixed byte size that can be calculated given a DWARFUnit, then parsing a DIE becomes two steps: parse ULEB128 abbrev code, and then add constant size to the offset.
      
      This patch also adds a fixed byte size to each DWARFAbbreviationDeclaration::AttributeSpec so that attributes can quickly skip their values if needed without the need to lookup the fixed for size.
      
      Notable improvements:
      
      - DWARFAbbreviationDeclaration::findAttributeIndex() now returns an Optional<uint32_t> instead of a uint32_t and we no longer have to look for the magic -1U return value
      - Optional<uint32_t> DWARFAbbreviationDeclaration::findAttributeIndex(dwarf::Attribute attr) const;
      - DWARFAbbreviationDeclaration now has a getAttributeValue() function that extracts an attribute value given a DIE offset that takes advantage of the DWARFAbbreviationDeclaration::AttributeSpec::ByteSize
      - bool DWARFAbbreviationDeclaration::getAttributeValue(const uint32_t DIEOffset, const dwarf::Attribute Attr, const DWARFUnit &U, DWARFFormValue &FormValue) const;
      - A DWARFAbbreviationDeclaration instance can return a fixed byte size for itself so DWARF parsing is faster:
      - Optional<size_t> DWARFAbbreviationDeclaration::getFixedAttributesByteSize(const DWARFUnit &U) const;
      - Any functions that used to take a "const DWARFUnit *U" that would crash if U was NULL now take a "const DWARFUnit &U" and are only called with a valid DWARFUnit
      
      Differential Revision: https://reviews.llvm.org/D26567
      
      llvm-svn: 286924
      6f6e4dbd
    • Saleem Abdulrasool's avatar
      llvm-strings: support the `-n` option · f7009b42
      Saleem Abdulrasool authored
      Permit specifying the match length (the `-n` or `--bytes` option).  The
      deprecated `-[length]` form is not supported as an option.  This allows the
      strings tool to display only the specified length strings rather than the
      hardcoded default length of >= 4.
      
      llvm-svn: 286914
      f7009b42
  6. Nov 14, 2016
    • Saleem Abdulrasool's avatar
      Revert "Revert "llvm-strings: support printing the filename"" · f10a8714
      Saleem Abdulrasool authored
      Change the dynamic files to static in the hope that it will actually fix the
      transient errors that Ive been unable to reproduce.
      
      llvm-svn: 286891
      f10a8714
    • Kevin Enderby's avatar
      Add a checkSymbolTable() method to the MachOObjectFile class. · 22fc0078
      Kevin Enderby authored
      The philosophy of the error checking in libObject for Mach-O files
      is that the constructor will check the load commands so for their
      tables the offsets and sizes are properly contained in the file.
      But there is no checking of the entries of any of the tables.
      
      For the contents of the tables themselves the methods accessing
      the contents of the entries return errors as needed.  In some
      cases this however makes it difficult or cumbersome to produce
      a good error message which would include the tool name, file name,
      archive member, and name of the architecture of a slice of a universal file
      the error occurred in.
      
      So idea is that there will be a method to check a table which can
      be called up front before using it allowing a good error message
      to be produced before a table is used.  And if only verification of
      the Mach-O file and its tables are wanted a new possible method
      checkAllTables() could be added to call all of the methods to
      check all the tables at some time when such methods exist.
      
      The checkSymbolTable() is the first of such methods to check
      one of the Mach-O file tables.  This method initially will used in
      llvm-objdump’s DisassembleMachO() routine before it gets the
      section and symbol information.  As if there are problems with
      the symbol table currently the error is first encountered by the
      bool operator() in the SymbolSorter() struct which passed to
      std::sort().  In this case there is no context as to the file name
      the symbol which results a poor error message:
      
      LLVM ERROR: truncated or malformed object (bad string index: 22 for symbol at index 1)
      
      with the added call to the checkSymbolTable() method the
      error message includes the tool name and file name:
      
      llvm-objdump: 'macho-invalid-symbol-strx': truncated or malformed object (bad string table index: 22 past the end of string table, for symbol at index 1)
      llvm-svn: 286887
      22fc0078
Loading