1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

361 Commits

Author SHA1 Message Date
Rafael Espindola
bc0d1fb30f Fix the build in c++03 mode.
llvm-svn: 186935
2013-07-23 11:02:16 +00:00
Rafael Espindola
081f6f185f Add an initial implementation of archive symbol table generation.
The symbol table has forward references in the file. Instead of allocating
a temporary buffer or counting the size and then writing, this implementation
writes a dummy value first and patches it once the final value is known.

There is room for performance improvement. I will implement them as soon as I
get some other features (like a ranlib mode) in.

llvm-svn: 186934
2013-07-23 10:47:01 +00:00
Rafael Espindola
9cfbdad631 Replace archive members in the old position.
This matches gnu archive behavior and since archive member order can change
which member is used, not changing the order on replacement looks like the
right thing to do.

This patch also refactors the logic for which archive member to keep and
whether to move it to a helper function (computeInsertAction). The
nesting in computeNewArchiveMembers was getting a bit confusing.

llvm-svn: 186829
2013-07-22 15:11:51 +00:00
Rafael Espindola
c2acfa8f64 Handle replacement into a position past the original member.
We were incorrectly computing where to insert a member if it was replacing
a previous member that was before the insert point.

llvm-svn: 186792
2013-07-21 12:58:07 +00:00
Rafael Espindola
e054c779bd Fix inserting new elements in a specified location.
We were only handling the 'a' and 'b' options during moves before.

llvm-svn: 186721
2013-07-19 21:23:28 +00:00
NAKAMURA Takumi
d1d48ff2e9 llvm-ar: doExtract(): Write extracted files with F_Binary. It should fix llvm/test/Object/extract.ll
llvm-svn: 186503
2013-07-17 12:31:50 +00:00
Rafael Espindola
2a9326a78f Add a wrapper for open.
This centralizes the handling of O_BINARY and opens the way for hiding more
differences (like how open behaves with directories).

llvm-svn: 186447
2013-07-16 19:44:17 +00:00
Rafael Espindola
77c12b390e On error, close the temporary file descriptor.
With this change llvm-ar can remove the temporary file on windows too.

llvm-svn: 186423
2013-07-16 16:00:32 +00:00
Rafael Espindola
24973f2b99 Use open+fstat instead of stat+open.
llvm-svn: 186381
2013-07-16 03:34:31 +00:00
Rafael Espindola
25c838d63e Remember that we have a null terminated string.
This is a micro optimization. Instead of going char*->StringRef->Twine->char*,
go char*->Twine->char* and avoid having to copy the filename on the stack.

llvm-svn: 186380
2013-07-16 03:30:10 +00:00
Rafael Espindola
5910a296f4 Try to open the file before use data from stat.
Looks like on mingw we get bogus last modification times on directories.
Should fix the mingw bots.

llvm-svn: 186240
2013-07-13 05:07:22 +00:00
Rafael Espindola
a4d4dfc5bc Remove unused file. Thanks to Sean Silva for noticing it.
llvm-svn: 186239
2013-07-13 04:24:33 +00:00
Rafael Espindola
9e9a37033b Add r186216 back, but make the test tolerant of different uids and gids.
original message:
Fix a off by one error about which members need to use the string table.

llvm-svn: 186238
2013-07-13 04:14:13 +00:00
Chandler Carruth
40918c60f8 Revert commit r186216 -- it's breaking bots:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/6897/steps/check-all/logs/LLVM%3A%3Aarchive-format.test

Original commit log:
  Fix a off by one error about which members need to use the string
  table.

llvm-svn: 186232
2013-07-13 00:42:56 +00:00
Rafael Espindola
d955e6ac00 Fix a off by one error about which members need to use the string table.
llvm-svn: 186216
2013-07-12 22:22:34 +00:00
Rafael Espindola
73b6b97cfa fix autoconf build
llvm-svn: 186200
2013-07-12 20:45:01 +00:00
Rafael Espindola
d64177a6d0 Fix the build with c++03.
llvm-svn: 186198
2013-07-12 20:28:02 +00:00
Rafael Espindola
6c3ac6c001 Change llvm-ar to use lib/Object.
This fixes two bugs is lib/Object that the use in llvm-ar found:
* In OS X created archives, the name can be padded with nulls. Strip them.
* In the constructor, remember the first non special member and use that in
  begin_children. This makes sure we skip all special members, not just the
  first one.

The change to llvm-ar itself consist of
* Using lib/Object for reading archives instead of ArchiveReader.cpp.
* Writing the modified archive directly, instead of creating an in memory
  representation.

The old Archive library was way more general than what is needed, as can
be seen by the diffstat of this patch.

Having llvm-ar using lib/Object now opens the way for creating regular symbol
tables for both native objects and bitcode files so that we can use those
archives for LTO.

llvm-svn: 186197
2013-07-12 20:21:39 +00:00
Rafael Espindola
4de1314777 Add static.
llvm-svn: 186170
2013-07-12 16:29:27 +00:00
Benjamin Kramer
eb6c2372ed llvm-ar: Clean up memory management with OwningPtr.
llvm-svn: 186131
2013-07-11 23:15:05 +00:00
Rafael Espindola
e803be2a6b 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
ee3ac4e4ae InsertBefore is the same as AddBefore. Delete it.
llvm-svn: 186094
2013-07-11 15:54:53 +00:00
Rafael Espindola
f1b5484cf9 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
5033dd7f7f 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
0cf59a462a Delete dead code.
llvm-svn: 186079
2013-07-11 12:54:11 +00:00
Rafael Espindola
6654d0be49 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
d80d5d52ec Sync llvm-ar's help string with the options it supports.
llvm-svn: 186076
2013-07-11 12:28:36 +00:00
Rafael Espindola
80b3c47cc6 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
Manuel Klimek
1741a5940a Fixes problem when calling llvm-ar from an unmodifiable directory.
This fixes a regression introduced by r185726: the new call to get
a unique file does not prepend the system temporary directory, so
we need to anchor on the file that the temporary file gets moved
to to ensure we're on the same file system.

llvm-svn: 185825
2013-07-08 14:44:57 +00:00
Michael Gottesman
762cf5cbf5 [llvm-ar] Added llvm_unreachable to quiet -Wreturn-type warnings.
llvm-svn: 185751
2013-07-06 02:39:51 +00:00
Rafael Espindola
66da97e093 Add a createUniqueFile function and switch llvm's users of unique_file.
This function is complementary to createTemporaryFile. It handles the case were
the unique file is *not* temporary: we will rename it in the end. Since we
will rename it, the file has to be in the same filesystem as the final
destination and we don't prepend the system temporary directory.

This has a small semantic difference from unique_file: the default mode is 0666.
This matches the behavior of most unix tools. For example, with this change
lld now produces files with the same permissions as ld. I will add a test
of this change when I port clang over to createUniqueFile (next commit).

llvm-svn: 185726
2013-07-05 21:01:08 +00:00
Rafael Espindola
92517e5f29 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
0763c1ac2e Use simpler version of exists.
llvm-svn: 185695
2013-07-05 12:44:49 +00:00
Rafael Espindola
3e3580708f 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
fdd1dfd455 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
86155d2520 Use enums instead of raw octal values.
Patch by 罗勇刚(Yonggang Luo).

llvm-svn: 184971
2013-06-26 17:28:04 +00:00
Rafael Espindola
efb69d1b35 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
Rafael Espindola
38fb6cd662 Convert some uses of PathV1.h in ArchiveWriter.cpp.
llvm-svn: 184599
2013-06-21 22:11:36 +00:00
Rafael Espindola
9c56a2e602 Add a fixme.
llvm-svn: 184486
2013-06-20 22:04:56 +00:00
Rafael Espindola
9636a2717e Remove last use of PathV1.h from Archive.cpp.
llvm-svn: 184484
2013-06-20 22:02:10 +00:00
Rafael Espindola
695308b067 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
8daed8070b Use a raw_fd_ostream instead of a std::ofstream.
llvm-svn: 184460
2013-06-20 19:50:39 +00:00
Rafael Espindola
61a1d241a1 Remove a trivial use of sys::Path.
llvm-svn: 184455
2013-06-20 18:55:44 +00:00
Rafael Espindola
ffbd9ee39f 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
f1ead5434a 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
57dc6d35a3 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
e6a5ece5c5 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
aebd457c8d 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
0d52e64b86 Remove remaining bits of the old LLVM specific symtab handling.
llvm-svn: 184418
2013-06-20 13:00:30 +00:00
Rafael Espindola
293a58d01c Remove more unused functions.
llvm-svn: 184416
2013-06-20 12:45:47 +00:00
Rafael Espindola
734706c20b Remove unused methods.
llvm-svn: 184415
2013-06-20 12:42:00 +00:00
Rafael Espindola
b974bbf1d3 Use the simpler sys::fs::exists.
llvm-svn: 184413
2013-06-20 12:04:39 +00:00
Rafael Espindola
6c06452df3 Convert a use of sys::Path.
llvm-svn: 184412
2013-06-20 11:59:19 +00:00
Rafael Espindola
80c176d465 Remove unused function.
llvm-svn: 184359
2013-06-19 21:33:52 +00:00
Rafael Espindola
0449fdea82 Really fix the missing header :-(
llvm-svn: 184355
2013-06-19 21:21:43 +00:00
Rafael Espindola
73c8999f27 Add missing include found by the bots.
llvm-svn: 184354
2013-06-19 21:20:41 +00:00
Rafael Espindola
a7d761d107 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
360f929145 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
9cf9cbd80e Remove more uses of sys::Path.
llvm-svn: 184328
2013-06-19 17:49:07 +00:00
Rafael Espindola
7aa228a8e4 Remove unused function.
llvm-svn: 184320
2013-06-19 16:47:34 +00:00
Rafael Espindola
ad605fef8b Another attempt at fixing the bots.
llvm-svn: 184318
2013-06-19 16:16:13 +00:00
Rafael Espindola
8c2d4ffc5c Attempt at fixing some bots.
llvm-svn: 184316
2013-06-19 15:56:53 +00:00
Rafael Espindola
a05f991a23 Reduce sys::Path usage in llvm-ar.
llvm-svn: 184315
2013-06-19 15:45:37 +00:00
Rafael Espindola
39374be683 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
845bfd3735 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
daa7f712a2 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
4c1f3c24db 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
800daa7d3d 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
0883439b39 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
8a1cdcb7fc 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
Daniel Dunbar
30d6a45140 LLVMBuild: Remove trailing newline, which irked me.
llvm-svn: 146409
2011-12-12 19:48:00 +00:00
Daniel Dunbar
efa02a0c3d LLVMBuild: Add description files for the LLVM tools.
llvm-svn: 144417
2011-11-11 22:59:39 +00:00
Daniel Dunbar
81780d9982 build: Tidy up a bunch of tool Makefiles, and simplify where possible using the
new all-targets pseudo-component.

llvm-svn: 142401
2011-10-18 19:27:24 +00:00
Daniel Dunbar
2299fff72b llvm-ar: Remove local test target, this is no longer useful.
llvm-svn: 142400
2011-10-18 19:27:10 +00:00
Michael J. Spencer
bc362451c7 Fix Whitespace.
llvm-svn: 123152
2011-01-10 02:34:40 +00:00
Michael J. Spencer
917b043a16 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
8ada6f4b62 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
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Michael J. Spencer
90f807fda5 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

llvm-svn: 113819
2010-09-13 23:59:48 +00:00
Michael J. Spencer
98ad3f2ea7 CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
llvm-svn: 113632
2010-09-10 21:14:25 +00:00
Chris Lattner
5a57121631 make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
llvm-svn: 94378
2010-01-24 20:43:08 +00:00
Chris Lattner
276811b58a Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.

llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Chris Lattner
0c7ea3d3cc remove the last *stream> #include from a public header.
llvm-svn: 79892
2009-08-24 04:14:03 +00:00
Chris Lattner
3203639c35 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
5c64fb5a80 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
60dce4c56b Use errs() instead of std::cerr.
llvm-svn: 75791
2009-07-15 16:35:29 +00:00
Owen Anderson
cf112e59c3 Hold the LLVMContext by reference rather than by pointer.
llvm-svn: 74640
2009-07-01 21:22:36 +00:00
Owen Anderson
81b8dabb53 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
1b05680d5f 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
4869ed1aa7 disable exports from a bunch more tools, those without plugins.
llvm-svn: 65558
2009-02-26 19:01:11 +00:00
Chris Lattner
a74fb94d27 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
Oscar Fuentes
0f25988689 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Andrew Lenharth
497a43290e Make llvm-ar behave like ar, if you create an empty archive, ar creates an empty archive. llvm-ar would not generate an output file in this case
llvm-svn: 47733
2008-02-28 22:24:48 +00:00
Chris Lattner
309aeb140b remove attributions from tools.
llvm-svn: 45421
2007-12-29 20:44:31 +00:00
Chris Lattner
11718ad357 remove attributions from tools/utils makefiles.
llvm-svn: 45414
2007-12-29 20:07:17 +00:00
Seo Sanghyeon
28edc56597 Actually parse q operation in llvm-ar
llvm-svn: 45353
2007-12-25 13:53:47 +00:00
Dan Gohman
917b7e74aa Fix a typo in a comment.
llvm-svn: 43016
2007-10-15 21:10:03 +00:00
Dan Gohman
2e8245a376 Move the space in overview output for commands out of each of the
commands and into the common code.

llvm-svn: 42752
2007-10-08 15:45:12 +00:00
Gabor Greif
f5e225a756 eliminate residual cruft related to recognizing bytecode
files.
bitcode files are the only LLVM format left.

llvm-svn: 37945
2007-07-06 13:38:17 +00:00
Gabor Greif
5f705671e4 Here is the bulk of the sanitizing.
Almost all occurrences of "bytecode" in the sources have been eliminated.

llvm-svn: 37913
2007-07-05 17:07:56 +00:00
Chris Lattner
5947ecbfbf switch tools to bitcode instead of bytecode
llvm-svn: 36868
2007-05-06 09:29:57 +00:00
Chris Lattner
bfe6f01d65 this doesn't directly depend on bytecode
llvm-svn: 36854
2007-05-06 05:58:00 +00:00
Reid Spencer
2d2f6992e7 Don't rely on destructed local storage. Thanks, Chris.
llvm-svn: 35769
2007-04-08 19:59:07 +00:00
Reid Spencer
875a2bc4db For PR1291:
Change uses of sys::Path class to sys::PathWithStatus in those places where
the file status information is needed.

llvm-svn: 35743
2007-04-07 18:53:16 +00:00
Reid Spencer
4269ae1274 For PR789:
Make the sys::Path::getFileStatus function more efficient by having it
return a pointer to the FileStatus structure rather than copy it. Adjust
uses of the function accordingly. Also, fix some memory issues in sys::Path.

llvm-svn: 35476
2007-03-29 19:05:44 +00:00
Jeff Cohen
1992768a84 getFileStatus has a new parameter (caught by VC++).
llvm-svn: 35466
2007-03-29 17:29:59 +00:00
Chris Lattner
41c5ddb8cb make all llvm tools call llvm_shutdown when they exit, static'ify some stuff.
With this change, I can now move -stats to print when llvm_shutdown is called.

llvm-svn: 32250
2006-12-06 01:18:01 +00:00
Reid Spencer
4bafa71dc1 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.

llvm-svn: 31380
2006-11-02 20:25:50 +00:00
Chris Lattner
2da81d7d76 Use LINK_COMPONENTS to specify *components* to link against instead of
using USED_LIBS to specify *libraries* to link against.

llvm-svn: 30090
2006-09-04 05:59:09 +00:00
Reid Spencer
ebf083391f Fix a bug caused by change in the interface of Archive::writeToDisk.
llvm-svn: 29869
2006-08-25 05:28:17 +00:00
Reid Spencer
d813eae003 For PR797:
Remove exception handling from the bytecode archiver and adjust the llvm-ar
tool to accommodate the new interfaces.

llvm-svn: 29866
2006-08-24 23:45:08 +00:00
Reid Spencer
0bc83e3c5e For PR797:
Remove exception throwing from Path::getDirectoryContents and its users.

llvm-svn: 29841
2006-08-23 06:56:27 +00:00
Reid Spencer
baf54399e7 For PR797:
Remove exceptions from the Path::create*OnDisk methods. Update their users
to handle error messages via arguments and result codes.

llvm-svn: 29840
2006-08-23 00:39:35 +00:00
Chris Lattner
09840d9731 Use Path::getFileStatus
llvm-svn: 29445
2006-08-01 18:09:46 +00:00
Chris Lattner
f4c7ceebaf Change Path::getStatusInfo to return a boolean and error string on an error
instead of throwing an exception.  This reduces the amount of code that is
exposed to exceptions (e.g. FileUtilities), though it is clearly only one step
along the way.

llvm-svn: 29395
2006-07-28 22:03:44 +00:00
Reid Spencer
9f4deeabf4 Remove EH use from the Archive library and adjust its users accordingly.
llvm-svn: 29066
2006-07-07 19:09:14 +00:00
Chris Lattner
9f5a13c5c0 Tools require EH for their top-level try blocks.
llvm-svn: 29035
2006-07-07 00:46:19 +00:00
Reid Spencer
94a443bb29 Use archive libraries instead of object files for VMCore, BCReader,
BCWriter, and bzip2 libraries. Adjust the various makefiles to accommodate
these changes. This was done to speed up link times.

llvm-svn: 28610
2006-06-01 01:30:27 +00:00
Chris Lattner
f604017e47 Patches to make the LLVM sources more -pedantic clean. Patch provided
by Anton Korobeynikov!  This is a step towards closing PR786.

llvm-svn: 28447
2006-05-24 17:04:05 +00:00
Duraid Madina
92f1927bff more compliance stufff
llvm-svn: 25037
2005-12-28 06:56:09 +00:00
Reid Spencer
04d734c2f6 Final Changes For PR495:
This chagne just renames some sys::Path methods to ensure they are not
misused. The Path documentation now divides methods into two dimensions:
Path/Disk and accessor/mutator. Path accessors and mutators only operate
on the Path object itself without making any disk accesses. Disk accessors
and mutators will also access or modify the file system. Because of the
potentially destructive nature of disk mutators, it was decided that all
such methods should end in the work "Disk" to ensure the user recognizes
that the change will occur on the file system. This patch makes that
change. The method name changes are:

makeReadable        -> makeReadableOnDisk
makeWriteable       -> makeWriteableOnDisk
makeExecutable      -> makeExecutableOnDisk
setStatusInfo       -> setStatusInfoOnDisk
createDirectory     -> createDirectoryOnDisk
createFile          -> createFileOnDisk
createTemporaryFile -> createTemporaryFileOnDisk
destroy             -> eraseFromDisk
rename              -> renamePathOnDisk

These changes pass the Linux Deja Gnu tests.

llvm-svn: 22354
2005-07-08 03:08:58 +00:00
Reid Spencer
5534b2d505 For PR495:
Get rid of the difference between file paths and directory paths. The Path
class now simply stores a path that can refer to either a file or a
directory. This required various changes in the implementation and interface
of the class with the corresponding impact to its users. Doxygen comments were
also updated to reflect these changes. Interface changes are:

appendDirectory -> appendComponent
appendFile -> appendComponent
elideDirectory -> eraseComponent
elideFile -> eraseComponent
elideSuffix -> eraseSuffix
renameFile -> rename
setDirectory -> set
setFile -> set

Changes pass Dejagnu and llvm-test/SingleSource tests.

llvm-svn: 22349
2005-07-07 23:21:43 +00:00
Reid Spencer
dc6de29edc Make sure that tool names don't have any leading or trailing spaces in them.
If they do, it screws up the concatenation of the .exe suffix on cygwin.

llvm-svn: 22141
2005-05-19 21:03:11 +00:00
Misha Brukman
960a8d47d7 Remove trailing whitespace
llvm-svn: 21428
2005-04-22 00:00:37 +00:00
Jeff Cohen
7311de2af2 Use binary mode for reading/writing bytecode files
llvm-svn: 19751
2005-01-22 17:36:17 +00:00
Reid Spencer
01430a34a4 Unbreak all archive reading operations introduced by the last patch which
always exited the program with exit code 1 in these cases, regardless of
whether an error occurred or not.

llvm-svn: 18966
2004-12-15 21:58:03 +00:00
Chris Lattner
5c60a89777 Do not fail an assertion on a broken archive
llvm-svn: 18959
2004-12-15 07:44:15 +00:00
Reid Spencer
6ccc7d8dab For PR351:
Remove #inclusion of Support/FileUtilities.h which isn't needed any more.

llvm-svn: 18950
2004-12-15 01:53:50 +00:00
Reid Spencer
e2af9dc813 Path::get -> Path::toString
llvm-svn: 18785
2004-12-11 00:14:15 +00:00
Reid Spencer
410c07a4b0 Implement file replacement correctly even with the f (TruncateNames) flag
set. The member name comparison was failing for truncated names. This patch
fixes that. Truncated names are now properly replaced.

llvm-svn: 18423
2004-12-02 09:21:55 +00:00
Reid Spencer
307abddd22 Make the check a little quieter.
llvm-svn: 18325
2004-11-29 04:51:58 +00:00
Reid Spencer
b79950be4d Add LLVMbzip2 library, now required.
llvm-svn: 18255
2004-11-25 20:22:06 +00:00
Reid Spencer
d6c3dcc8dc The Archive class now has differentiation for BSD4.4 and SVR4 style archive
symbol tables. Adjust our usage to compensate.

llvm-svn: 18046
2004-11-20 18:01:22 +00:00
Reid Spencer
c7d6bdb196 Per code review: \
* hide the compatibility option \
* Make static things static \
* Use cl::extrahelp instead of cl::MoreHelp (defunct) \
* Use cl::PrintHelpMessage instead of our own printUse function \
* Use a std::set<sys::Path> for the path list because its now required by \
  the sys::Path class and also ensues directories are traversed in sorted \
  order.\
* Implement symbol table printing locally instead of in libLLVMArchive \
* Adjust to changes in llvm::Archive interface \
* Make sure we destruct objects even if exceptions occur. \
* Fix a typo in an output string.

llvm-svn: 17877
2004-11-16 06:41:09 +00:00
Tanya Lattner
c92390c9a9 This file was originally developed by the LLVM research group so this comment should stay. I also do NOT want my name explicity listed on src files. I am already mentioned in the credits.
llvm-svn: 17833
2004-11-15 19:21:49 +00:00
Reid Spencer
94fa3a24c4 Correct call of methods whose names have changed.
llvm-svn: 17803
2004-11-14 23:17:41 +00:00
Reid Spencer
a58ac8264a Total rewrite using Archive library & new functionality
llvm-svn: 17790
2004-11-14 22:20:07 +00:00
Reid Spencer
39740ecd0e This tool needs the libLLVMArchive library now.
llvm-svn: 17789
2004-11-14 22:19:21 +00:00
Reid Spencer
d3f7233495 Change Library Names Not To Conflict With Others When Installed
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Reid Spencer
5574857063 We're not doing automake any more
llvm-svn: 17168
2004-10-22 21:02:23 +00:00
Reid Spencer
e48ba34fd4 We won't use automake
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer
ce514b1c2c Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Reid Spencer
e6418ec30f Update to reflect changes in Makefile rules.
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Reid Spencer
817a069ea4 Initial version of automake Makefile.am file.
llvm-svn: 16894
2004-10-10 22:36:40 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Reid Spencer
e044a2172e Add the LLVMsystem.a library as it is now used for operating system
independence of the tool.

llvm-svn: 16092
2004-08-29 19:29:38 +00:00
Reid Spencer
8cb2484800 The functions in Signal.h are now in the llvm::sys namespace - adjust
llvm-svn: 16091
2004-08-29 19:28:55 +00:00
Reid Spencer
6d8b0985d1 Add #include <iostream> since Value.h does not include it any more.
llvm-svn: 14623
2004-07-04 12:20:55 +00:00
Chris Lattner
6f0bab5b9d Header file moved
llvm-svn: 13813
2004-05-27 05:41:36 +00:00
Chris Lattner
f8c22e360b Make sure to print a stack trace whenever an error signal is delivered to the
tool.

llvm-svn: 11632
2004-02-19 20:32:12 +00:00
Chris Lattner
ba378df132 Use new getFileSize function. Eliminate some using directives. Reorder #includes a bit
llvm-svn: 10651
2003-12-30 07:45:46 +00:00
Tanya Lattner
0499e53fe5 New command line parsing. This isn't as perfect as I would have liked. The CommandLine Library needs to be extended, in order to parse the options and allow for optional dashes. In addition, the help option isn't correct since I do the parsing mostly myself. But this is in the ocorrect ar format.
llvm-svn: 10297
2003-12-06 23:01:25 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
a8dfda0513 Added LLVM copyright to Makefiles.
llvm-svn: 9314
2003-10-20 22:29:16 +00:00
John Criswell
569fd0bb5c Removed extraneous comment line.
llvm-svn: 9308
2003-10-20 20:40:30 +00:00
John Criswell
d06dc1136b Added copyright header to all C++ source files.
llvm-svn: 9291
2003-10-20 17:47:21 +00:00
Brian Gaeke
edc3b79945 Rewrite head-of-file comment.
Include <cstdio> instead of <stdio.h>.

llvm-svn: 9033
2003-10-10 18:47:08 +00:00
Misha Brukman
868eac95dd Fix spelling.
llvm-svn: 9027
2003-10-10 17:57:28 +00:00
Misha Brukman
29af701f5b Squelch warning and delete extra space.
llvm-svn: 8685
2003-09-23 17:27:02 +00:00
Tanya Lattner
6744cea856 Fixed warning.
llvm-svn: 8505
2003-09-13 03:18:56 +00:00
Tanya Lattner
0438742d12 First version of llvm-ar added to cvs repository.
llvm-svn: 8173
2003-08-28 15:22:38 +00:00