Commit Graph

102 Commits

Author SHA1 Message Date
Rafael Espindola 0557153138 Add static.
llvm-svn: 186170
2013-07-12 16:29:27 +00:00
Rafael Espindola ed0f6468b8 Use %llu to print a 64 bit number. Should fix the ARM bots.
llvm-svn: 186113
2013-07-11 20:01:30 +00:00
Rafael Espindola ce2c84e670 InsertBefore is the same as AddBefore. Delete it.
llvm-svn: 186094
2013-07-11 15:54:53 +00:00
Rafael Espindola b1c1c5f377 Fix a FIXME about the format and add a test.
While at it, use strftime on Unix too and use the thread safe versions
of localtime.

llvm-svn: 186090
2013-07-11 15:35:23 +00:00
Rafael Espindola b1d026890a Remove the 'N' modifier from llvm-ar.
* It is not present on OS X.
* It is untested.
* It is not needed for using ar in a build system.

llvm-svn: 186080
2013-07-11 13:03:27 +00:00
Rafael Espindola e132160e7e Delete dead code.
llvm-svn: 186079
2013-07-11 12:54:11 +00:00
Rafael Espindola 4d7b3be00b Remove support for truncating names in archives.
* All systems we support have some form of long name support.
* The options has different names and semantics in different implementations
  ('f' on gnu, 'T' on OS X), which makes it unlikely it is normally used on
  build systems.
* It was completely untested.

llvm-svn: 186078
2013-07-11 12:38:02 +00:00
Rafael Espindola 69278e9ac8 Sync llvm-ar's help string with the options it supports.
llvm-svn: 186076
2013-07-11 12:28:36 +00:00
Rafael Espindola bb625bb2f4 Create files with the correct permission instead of changing it afterwards.
No intended functionality change.

llvm-svn: 185832
2013-07-08 16:16:51 +00:00
Michael Gottesman 11dd1d04ca [llvm-ar] Added llvm_unreachable to quiet -Wreturn-type warnings.
llvm-svn: 185751
2013-07-06 02:39:51 +00:00
Rafael Espindola 8ef843fc72 Don't create an archive if, for example, we are asked to print the index.
llvm-svn: 185697
2013-07-05 13:03:07 +00:00
Rafael Espindola 0910ff2cb9 Use simpler version of exists.
llvm-svn: 185695
2013-07-05 12:44:49 +00:00
Rafael Espindola 544615f893 Remove NoOperation.
parseCommandLine prints and error and exists if no operation is specified, so
it never returns NoOperation.

llvm-svn: 185691
2013-07-05 12:12:43 +00:00
Rafael Espindola 46312e8e72 Don't treat bitcode files specially in llvm-ar.
We really want bitcode files to behave as regular object files in archives, so
we don't need to track that a member is bitcode.

llvm-svn: 185681
2013-07-05 04:19:32 +00:00
Rafael Espindola 9bb9fa84df Add a fixme.
llvm-svn: 184486
2013-06-20 22:04:56 +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
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 f4bd44fca3 Convert a use of sys::Path.
llvm-svn: 184412
2013-06-20 11:59:19 +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 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
Rafael Espindola ac5c1b0d68 Move lib/Archive to tools/llvm-ar.
llvm-ar is the only tool that needs to write archive files. Every other tool
should be able to use the lib/Object interface.

llvm-svn: 184083
2013-06-17 15:47:20 +00:00
Rafael Espindola 668c642830 Remove the LLVM specific archive index.
Archive files (.a) can have a symbol table indicating which object
files in them define which symbols. The purpose of this symbol table
is to speed up linking by allowing the linker the read only the .o
files it is actually going to use instead of having to parse every
object's symbol table.

LLVM's archive library currently supports a LLVM specific format for
such table. It is hard to see any value in that now that llvm-ld is
gone:

* System linkers don't use it: GNU ar uses the same plugin as the
linker to create archive files with a regular index. The OS X ar
creates no symbol table for IL files, I assume the linker just parses
all IL files.

* It doesn't interact well with archives having both IL and native objects.

* We probably don't want to be responsible for yet another archive
format variant.

This patch then:

* Removes support for creating and reading such index from lib/Archive.
* Remove llvm-ranlib, since there is nothing left for it to do.

We should in the future add support for regular indexes to llvm-ar for
both native and IL objects. When we do that, llvm-ranlib should be
reimplemented as a symlink to llvm-ar, as it is equivalent to "ar s".

llvm-svn: 184019
2013-06-14 23:25:53 +00:00
Chandler Carruth 9fb823bbd4 Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

llvm-svn: 171366
2013-01-02 11:36:10 +00:00
Chandler Carruth 4d88a1c233 Sort the #include lines for tools/...
Again, tools are trickier to pick the main module header for than
library source files. I've started to follow the pattern of using
LLVMContext.h when it is included as a stub for program source files.

llvm-svn: 169252
2012-12-04 10:44:52 +00:00
Joerg Sonnenberger 4a0f7becd8 Adjust llvm-ar and llvm-ranlib to not depend on exception handling.
Always use an exit code of 1, but print the help message if useful.
Remove the exception handling tag in llvm-as, llvm-dis and
llvm-bcanalyzer, where it isn't used.

llvm-svn: 166767
2012-10-26 10:49:15 +00:00
Rafael Espindola 740a6bc8a0 Remove references to compression in llvm-ar. It has been a long time since we
switched from a bytecode+bzip2 to the current bitcode.

llvm-svn: 161651
2012-08-10 01:57:52 +00:00
Michael J. Spencer 83bd49d4f9 Fix Whitespace.
llvm-svn: 123152
2011-01-10 02:34:40 +00:00
Michael J. Spencer 58df2e00b2 Support/Path: Deprecate PathV1::exists and replace all uses with PathV2::fs::exists.
llvm-svn: 123151
2011-01-10 02:34:23 +00:00
Chris Lattner 2907f44a1b convert llvm-ar and llvm-ranlib to raw_ostream from iostreams.
Patch by Danil Malyshev!

llvm-svn: 120341
2010-11-29 23:02:20 +00:00
Michael J. Spencer 447762da85 Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Chris Lattner c143023bac remove the last *stream> #include from a public header.
llvm-svn: 79892
2009-08-24 04:14:03 +00:00
Chris Lattner c521f54198 Prune #includes from llvm/Linker.h and llvm/System/Path.h,
forcing them down into various .cpp files.

This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
   for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
   clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
   instead.
4. Weans llvm-db off <iostream>

sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.

llvm-svn: 79869
2009-08-23 22:45:37 +00:00
Owen Anderson 19251ec836 To simplify the upcoming context-on-type change, switch all command line tools to using the default global context for now.
This will let us to hardwire stuff to the global context in the short term while the API is sorted out.

llvm-svn: 75846
2009-07-15 22:16:10 +00:00
Dan Gohman d8db376071 Use errs() instead of std::cerr.
llvm-svn: 75791
2009-07-15 16:35:29 +00:00
Owen Anderson 1cf085d558 Hold the LLVMContext by reference rather than by pointer.
llvm-svn: 74640
2009-07-01 21:22:36 +00:00
Owen Anderson 6773d388aa Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools.

Patches for Clang and LLVM-GCC to follow.

llvm-svn: 74614
2009-07-01 16:58:40 +00:00
Chris Lattner e3fc2d13be Change various llvm utilities to use PrettyStackTraceProgram in
their main routines.  This makes the tools print their argc/argv
commands if they crash.

llvm-svn: 66248
2009-03-06 05:34:10 +00:00
Chris Lattner 413a0246f8 fix PR3488: llvm-ar r doesn't replace existing files
Patch by Daniel Shelton!

llvm-svn: 63870
2009-02-05 17:58:39 +00:00