Commit Graph

4243 Commits

Author SHA1 Message Date
Rafael Espindola e03dfd9b0a Port GetMainExecutable over to PathV2.
I will remove the V1 version as soon as I change clang in the next commit.

llvm-svn: 184914
2013-06-26 05:01:35 +00:00
Rafael Espindola 242fcb846e Move GetEXESuffix to the one place it is used.
llvm-svn: 184853
2013-06-25 14:42:30 +00:00
Rafael Espindola 8c8117240c keep only the StringRef version of getFileOrSTDIN.
llvm-svn: 184826
2013-06-25 05:28:34 +00:00
Rafael Espindola b046eedb94 Create the file with the right permissions instead of setting it afterwards.
Removes the last use of PathV1.h in llvm-ar.

llvm-svn: 184630
2013-06-22 02:34:24 +00:00
Sean Silva 8217757379 [yaml2obj][ELF] Make symbol table top-level key.
Although in reality the symbol table in ELF resides in a section, the
standard requires that there be no more than one SHT_SYMTAB. To enforce
this constraint, it is cleaner to group all the symbols under a
top-level `Symbols` key on the object file.

llvm-svn: 184627
2013-06-22 01:38:00 +00:00
Sean Silva 7a0c3a6fc4 [yaml2obj][ELF] Narrow parameter.
The full ELFYAML::Section isn't needed.

llvm-svn: 184626
2013-06-22 01:37:55 +00:00
Sean Silva 7d61722259 [yaml2obj][ELF] Don't special case writing these.
Just add them to the vector of section headers like the rest of the
section headers.

llvm-svn: 184624
2013-06-22 01:06:12 +00:00
Sean Silva 11caebaa32 [yaml2obj][ELF] Make this "type switch" actually readable.
llvm-svn: 184623
2013-06-22 01:03:35 +00:00
Sean Silva d93323f51d [yaml2obj][ELF] Align section contents in the output.
The improperly aligned section content in the output was causing
buildbot failures. This should fix them.

Incidentally, this results in a simpler and more robust API for
ContiguousBlobAccumulator.

llvm-svn: 184621
2013-06-22 00:47:43 +00:00
Rafael Espindola e88d90ab93 Convert some uses of PathV1.h in ArchiveWriter.cpp.
llvm-svn: 184599
2013-06-21 22:11:36 +00:00
Sean Silva c4afa6d7ae [yaml2obj][ELF] Allow expressing undefined symbols.
Previously we unconditionally enforced that section references in
symbols in the YAML had a name that was a section name present in the
object, and linked the references to that section. Now, permit empty
section names (already the default, if the `Section` key is not
provided) to indicate SHN_UNDEF.

llvm-svn: 184513
2013-06-21 01:11:48 +00:00
Sean Silva 37e817c8fc Unbreak bots. Didn't realize this was a C++11 feature.
llvm-svn: 184508
2013-06-21 00:33:01 +00:00
Sean Silva aff5125f88 [yaml2obj][ELF] Don't explicitly set `Binding` with STB_*
Instead, just have 3 sub-lists, one for each of
{STB_LOCAL,STB_GLOBAL,STB_WEAK}.

This allows us to be a lot more explicit w.r.t. the symbol ordering in
the object file, because if we allowed explicitly setting the STB_*
`Binding` key for the symbol, then we might have ended up having to
shuffle STB_LOCAL symbols to the front of the list, which is likely to
cause confusion and potential for error.

Also, this new approach is simpler ;)

llvm-svn: 184506
2013-06-21 00:27:50 +00:00
Rafael Espindola 9bb9fa84df Add a fixme.
llvm-svn: 184486
2013-06-20 22:04:56 +00:00
Rafael Espindola e34d6a5fac Remove last use of PathV1.h from Archive.cpp.
llvm-svn: 184484
2013-06-20 22:02:10 +00:00
Sean Silva 05001b9f38 [yaml2obj][ELF] Add support for st_value and st_size.
After this patch, the ELF file produced by
`yaml2obj-elf-symbol-basic.yaml`, when linked and executed on x86_64
(under SysV ABI, obviously; I tested on Linux), produces a working
executable that goes into an infinite loop!

llvm-svn: 184469
2013-06-20 20:59:47 +00:00
Sean Silva 98186220be [yaml2obj][ELF] Allow symbols to reference sections.
llvm-svn: 184468
2013-06-20 20:59:41 +00:00
Sean Silva c1c290b25e [yaml2obj][ELF] Add the section name -> section index map to State.
One of the key things that the YAML format abstracts over is the use of
section numbers for referencing sections. Instead, textual section names
are used, which yaml2obj then translates into appropriate section
numbers. (Technically ELF doesn't care about section names (only section
numbers), but since this is a testing tool, readability counts).

This simplifies using section names as symbolic references in various
parts of the code. An upcoming commit will use this to allow symbols to
reference sections.

llvm-svn: 184467
2013-06-20 20:59:34 +00:00
Rafael Espindola 4a3365c869 Add a setLastModificationAndAccessTime to PathV2.
With this we can remove the last use of PathV1 from llvm-ar.cpp.

llvm-svn: 184464
2013-06-20 20:56:14 +00:00
Rafael Espindola 1941b007a2 Use a raw_fd_ostream instead of a std::ofstream.
llvm-svn: 184460
2013-06-20 19:50:39 +00:00
Meador Inge dfb08a2cb8 Remove the simplify-libcalls pass (finally)
This commit completely removes what is left of the simplify-libcalls
pass.  All of the functionality has now been migrated to the instcombine
and functionattrs passes.  The following C API functions are now NOPs:

  1. LLVMAddSimplifyLibCallsPass
  2. LLVMPassManagerBuilderSetDisableSimplifyLibCalls

llvm-svn: 184459
2013-06-20 19:48:07 +00:00
Sean Silva 08a75aef3f [yaml2obj][ELF] Start factoring into "single point of truth".
llvm-svn: 184457
2013-06-20 19:11:44 +00:00
Sean Silva bd3bc691b1 [yaml2obj][ELF] Just let this class own its buffer.
llvm-svn: 184456
2013-06-20 19:11:41 +00:00
Rafael Espindola 8a3a90bdc4 Remove a trivial use of sys::Path.
llvm-svn: 184455
2013-06-20 18:55:44 +00:00
Rafael Espindola db5d8feeea Add support for getting the last modification time from a file_status.
Use that in llvm-ar.cpp to replace a use of sys::PathWithStatus.

llvm-svn: 184450
2013-06-20 18:42:04 +00:00
Rafael Espindola b0c3cac2ed Use only the filename when deciding if a file is a duplicate.
Matches gnu ar behavior.

llvm-svn: 184448
2013-06-20 18:30:37 +00:00
Rafael Espindola 789c129a9f Add r184420 back, but also handle long file names.
Original message:

Don't include directory names in archives.

This matches the behavior of both gnu and os x versions of ar.

llvm-svn: 184423
2013-06-20 13:41:51 +00:00
Rafael Espindola 73dd376467 Revert "Don't include directory names in archives."
This reverts commit 184420.
Investigating the bot failures.

llvm-svn: 184421
2013-06-20 13:23:48 +00:00
Rafael Espindola 2a65c32094 Don't include directory names in archives.
This matches the behavior of both gnu and os x versions of ar.

llvm-svn: 184420
2013-06-20 13:16:44 +00:00
Rafael Espindola 9502b804f1 Remove remaining bits of the old LLVM specific symtab handling.
llvm-svn: 184418
2013-06-20 13:00:30 +00:00
Rafael Espindola 85ae66bf48 Remove more unused functions.
llvm-svn: 184416
2013-06-20 12:45:47 +00:00
Rafael Espindola 623c90455f Remove unused methods.
llvm-svn: 184415
2013-06-20 12:42:00 +00:00
Rafael Espindola e9df37407f Use the simpler sys::fs::exists.
llvm-svn: 184413
2013-06-20 12:04:39 +00:00
Rafael Espindola f4bd44fca3 Convert a use of sys::Path.
llvm-svn: 184412
2013-06-20 11:59:19 +00:00
David Blaikie 18e73508c4 llvm-dwarfdump: Add support for dumping the .debug_loc section
This is a basic implementation - we still don't have any support (that I
know of) for dumping DWARF expressions in a meaningful way, so the
location information itself is just printed as a sequence of bytes as we
do elsewhere.

llvm-svn: 184361
2013-06-19 21:37:13 +00:00
Rafael Espindola 8079be83f9 Remove unused function.
llvm-svn: 184359
2013-06-19 21:33:52 +00:00
Rafael Espindola 38e6b86da0 Really fix the missing header :-(
llvm-svn: 184355
2013-06-19 21:21:43 +00:00
Rafael Espindola e20437df35 Add missing include found by the bots.
llvm-svn: 184354
2013-06-19 21:20:41 +00:00
Rafael Espindola fca038907d Remove last use of PathV1.h from Archive.h
Store the individual fields we need instead of a sys::FileStatus.

llvm-svn: 184353
2013-06-19 21:13:59 +00:00
Rafael Espindola a88c119ba3 Always set the mode.
This matches GNU ar behavior. Also remove the now unused getFileStatus method.
Not sure how to add a test, it would have to run ls -l or something like that.

llvm-svn: 184337
2013-06-19 19:17:15 +00:00
Rafael Espindola 351a88f697 Remove more uses of sys::Path.
llvm-svn: 184328
2013-06-19 17:49:07 +00:00
Rafael Espindola 374f0e2a1f Remove unused function.
llvm-svn: 184320
2013-06-19 16:47:34 +00:00
Rafael Espindola b5375cd1b6 Another attempt at fixing the bots.
llvm-svn: 184318
2013-06-19 16:16:13 +00:00
Rafael Espindola 18e8cf4335 Attempt at fixing some bots.
llvm-svn: 184316
2013-06-19 15:56:53 +00:00
Rafael Espindola 8417a7883b Reduce sys::Path usage in llvm-ar.
llvm-svn: 184315
2013-06-19 15:45:37 +00:00
Rafael Espindola 3703fd0d6f Remove the 'R' modifier.
It is not present in GNU or OS X versions and doesn't make a lot of sense
for llvm-ar.

llvm-svn: 184306
2013-06-19 14:58:16 +00:00
Wan Xiaofei 16577a58e3 Test commit access.
llvm-svn: 184278
2013-06-19 02:26:00 +00:00
Sean Silva 67416d72a5 Remove `using namespace` and use explicit qualification.
There were only two places it was actually making anything shorter.

llvm-svn: 184273
2013-06-19 01:13:28 +00:00
Sean Silva b3a013a3a6 Remove spurious space.
llvm-svn: 184272
2013-06-19 01:10:58 +00:00
Sean Silva 0559d9e4d4 Remove unused parameter.
Not sure why we weren't catching this with -Wunused-parameter...

Spotted by inspection.

llvm-svn: 184271
2013-06-19 01:10:11 +00:00