Commit Graph

89 Commits

Author SHA1 Message Date
Chris Lattner
410354fe0c Make the LLVM headers "-ansi -pedantic -Wno-long-long" clean.
Patch by Martin Partel!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26313 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-22 16:23:43 +00:00
Chris Lattner
7bcd6a36e2 minor cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24528 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 05:26:03 +00:00
Reid Spencer
6ff7240a5c Fix a problem with llvm-ranlib that (on some platforms) caused the archive
file to become corrupted due to interactions between mmap'd memory segments
and file descriptors closing. The problem is completely avoiding by using
a third temporary file.

Patch provided by Evan Jones


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24527 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 05:21:10 +00:00
Misha Brukman
6b8a63ae58 Remove vim settings from source code; people should use llvm/utils/vim/vimrc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21704 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-05 22:33:09 +00:00
Misha Brukman
3b1b6e626e Convert tabs to spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21436 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-22 03:27:20 +00:00
Misha Brukman
ea61c35872 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21409 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 20:39:54 +00:00
Reid Spencer
eaa06bb979 Implement an isBytecodeArchive method to determine if an archive contains
bytecode file members or not.
Patch Contributed By Adam Treat


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20338 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-26 22:00:32 +00:00
Chris Lattner
3eb223eaf7 Improve compatibility with aCC on HPUX. Patch by Duraid Madina
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19585 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 01:22:18 +00:00
Reid Spencer
37911af8c4 Make the OpenAndLoad functions have an ErrorMessage argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18849 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 02:58:16 +00:00
Reid Spencer
9a29db43a7 Distinguish between BSD4.4 and SVR4 symbol tables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18044 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-20 07:29:40 +00:00
Reid Spencer
7783e8ad69 Make findModulesDefiningSymbols modify its symbols argument so we can \
eliminate symbols defined by the archive efficiently


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17976 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-19 03:18:22 +00:00
Reid Spencer
60f1758f7c Per code review:\
* Use STL names for STL operations \
* Do not have Archive doing symbol table printing \
* Avoid compiler warnings about only having private constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17881 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:46:55 +00:00
Reid Spencer
226b72672e Remove useless/confusing namespace qualifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17852 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 21:27:05 +00:00
Reid Spencer
766b793143 Changes necessary to enable linking of archives without LLVM symbol tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17811 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 01:20:11 +00:00
Reid Spencer
33e2fcd6f5 Remove ReadArchiveFile (functionality moved to Archive.h). Add an alternate form for GetBytecodeSymbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17755 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 21:48:27 +00:00
Reid Spencer
9461bd7996 Complete rewrite to get first working version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17754 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 21:47:41 +00:00
Misha Brukman
35c4c33879 Remove extra spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17629 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-08 19:01:03 +00:00
Reid Spencer
ad768d7a1a Make writing compressed bytecode the default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17625 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-08 17:35:34 +00:00
Reid Spencer
78d215b76d Make compression the default on writing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17577 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-07 18:18:11 +00:00
Reid Spencer
8ad8a5219c * Provide option for specifying bytecode compression
* Enabled bytecode compression by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17563 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-07 05:30:43 +00:00
Reid Spencer
17f52c5c46 Add support for compressed bytecode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17535 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-06 23:17:23 +00:00
Reid Spencer
2394fa99bd Provide an interface for getting just the external symbols from a
Bytecode file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17502 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-06 08:54:47 +00:00
Reid Spencer
c3c5521424 Deprecate constructors we don't want users to use.
Temporarily comment out two interface methods we might not implement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17501 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-06 08:53:59 +00:00
Reid Spencer
6c4d9e566f Go ahead and trust the client not to mess with the ModuleProvider* returned
by the findModuleContainingSymbol method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17491 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-05 18:48:02 +00:00
Reid Spencer
6f08c46790 * Documentation corrections (thanks to Chris for nit-picking)
* Remove dead typedefs.
* Redefine how getAllPaths treats its argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17489 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-05 17:44:26 +00:00
Reid Spencer
ab19fa7967 First version of the interface to Archive files. This introduces the
llvm::Archive class to provide for reading, writing, indexing and search
functions on standard ar(1) format files that contain bytecode modules.

Implementation to follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17487 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-05 09:19:17 +00:00
Chris Lattner
b12914bfc0 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16436 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 04:48:05 +00:00
Reid Spencer
9cab9e51bb Correct the interface of a function to use the correct typedef for an
argument so that it will always compile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16284 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-11 04:29:13 +00:00
Reid Spencer
95e4cceaff Add a function that gets just the dependent libraries from a bytecode file.
Doxygenify comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16039 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-24 22:49:07 +00:00
Reid Spencer
26642771c8 Dump the DependentLibsBlockID, its not a block, its just a list inside the
globals info block. Add an enumerator for getting the number of enumerators
so we can range check in assertions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15980 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 20:42:28 +00:00
Reid Spencer
b586c08d53 Add new methods:
- get the total number of types in the global type list
- handle dependent libraries
- handle target triple


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15978 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 20:41:12 +00:00
Reid Spencer
e6df25cbcd Bytecode Analyzer cleanup:
- don't save the "dump" output, just emit it
- record the bc version number
- record info about the dependent libraries and target triple
- use the correct enumeration as the index on the block size map


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15977 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 20:40:08 +00:00
Brian Gaeke
715c90ba52 Packed types, brought to you by Brad Jones
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15938 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-20 06:00:58 +00:00
Chris Lattner
064e9a9ef8 The Type* is redundant with the TypeSlot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15451 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 00:18:37 +00:00
Reid Spencer
7105f4ae8c bug 402:
A new set of block identifiers has been added for version 1.3 so that the
range of values can fit within 5 bits. This aids in halving the size of
block headers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15206 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 17:50:00 +00:00
Reid Spencer
d25e6cd128 Constant value not needed after CPR's disappear.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14917 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 23:23:30 +00:00
Reid Spencer
1847444e0c Make all the virtual function (except destructor) inline so there are
default implementations without taking up a ton of space in a .cpp file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14603 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:29:56 +00:00
Reid Spencer
78b763b2ad Provide support for the BytecodeHandler interface which will be called by
the bcreader if one is supplied to the bytecode reader's interface
functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14489 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:20:03 +00:00
Reid Spencer
9c1e05fe75 Fix include guard
Adjust comments
Make handlers for constants provide useful information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14488 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:18:52 +00:00
Reid Spencer
39e6af456b Adjust comments to match code.
Allow analysis to return the module created by the bcreader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14487 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:17:34 +00:00
Reid Spencer
e5c9df6880 - Changed Handler.h -> BytecodeHandler.h
- Fixed some small coding standard compliance issues in BytecodeHandler.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14393 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 02:32:27 +00:00
Chris Lattner
bc7ce7eea4 Okay, Module have not been known as 'C' for a LONG time now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14392 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 00:42:23 +00:00
Reid Spencer
a1d90eb7bf Definition of the Bytecode Handler interface. Subclasses can override just
the methods they are interested in to perform out-of-band tasks while the
BytecodeReader is constructing a module. Handlers should *not* modify any
of the LLVM IR objects during this process.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14380 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 23:05:07 +00:00
Reid Spencer
1cf5024de1 Implement tracking of bytecode instruction size and the number of long
instructions generated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14154 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 15:10:38 +00:00
Reid Spencer
38a6cfe41e Updated the BytecodeAnalysis data structure to contain additional fields
needed for analysis of individual functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14125 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 22:28:11 +00:00
Reid Spencer
00c28a7481 Implemented the bulk of the functionality. Cleaned up the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14113 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 08:09:13 +00:00
Reid Spencer
4502b37d7a Add some new fields for bytecode analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14092 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:18:53 +00:00
Misha Brukman
ef39012738 Fix case of doxygen directive `\p': it's lowercase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14068 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 13:49:17 +00:00
Reid Spencer
381022b61f Clean up documentation and make it possible for the BytecodeAnalyzer to
store the output of the bytecode dumper.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14058 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 05:55:53 +00:00
Reid Spencer
dac69c83c2 Commit For New Tool: llvm-abcd (Analysis of ByteCode Dumper). This tool
will (eventually) provide statistical analysis of bytecode files as well
as the ability to dump them in a low level format (slot numbers not
resolved). The purpose of this is to aid in the Type!=Value change of
bug 122. With this initial release, llvm-abcd merely dumps out the
bytecode. However, the infrastructure for separating bytecode parsing from
handling the parsing events is in place. The style chosen is similar to
SAX XML parsing where a handler object is called to handlign the parsing
events. This probably isn't useful to anyone but me right now as there is
no analysis yet, and the dumper doesn't work on every bytecode file. It
will probably be useful by the end of this week. Note that there is some
duplication of code from the bytecode reader.  This was done to eliminate
errors from being introduced in the reader and to minimize the impact to
other LLVM developers. At some point, the Analyzer and the Reader will be
integrated to use the same infrastructure. Also, sorry for the minor change
to Instruction.h but I just couldn't bring myself to write code that
depends on Instruction internals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14048 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-07 17:53:43 +00:00