Commit Graph

48 Commits

Author SHA1 Message Date
Reid Spencer 69e6062f31 Make TempDir a PathWithStatus so we don't have to cast it to one.
llvm-svn: 35772
2007-04-08 20:08:01 +00:00
Reid Spencer 21b76a9b99 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 200c6f9c3d 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
Anton Korobeynikov d01defedf6 Add possibility to set memory limit for binaries run via libSystem. This
is especially needed for bugpoint. This partly implements PR688

llvm-svn: 34349
2007-02-16 19:11:07 +00:00
Chris Lattner d220dc1426 move an llvmc-specific function out of the bcreader into llvmc.
llvm-svn: 34021
2007-02-07 23:48:32 +00:00
Chris Lattner a0e49f2ead push bytecode decompressor out through APIs. Now the bytecode reader
api's look like this:

ModuleProvider *getBytecodeModuleProvider(
  const std::string &Filename,  ///< Name of file to be read
  BCDecompressor_t *BCDC = Compressor::decompressToNewBuffer,
  std::string* ErrMsg = 0,      ///< Optional error message holder
  BytecodeHandler* H = 0        ///< Optional handler for reader events
);

This is ugly, but allows a client to say:

  getBytecodeModuleProvider("foo", 0);

If they do this, there is no dependency on the compression libraries, saving
codesize.

llvm-svn: 34012
2007-02-07 21:41:02 +00:00
Reid Spencer de46e48420 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
Reid Spencer f25aebf8cf For PR797:
Remove exception throwing/handling from lib/Bytecode, and adjust its users
to compensate for changes in the interface.

llvm-svn: 29875
2006-08-25 17:43:11 +00:00
Reid Spencer 6ba87bbfd3 Make the sys::Path::GetTemporaryDirectory method not throw exceptions and
adjust users of it to compensate.

llvm-svn: 29831
2006-08-22 19:01:30 +00:00
Reid Spencer 944645af44 For PR797:
Adjust usage of the ExecuteAndWait function to use the last argument which
is the ErrMsg string. This is necessitated because this function no longer
throws exceptions on error.

llvm-svn: 29791
2006-08-21 06:04:45 +00:00
Reid Spencer 4e41aaf805 Patches to correct several bugs in llvmc.
Patches contributed by Bram Adams. Thanks Bram.

llvm-svn: 29729
2006-08-16 20:31:44 +00:00
Chris Lattner ec905190bf No need to check isWriteable here (which isn't sufficient anyway). Just attempt
to do the operation and if it fails, oh well.

llvm-svn: 29446
2006-08-01 18:12:29 +00:00
Chris Lattner dc0b3afcdd silly cleanup
llvm-svn: 28543
2006-05-29 18:52:05 +00:00
Jeff Cohen 5f4ef3c5a8 Eliminate all remaining tabs and trailing spaces.
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Reid Spencer af48d8643d 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 c9c0473fa5 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 5b891e9847 For PR495:
Change interface to Path class:
readable -> canRead
writable -> canWrite
executable -> canExecute

More (incremental) changes coming to close 495.

llvm-svn: 22345
2005-07-07 18:21:42 +00:00
Reid Spencer e9bee08f1d For PR514:
* language specification files are no longer configured with "configure"
* add substitutions for %bindir%, %libdir%, and various llvmgcc related
  variables needed in the c and cpp spec files.
* Implement the stubstituions in the Compiler Driver.
* Move st.in to projects/Stacker/tools/stkrc where it belongs.

llvm-svn: 22128
2005-05-19 00:52:28 +00:00
Misha Brukman 23e9f163ad Minor clean-ups
llvm-svn: 21678
2005-05-03 20:30:34 +00:00
Misha Brukman 650ba8eb56 Remove trailing whitespace
llvm-svn: 21428
2005-04-22 00:00:37 +00:00
Misha Brukman ee6770f1a3 #include system headers after all LLVM headers
llvm-svn: 21374
2005-04-20 04:51:29 +00:00
Reid Spencer 7a763bfbc5 Ensure that the arguments passed to sys::Program::ExecuteAndWait include
the program name as the first argument. Thanks go to Markus Oberhumer for
noticing this problem.

llvm-svn: 21220
2005-04-11 05:48:04 +00:00
Chris Lattner 9db0eccc42 Conform to the documented interface by null terminating argument lists!
llvm-svn: 20167
2005-02-13 23:10:45 +00:00
Brian Gaeke fe4e48e14b Use Config/alloca.h instead of alloca.h - pointed out by Duraid and Misha
llvm-svn: 19059
2004-12-20 04:02:01 +00:00
Brian Gaeke cb1b1e74eb Make this compile on Solaris.
llvm-svn: 19047
2004-12-19 21:08:07 +00:00
Reid Spencer 766ad0b77f For PR351:
* Support changes in sys::Program::ExecuteAndWait interface

llvm-svn: 19044
2004-12-19 18:00:56 +00:00
Reid Spencer ff17d0439d Make use of the new Path inserter function.
llvm-svn: 18887
2004-12-13 08:53:36 +00:00
Reid Spencer 17e7444a61 PR351: \
Use sys::Path not FileUtilities to check file types

llvm-svn: 18865
2004-12-13 03:01:26 +00:00
Reid Spencer 5ccfd5a48b Path::get -> Path::toString
llvm-svn: 18785
2004-12-11 00:14:15 +00:00
Reid Spencer cd893a9c50 * Don't pass empty arguments to ExecuteAndWait because it can cause the
sub-tool to start reading its standard input instead of the specified
  input.
* Clean up ouput of path names on error.
* Extend GetPathForLinkageItem to always search the LibraryPaths and thus
  make it suitable for an interface function (required by llvmc.cpp).
* Implement support for language-specific default library paths.

llvm-svn: 18188
2004-11-23 23:45:49 +00:00
Reid Spencer 835060938c Get the -o option right
llvm-svn: 18051
2004-11-20 20:39:33 +00:00
Reid Spencer 0c6a283b2a Stop propagating method names that violate the coding standard
llvm-svn: 17498
2004-11-05 22:15:36 +00:00
Reid Spencer aec50b98e0 Implement linking.
llvm-svn: 17297
2004-10-28 04:05:06 +00:00
Reid Spencer 4de872f623 Support the -WX, -f -M options as pass throughs
Change force option from -f to -F
Support the -strip option
Make changes to reflect different interface in sys::Program

llvm-svn: 16325
2004-09-14 01:58:45 +00:00
Reid Spencer 7c16caa336 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 a681845e69 Implement the "setIncludePaths" and "setSymbolDefines" interface methods.
Revise token substitution to be a little faster.
Clean up exception throwing, make sure its always a std::string.

llvm-svn: 16116
2004-08-30 06:29:06 +00:00
Reid Spencer a62e5a837f Add a missing header file
llvm-svn: 16099
2004-08-29 20:02:28 +00:00
Reid Spencer 1b5b24f9fb Convert llvmc to use the lib/System interface instead of directly
using Unix operating system calls.

llvm-svn: 16089
2004-08-29 19:26:56 +00:00
Reid Spencer 7a0348b163 Run the compilation actions before we attempt linking work.
Correctly implement the dependent libraries feature so that linked bytecode
files automatically include any dependent libraries they specify.

llvm-svn: 16042
2004-08-24 22:54:32 +00:00
Reid Spencer f62f89b3eb - Remove unused GetSuffix function
- Renamed FileReadable -> FileIsReadable
- Remove support for GROKS_DASH_O; deferr it to %opts% substitution
- Require a -o option except in case of linking where it defaults to a.out
- Fix problem processing *.o and *.bc files.
- Ignore optimization phase if -emit-raw-code
- Correct the assembly generation phase to support -emit-native-code
- Implement dependent library lookup

llvm-svn: 16020
2004-08-24 13:55:17 +00:00
Reid Spencer 7f9971f349 Change @ -> % in config files. @name@ might be needed for config files to
themselves be configured via autoconf so its not a good substitition syntax
for llvmc. Furthermore % is more llvmish :)

llvm-svn: 15957
2004-08-20 22:53:11 +00:00
Reid Spencer fab530daf2 Implement Assembly support.
Consolidate platform-specific code into "sys" namespace.

llvm-svn: 15947
2004-08-20 09:14:05 +00:00
Reid Spencer dc20389b5c Implement many new features for llvmc. This is the first version that will
actually execute actions and it is been shown to optimize a Stacker program

llvm-svn: 15912
2004-08-19 04:49:47 +00:00
Reid Spencer 263bbbd2df Back out dependencies on lib/System/Path.h
llvm-svn: 15815
2004-08-16 07:06:38 +00:00
Reid Spencer f58e8d3d0c More Functionality:
- cleaned up lexical scanner
- added support for "lang.optN" configuration items
- added temporary file support (ala lib/System)
- corrected logic for deciding which phases to run
- consolidated the Action and ActionPattern classes

llvm-svn: 15765
2004-08-15 08:19:46 +00:00
Reid Spencer 9d68ff6ef0 Converted to use flex for tokenizing input so we can use an easier to
understand recursive descent parser, we can easily handle more syntax
variety, and we can more easily change the configuration items accepted.

llvm-svn: 15732
2004-08-14 09:37:15 +00:00
Reid Spencer e37345e78f Fix header commentary.
llvm-svn: 15729
2004-08-13 20:25:54 +00:00
Reid Spencer cf7c2fe153 Additional functionality. This version handles option parsing and parameter
subsitution correctly for at least .ll and .st files. There's still a long
way to go (i.e. this isn't worth of review yet).

llvm-svn: 15728
2004-08-13 20:22:43 +00:00