Commit Graph

692 Commits

Author SHA1 Message Date
Hal Finkel
e528a2c21a Fix bugpoint execution/reference output file name
sys::fs::unique_file will now loop infinitely if provided with a file name
without '%' characters and the input file already exists. As a result, bugpoint
cannot use a fixed file name for the execution output (including the reference
output).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185166 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 16:37:52 +00:00
Rafael Espindola
df0f525cc4 Remove unused includes.
llvm itself is now PathV1 clean.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184947 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26 13:54:34 +00:00
Rafael Espindola
50188c1f42 Port GetMainExecutable over to PathV2.
I will remove the V1 version as soon as I change clang in the next commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184914 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26 05:01:35 +00:00
Rafael Espindola
46fa7cf91a Move GetEXESuffix to the one place it is used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184853 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-25 14:42:30 +00:00
Rafael Espindola
3991c72748 Convert most uses of PathV1.h in ToolRunner.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184210 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-18 17:20:08 +00:00
Rafael Espindola
8ee23f00c7 Add a version of unique_file that return just the file name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184206 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-18 17:01:00 +00:00
Rafael Espindola
21a78d149f Return a std::string from PrependMainExecutablePath.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184204 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-18 16:47:55 +00:00
Rafael Espindola
3b9eb80bd7 Remove PathV1.h use from BugDriver.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184203 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-18 16:21:54 +00:00
Rafael Espindola
9a23039e42 Remove use of PathV1.h from ExecutionDriver.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184202 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-18 16:14:09 +00:00
Rafael Espindola
2c073ee754 Remove usage of PathV1.h from OptimizerDriver.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184198 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-18 15:54:13 +00:00
Rafael Espindola
366f510a41 Convert some uses of eraseFromDisk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184196 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-18 15:33:18 +00:00
Rafael Espindola
88088f4067 Don't use PathV1.h in tools/bugpoint/Miscompilation.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184193 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-18 15:29:32 +00:00
Rafael Espindola
74aec35172 Convert two uses of eraseFromDisk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184136 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-17 21:50:28 +00:00
Rafael Espindola
cacfeed162 Remove usage of PathV1.h in FindBugs.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184122 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-17 20:48:36 +00:00
Rafael Espindola
11db6df569 Don't use PathV1.h in CrashDebugger.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184109 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-17 19:33:18 +00:00
Rafael Espindola
f656a1d499 Don't use PathV1.h in ToolRunner.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184107 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-17 19:21:38 +00:00
Rafael Espindola
71853a1a16 Remove CBE related code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184106 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-17 19:03:02 +00:00
Rafael Espindola
b81784f0fe Don't use PathV1.h in ExtractFunction.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184102 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-17 18:48:59 +00:00
Rafael Espindola
c65aba032e Move PrependMainExecutablePath next to its only user.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183980 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-14 15:12:13 +00:00
Rafael Espindola
b7e2188f7f Don't use PathV1.h in Signals.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183947 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-13 21:16:58 +00:00
Rafael Espindola
bbf97ea7d5 Don't use PathV1.h in FileUtilities.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183941 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-13 20:41:00 +00:00
Rafael Espindola
675e0ac0bf Avoid using PathV1.h in Program.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183940 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-13 20:25:38 +00:00
Rafael Espindola
6585b388cb Have sys::FindProgramByName return a std::string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183928 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-13 19:25:37 +00:00
Rafael Espindola
13f17ea6c0 Further reduce usage of sys::Path in bugpoint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183912 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-13 16:22:26 +00:00
Rafael Espindola
f37802859f Try to fix the build with libstdc++ 4.4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183909 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-13 15:52:54 +00:00
Rafael Espindola
a4b504abc9 Reduce sys::Path usage in bugpoint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183908 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-13 15:47:11 +00:00
Rafael Espindola
9f1d9fd196 Remove the program class.
It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just
those two functions and make Execute and Wait implementations details.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183864 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-12 20:58:35 +00:00
Rafael Espindola
f3e397eb17 Include PathV1.h in files that use it.
This is preparation for replacing Path.h with PathV2.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183782 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-11 20:00:56 +00:00
David Blaikie
453f4f0130 Use only explicit bool conversion operators
BitVector/SmallBitVector::reference::operator bool remain implicit since
they model more exactly a bool, rather than something else that can be
boolean tested.

The most common (non-buggy) case are where such objects are used as
return expressions in bool-returning functions or as boolean function
arguments. In those cases I've used (& added if necessary) a named
function to provide the equivalent (or sometimes negative, depending on
convenient wording) test.

One behavior change (YAMLParser) was made, though no test case is
included as I'm not sure how to reach that code path. Essentially any
comparison of llvm::yaml::document_iterators would be invalid if neither
iterator was at the end.

This helped uncover a couple of bugs in Clang - test cases provided for
those in a separate commit along with similar changes to `operator bool`
instances in Clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181868 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-15 07:36:59 +00:00
Andy Gibbs
200241e4de Replace uses of the deprecated std::auto_ptr with OwningPtr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179373 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 10:56:28 +00:00
Rafael Espindola
436633e2a2 Don't export symbols in every binary on linux.
On freebsd this makes sure that symbols are exported on the binaries that need
them. The net result is that we should get symbols in the binaries that need
them on every platform.

On linux x86-64 this reduces the size of the bin directory from 262MB to 250MB.

Patch by Stephen Checkoway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178725 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-04 01:01:32 +00:00
Chandler Carruth
0f3e4b1495 Manually update the dependencies in the Makefiles. It turns out that all
that work on the LLVMBuild based dependency specification didn't
actually work, we just now maintain dependencies in *3* places instead
of 2. Yay.

There may still be some missing dependencies, I'm still sifting through
the bots and my builds, but this is a step in the right direction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177988 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 03:45:47 +00:00
Chandler Carruth
7fc162f893 Split out the IRReader header and the utility functions it provides into
its own library. These functions are bridging between the bitcode reader
and the ll parser which are in different libraries. Previously we didn't
have any good library to do this, and instead played fast and loose with
a "header only" set of interfaces in the Support library. This really
doesn't work well as evidenced by the recent attempt to add timing logic
to the these routines.

As part of this, make them normal functions rather than weird inline
functions, and sink the implementation into the library. Also clean up
the header to be nice and minimal.

This requires updating lots of build system dependencies to specify that
the IRReader library is needed, and several source files to not
implicitly rely upon the header file to transitively include all manner
of other headers.

If you are using IRReader.h, this commit will break you (the header
moved) and you'll need to also update your library usage to include
'irreader'. I will commit the corresponding change to Clang momentarily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177971 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 02:25:37 +00:00
Michael Gottesman
24c4898973 Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173647 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 01:35:51 +00:00
Saleem Abdulrasool
ed7fcf4fd9 [bugpoint] make tool selection messages unique
Change messages to help identify which interpreter was actually selected (safe
vs testing).

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
Reviewed-by: Chandler Carruth <chandlerc@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173360 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 16:49:14 +00:00
Saleem Abdulrasool
78d3097263 [bugpoint] set Message after tool configuration
Set the message returned after the GCC runner has been constructed as otherwise
the message will be overwritten by the construction of the runner, resulting in
misleading messages.

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
Reviewed-by: Chandler Carruth <chandlerc@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173359 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 16:49:12 +00:00
Chandler Carruth
90230c8466 Sort all of the includes. Several files got checked in with mis-sorted
includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172891 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 08:03:47 +00:00
Jakub Staszak
446991dc34 Fix #includes after my last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172114 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 21:56:40 +00:00
Chandler Carruth
0b8c9a80f2 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 11:36:10 +00:00
Chandler Carruth
f010c464a1 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169252 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 10:44:52 +00:00
Pedro Artigas
6eda081345 One more step towards making doInitialization and doFinalization useful for
start up and clean up module passes, now that ASAN and TSAN are fixed the
tests pass



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168905 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 17:47:05 +00:00
Owen Anderson
9780d352b9 Revert r168635 "Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model".
It appears to have broken at least one buildbot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168654 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 00:53:24 +00:00
Owen Anderson
0d30d30d58 Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model
Patch by Pedro Artigas, with feedback from by Chandler Carruth.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168635 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-26 23:54:47 +00:00
Owen Anderson
40b6fdb81e Add doInitialization and doFinalization methods to ModulePass's, to allow them to be re-initialized and reused on multiple Module's.
Patch by Pedro Artigas.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168008 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-15 00:14:15 +00:00
Micah Villmow
791cfc211a Move TargetData to DataLayout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165403 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08 16:39:34 +00:00
Sylvestre Ledru
94c22716d6 Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164768 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-27 10:14:43 +00:00
Sylvestre Ledru
7e2c793a2b Fix a typo 'iff' => 'if'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164767 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-27 09:59:43 +00:00
Sylvestre Ledru
c8e41c5917 Fix a typo (the the => the)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160621 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 08:51:15 +00:00
Chandler Carruth
99650c9088 Move the CodeExtractor utility to a dedicated header file / source file,
and expose it as a utility class rather than as free function wrappers.

The simple free-function interface works well for the bugpoint-specific
pass's uses of code extraction, but in an upcoming patch for more
advanced code extraction, they simply don't expose a rich enough
interface. I need to expose various stages of the process of doing the
code extraction and query information to decide whether or not to
actually complete the extraction or give up.

Rather than build up a new predicate model and pass that into these
functions, just take the class that was actually implementing the
functions and lift it up into a proper interface that can be used to
perform code extraction. The interface is cleaned up and re-documented
to work better in a header. It also is now setup to accept the blocks to
be extracted in the constructor rather than in a method.

In passing this essentially reverts my previous commit here exposing
a block-level query for eligibility of extraction. That is no longer
necessary with the more rich interface as clients can query the
extraction object for eligibility directly. This will reduce the number
of walks of the input basic block sequence by quite a bit which is
useful if this enters the normal optimization pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156163 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-04 10:18:49 +00:00
John McCall
9679f0f357 Fix unintentional use of operator bool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155978 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 05:39:10 +00:00