Commit Graph

10033 Commits

Author SHA1 Message Date
Daniel Dunbar
eccf22528f Add MathExtras.h OffsetToAlignment, like RoundUpToAlignment but returns the
offset to the next aligned integer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80339 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 05:48:04 +00:00
Devang Patel
a1ba269a27 Closure is a very generic name. Use AppleBlock instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80307 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 23:51:51 +00:00
Gabor Greif
7362ce08cb eliminate all 80-col violations that I have introduced in my recent checkins (and some others more)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80304 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 23:44:33 +00:00
Dan Gohman
c75cd159cd Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 17:59:08 +00:00
Dan Gohman
1af0513be7 Be somewhat more consistent about const qualifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 17:54:15 +00:00
Dan Gohman
5753a4a003 Global Aliases are not identifiable objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80263 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 17:52:56 +00:00
Dan Gohman
846a2f2703 Handle TargetData with const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 17:51:25 +00:00
Dan Gohman
0aeed044d6 Strip trailing whitespace from blank lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 17:29:49 +00:00
Gabor Greif
4c75054b01 re-apply r80197, now that iterator.h is not mentioned any more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 17:07:35 +00:00
Daniel Dunbar
4fac74950a llvm-mc/Mach-O: Add MCCodeEmitter support, for encoding instructions.
- No relocations yet, of course.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 08:17:51 +00:00
Daniel Dunbar
4b770c2077 Add {MCInst,MCOperand}::{print,dump}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 07:57:12 +00:00
Gabor Greif
1e1de49394 the buildbots revealed one more breakage. fix. (why didn't I see this?)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 06:59:20 +00:00
Gabor Greif
f0891be8bd Clean up the minor mess I caused with removing iterator.h. I shall take care of 80-col violations and the FIXME later. (Thanks goodness that I live in another continent, so the monkeypox did not strike me :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80224 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 06:41:46 +00:00
Chris Lattner
199ba42cbf Implement a new optimization in the inliner: if inlining multiple
calls into a function and if the calls bring in arrays, try to merge
them together to reduce stack size.  For example, in the testcase
we'd previously end up with 4 allocas, now we end up with 2 allocas.

As described in the comments, this is not really the ideal solution
to this problem, but it is surprisingly effective.  For example, on
176.gcc, we end up eliminating 67 arrays at "gccas" time and another
24 at "llvm-ld" time.

One piece of concern that I didn't look into: at -O0 -g with
forced inlining this will almost certainly result in worse debug
info.  I think this is acceptable though given that this is a case
of "debugging optimized code", and we don't want debug info to
prevent the optimizer from doing things anyway.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 06:29:33 +00:00
Bill Wendling
0141739854 Revert accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 05:35:28 +00:00
Chris Lattner
12f0babca4 reduce header #include'age
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80204 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 04:32:07 +00:00
Chris Lattner
8f2718fbef enhance InlineFunction to be able to optionally return
a the list of static allocas that it inlined.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80203 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 04:20:52 +00:00
Chris Lattner
ec1bea0d94 smallvectorize the list of returns built by CloneAndPruneFunctionInto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80202 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 04:02:30 +00:00
Chris Lattner
597ef10577 remove CloneTrace, which appears to be dead since 2004.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80201 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 03:56:43 +00:00
Bill Wendling
fffb7266fe --- Reverse-merging r80147 into '.':
A    include/llvm/ADT/iterator.cmake
U    autoconf/configure.ac
--- Reverse-merging r80161 into '.':
U    cmake/config-ix.cmake
--- Reverse-merging r80171 into '.':
U    Makefile
--- Reverse-merging r80173 into '.':
U    configure
U    include/llvm/Config/config.h.in
--- Reverse-merging r80180 into '.':
A    include/llvm/ADT/iterator.h.in

Despite common miscomceptions, iterator.h is alive and well. It broke the build
bots for several hours. And yet no one bothered to look at them.

Gabor and Doug, please review your changes and make sure that they actually
build before resubmitting them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 03:29:26 +00:00
Daniel Dunbar
04baf9094a llvm-mc: Tweak MCCodeEmitter skeleton.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 01:34:22 +00:00
Daniel Dunbar
8dcf700802 Add missing declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 01:15:54 +00:00
Daniel Dunbar
4a0abd80f1 Sketch TargetRegistry support for MCCodeEmitter abstract interface.
- Of course, nothing actually can provide this interface yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80188 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 00:51:57 +00:00
Daniel Dunbar
81e400092f Try to make MSVC just a little happier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 00:38:04 +00:00
Gabor Greif
c42afd7946 now that include/llvm/ADT/iterator.h.in is not attempted to be built, its prerequisite can go away too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80180 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 23:35:33 +00:00
Douglas Gregor
6047515446 Regenerate configure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 22:59:05 +00:00
Daniel Dunbar
959fd88334 llvm-mc/Mach-O: Don't put assembler temporary labels in the symbol table.
- I moved section creation back into AsmParser. I think policy decisions like
   this should be pushed higher, not lower, when possible (in addition the
   assembler has flags which change this behavior, for example).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80162 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 22:13:22 +00:00
Gabor Greif
a626e16b38 nobody includes llvm/ADT/iterator.h any more,
so get rid of this monstrosity. iterator.h.in is scheduled for deletion in my working copy,
but I wait till I see that configure gets regenerated, as it depends on it. I'll commit
then.
There are still some AC_* tests in the configure.ac dealing with iterators, those can
be zapped probably too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 21:36:59 +00:00
Daniel Dunbar
6009db486e llvm-mc/Mach-O: Set .subsections_via_symbols flag properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 21:22:22 +00:00
Gabor Greif
7309be6735 Remove all the LLVM_COMPACTIFY_SENTINELS-related macro magic as discussed with Chris on IRC. Anybody wanting to debug sentinel dereferencing problems must revert this patch and perform the indicated modifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80128 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 19:16:32 +00:00
Mike Stump
e1182b5599 Allow unsigned long long DenseMapInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80118 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 18:02:19 +00:00
Dan Gohman
4bac4b9899 Move ProfileInfo::Edge's operator<< out of line. Among other benefits,
this eliminates the ATTRIBUTE_USED, which wasn't being used in a manner
acceptable to some GCC versions, according to the buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80103 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 15:56:38 +00:00
Andreas Neustifter
0ef68e8fbb Bugfix for r80100, forgot include. Sorry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 15:18:38 +00:00
Andreas Neustifter
ff271e1353 Implemented comments from Daniel Dunbar.
(See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090817/084958.html)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80100 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 15:13:44 +00:00
Dan Gohman
2385e0e22c Create a ScalarEvolution-based AliasAnalysis implementation.
This is a simple AliasAnalysis implementation which works by making
ScalarEvolution queries. ScalarEvolution has a more complete understanding
of arithmetic than BasicAA's collection of ad-hoc checks, so it handles
some cases that BasicAA misses, for example p[i] and p[i+1] within the
same iteration of a loop.

This is currently experimental. It may be that the main use for this pass
will be to help find cases where BasicAA can be profitably extended, or
to help in the development of the overall AliasAnalysis infrastructure,
however it's also possible that it could grow up to become a directly
useful pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 14:53:06 +00:00
Daniel Dunbar
3f6a960f9c llvm-mc/Mach-O: Add support for relocations.
- I haven't really tried to find the "right" way to store the fixups or apply
   them, yet. This works, but isn't particularly elegant or fast.

 - Still no evaluation support, so we don't actually ever not turn a fixup into
   a relocation entry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 13:58:10 +00:00
Daniel Dunbar
be96355694 llvm-mc/Mach-O: Move symbol indices into the MCSymbolData structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80088 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 13:57:54 +00:00
Daniel Dunbar
383cbff031 llvm-mc: Change MCContext value table to take const MCSymbol*s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 09:16:57 +00:00
Daniel Dunbar
d644c32a52 llvm-mc: Make MCValue take const MCSymbol*s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80078 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 09:16:46 +00:00
Devang Patel
8245988835 Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 05:01:18 +00:00
Chris Lattner
be1f788676 some mips and some sparc compilers apparently
predefine mips and sparc respectively.  Just overrule them :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 05:00:16 +00:00
Chris Lattner
e1f515ea59 fix some funky indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 04:21:30 +00:00
Daniel Dunbar
6742e34385 llvm-mc/Mach-O: Add section padding where needed (to align the next section).
Also, simplify some of Mach-O writer code which can now use section addresses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 04:13:32 +00:00
Daniel Dunbar
5e835967dd llvm-mc/Mach-O: Set addresses for symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 02:48:04 +00:00
Dale Johannesen
de86d473fc Add an 'inline hint' attribute to represent source
code hints that it would be a good idea to inline
a function ("inline" keyword).  No functional change
yet; FEs do not emit this and inliner does not use it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80063 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 01:08:21 +00:00
Devang Patel
8af76bdb74 Add isClosure() predicate. This is used to add DW_AT_APPLE_block attribute.
Patch by Caroline Tice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80061 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 00:39:50 +00:00
Daniel Dunbar
e1f62b247c llvm-mc: Add MCSection::isDefined()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80057 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 00:10:55 +00:00
Dan Gohman
1c8a23c440 Eliminate the unused Context argument on one of the ICmpInst and FCmpInst
constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80049 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 23:17:54 +00:00
Gabor Greif
2f3fa88a25 revert r78628 and r78803 as these are not needed any more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80048 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 23:02:21 +00:00
Dan Gohman
30f8091963 Use covariant return types for Instruction::clone, and eliminate
the forms of ExtractElementInst and InsertElementInst that are
equivalent to clone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 22:29:08 +00:00
Dan Gohman
58cfa3b137 Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,
and introduce a new Instruction::isIdenticalTo which tests for full
identity, including the SubclassOptionalData flags. Also, fix the
Instruction::clone implementations to preserve the SubclassOptionalData
flags. Finally, teach several optimizations how to handle
SubclassOptionalData correctly, given these changes.

This fixes the counterintuitive behavior of isIdenticalTo not comparing
the full value, and clone not returning an identical clone, as well as
some subtle bugs that could be caused by these.

Thanks to Nick Lewycky for reporting this, and for an initial patch!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80038 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 22:11:20 +00:00
Bill Wendling
415c8cf837 Revert last patch. We need to put this into TargetLowering. There will be a lot
of EH stuff going into there, so we can wait to add them all then.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80036 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 21:31:39 +00:00
Gabor Greif
2600ca8b3f re-committing yesterday's r79938.
This time there is no additional include of llvm/Config/config.h
at all. Instead I use a hard-coded preprecessor symbol:
LLVM_COMPACTIFY_SENTINELS

(should this work on the self-hosting buildbot, then
 cleanups come next)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80035 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 21:25:22 +00:00
Bill Wendling
eb2fde2c93 Comment formatting. Removing of unused #include and type forwarding.
OCD is fun!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80030 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 21:01:42 +00:00
Bill Wendling
b9e7689c89 Add a target asm info hook to specify that particular bits of data in the FDE
should be forced to 32-bits (.long) even on 64-bit architectures. Darwin wants
these bits to be 64-bits (.quad). However, other platforms may disagree.

This is just the info right now and is part of a work-in-progress which needs
this. We'll add the actual *use* of this soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80024 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 20:21:17 +00:00
Dan Gohman
baa26395cc Make LLVM command-line tools overwrite their output files without -f.
This is conventional command-line tool behavior. -f now just means
"enable binary output on terminals".

Add a -f option to llvm-extract and llvm-link, for consistency.

Remove F_Force from raw_fd_ostream and enable overwriting and
truncating by default. Introduce an F_Excl flag to permit users to
enable a failure when the file already exists. This flag is
currently unused.

Update Makefiles and documentation accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 15:34:52 +00:00
Devang Patel
2a610c7387 Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.
This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 05:24:07 +00:00
Bill Wendling
f63097f223 --- Reverse-merging r79938 into '.':
U    include/llvm/BasicBlock.h
U    include/llvm/ADT/ilist_node.h
U    include/llvm/ADT/ilist.h
U    include/llvm/CodeGen/SelectionDAG.h
U    include/llvm/CodeGen/MachineFunction.h
U    include/llvm/CodeGen/MachineBasicBlock.h
U    include/llvm/Function.h

Revert r79938. It was causing self-hosting build failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 00:05:04 +00:00
Andreas Neustifter
96135b617a This patch cleans up the ProfileInfo by
*) introducing new data type and export function of edge info for whole function (preparation for next patch).
*) renaming variables to make clear distinction between data and containers that contain this data.
*) updated comments and whitespaces.
*) made ProfileInfo::MissingValue a double (as it should be...).

(Discussed at http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090817/084955.html.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 21:37:48 +00:00
Gabor Greif
fd7a918e58 Resubmit an earlier patch of mine:
reduce the size of relevant "ghostly" sentinels
by a pointer.

This attempt now makes the compactification dependent
on the configure variable LLVM_COMPACT_SENTINELS
and should not cause any bootstrap failures for
llvm-gcc any more.

Please note that this is not yet the final version,
and (as settled with Chris) I shall take out the
autofoo/cmake portions in the next days.

This will also lose the assertability on sentinel
dereferencing and operator++, but that seems
an acceptable price to pay for the simplified
build logic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 21:34:17 +00:00
Daniel Dunbar
0c7761b3f9 llvm-mc/Mach-O: Preliminary support for indirect symbols.
- The indirect table itself isn't being filled in yet.

 - This isn't factored properly and is rather FIXMEd, but at the moment I'm more
   focused on figuring out what it needs to do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79910 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 11:56:58 +00:00
Daniel Dunbar
688b55b436 Add llvm::Triple::getArchTypePrefix for getting the intrinsic prefix for an
identifier architecture.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 09:53:06 +00:00
Daniel Dunbar
2b1d3d76d7 Add StringRef based APIs to BitstreamWriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 09:29:31 +00:00
Daniel Dunbar
1464869cb3 Add MemoryBuffer::getBuffer() -> StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79903 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 09:29:24 +00:00
Daniel Dunbar
6aff2fbd56 llvm-mc/Mach-O: Support symbol attributes.
- This is mostly complete, the main thing missing is .indirect_symbol support
   (which would be straight-forward, except that the way it is implemented in
   'as' makes getting an exact .o match interesting).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79899 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 08:40:12 +00:00
Daniel Dunbar
8a719291db Add missing include (for MSVC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 07:18:07 +00:00
Chris Lattner
8da76367c5 remove the last *stream> #include from a public header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 04:14:03 +00:00
Chris Lattner
32e1eef631 split raw_os_ostream out to its own header and implementation file. This
means that raw_ostream no longer has to #include <iosfwd>.  Nothing in llvm
should use raw_os_ostream.h, but llvm-gcc and some unit tests do.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 04:02:06 +00:00
Chris Lattner
23132b188b prune the #includes in raw_ostream.h by moving a
member out of line. ftostr is not particularly speedy,
so that method is presumably not perf sensitive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 03:52:50 +00:00
Chris Lattner
9661c13c37 remove a few dead insertion methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 02:39:26 +00:00
Daniel Dunbar
87cbef0df0 Remove alloca config.h support.
- I did not actually remove the configure test itself, someone who can
   regenerate configure should do this (see FIXME in autoconf/configure.ac)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79881 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 02:14:39 +00:00
Daniel Dunbar
566902bc2f Remove include/llvm/Config/alloca.h, it is dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 02:02:49 +00:00
Chris Lattner
91021d3390 remove the dead std::ostream APInt inserter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79875 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 23:11:28 +00:00
Chris Lattner
74382b7c69 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79869 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 22:45:37 +00:00
Chris Lattner
28fb7c4a9a llvm/Support/Streams.h is now dead, zap it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79865 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 21:50:26 +00:00
Chris Lattner
e0c86afac6 Switch SubtargetFeature off of ostreams
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79864 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 21:41:43 +00:00
Chris Lattner
b683ea4712 eliminate the ostream version of CheckBitcodeOutputToConsole,
change the raw_ostream one to take the raw_ostream byref instead
of byptr.  Prune #includes, eliminate a use of Streams.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79863 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 21:36:09 +00:00
Daniel Dunbar
9441cfe488 Fix off-by-one in llvm::Format::print.
- This also shortens the Format.h implementation, and uses the print buffer
   fully (it was wasting a character).

 - This manifested as llvm-test failures, because one side effect was that
   raw_ostream would write garbage '\x00' values into the output stream if it
   happened that the string was at the end of the buffer. This meant that grep
   would report 'Binary file matches', which meant the silly pattern matching
   llvm-test eventually does would fail. Cute. :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79862 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 20:31:39 +00:00
Daniel Dunbar
43ed267db3 Fix some refactos for iostream changes (in -Asserts mode).
- The world needs better C++ refactoring tools, can I get an Amen!?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79843 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 08:50:52 +00:00
Chris Lattner
d9ea85ab01 remove some uses of llvm/Support/Streams.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79842 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 08:43:55 +00:00
Chris Lattner
b515d75856 eliminate the std::ostream forms of the bitcode writing APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79840 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 07:49:08 +00:00
Chris Lattner
103289e938 convert LoopInfo.h and GraphWriter.h to use raw_ostream
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79836 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 07:19:13 +00:00
Chris Lattner
a36b81d64f eliminate DOUT and make Debug.h not include Streams.h anymore, woo!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79835 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 07:05:39 +00:00
Chris Lattner
bbbfa99d3d remove a few DOUTs here and there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79832 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 06:35:02 +00:00
Chris Lattner
45cfe545ec Change Pass::print to take a raw ostream instead of std::ostream,
update all code that this affects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 06:03:38 +00:00
Chris Lattner
791102fb11 eliminate the std::ostream form of WriteAsOperand and update clients.
This also updates dominator related stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 05:17:37 +00:00
Chris Lattner
79c5d3f971 remove the std::ostream version of module and type printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79823 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 04:52:46 +00:00
Chris Lattner
bdff548e4d eliminate the "Value" printing methods that print to a std::ostream.
This required converting a bunch of stuff off DOUT and other cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79819 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 04:37:46 +00:00
Chris Lattner
c02497f5ba shoot a few more std::ostream print methods in the head.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79814 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 03:47:42 +00:00
Chris Lattner
705e07f578 remove various std::ostream version of printing methods from
MachineInstr and MachineOperand.  This required eliminating a
bunch of stuff that was using DOUT, I hope that bill doesn't
mind me stealing his fun. ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 03:41:05 +00:00
Chris Lattner
cf143a4d91 remove std::ostream versions of printing stuff for MBB and MF,
upgrading a few things to use raw_ostream


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 03:13:20 +00:00
Chris Lattner
17e9edc4a7 Change raw_fd_ostream to take flags as an optional bitmask
instead of as two bools.  Use this to add a F_Append flag
which has the obvious behavior.

Other unrelated changes conflated into this patch:

1. REmove EH stuff from llvm-dis and llvm-as, the try blocks
   are dead.
2. Simplify the filename inference code in llvm-as/llvm-dis,
   because raw_fd_ostream does the right thing with '-'.
3. Switch machine verifier to use raw_ostream instead of ostream
   (Which is the thing that needed append in the first place).




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 02:51:22 +00:00
Chris Lattner
1d7fb4eae5 This was supposed to go with r79803
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79804 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 01:13:09 +00:00
Chris Lattner
d74c556e9a convert some stuff to work on raw_ostreams instead of std::ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 01:12:47 +00:00
Chris Lattner
372fefe8d2 remove some dead print method variants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79801 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 01:03:30 +00:00
Chris Lattner
2d8e3d20be remove dead PrefixPrinter class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 00:47:04 +00:00
Chris Lattner
77942d4ee4 remove a dead class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 00:42:42 +00:00
Chris Lattner
de51ded2fa switch formattedstream to use raw_ostream::indent. This eliminates
the weird MAX_COLUMN_PAD limitation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 23:16:09 +00:00
Chris Lattner
c5a227ddd1 add a raw_ostream::indent method, to be used like:
OS.indent(i) << "whatever";

people seem to like indenting things ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 23:10:29 +00:00
Chris Lattner
5ec2e6b586 fix a build error on the clang-i686-linux tester.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 21:45:03 +00:00
Chris Lattner
33adcfb4d2 rename TAI -> MAI, being careful not to make MAILJMP instructions :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79777 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 21:43:10 +00:00
Chris Lattner
90aa1f92c1 mcasminfo doesn't use std::string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 21:05:21 +00:00
Chris Lattner
2807afa664 rename COFFMCAsmInfo -> MCAsmInfoCOFF, likewise for darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 21:03:30 +00:00
Chris Lattner
82d748d55c move the MCAsmInfo .cpp/.h files into the right
directories and rename them.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79768 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:58:17 +00:00
Chris Lattner
af76e592c7 Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:48:53 +00:00
Devang Patel
24f20e0832 Record variable debug info at ISel time directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 17:12:53 +00:00
Daniel Dunbar
3edd9bb7a3 llvm-mc/Mach-O: Improve symbol table support:
- Honor .globl.

 - Set symbol type and section correctly ('nm' now works), and order symbols
   appropriately.

 - Take care to the string table so that the .o matches 'as' exactly (for ease
   of testing).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79740 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 11:41:10 +00:00
Daniel Dunbar
f3d2ef0c97 llvm-mc/Mach-O: Sketch symbol table support.
- The only .s syntax this honors right now is emitting labels, and some parts
   of the symbol table generation are wrong or faked.

 - This is enough to get nm to report such symbols... incorrectly, but still.

Also, fixed byte emission to extend the previous fragment if possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 10:13:24 +00:00
Daniel Dunbar
2ae58f2851 llvm-mc/Mach-O: Move more logic for writing the Mach-O file into the writer
class, and kill off MCSectionData::FileOffset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79735 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 08:28:27 +00:00
Daniel Dunbar
a5441fea1f llvm-mc: Rename / redefine MCFragment::FileOffset to MCFragment::Offset (the
section offset).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79734 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 08:27:54 +00:00
Daniel Dunbar
8906ff1b9d llvm-mc: Clean up some handling of symbol/section association to be more correct
(external was really undefined and there wasn't an explicit representation for
absolute symbols).
 - This still needs some cleanup to how the absolute "pseudo" section is dealt
   with, but I haven't figured out the nicest approach yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79733 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 07:22:36 +00:00
Daniel Dunbar
39db3439bf Change SmallString::operator{=,+=} to take a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 06:06:46 +00:00
Bob Wilson
b8b85cfd4d Add new intrinsics for Neon vldN_lane and vstN_lane operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79716 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 02:28:46 +00:00
Daniel Dunbar
361ae1d28d Make MSVC happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 23:11:36 +00:00
Daniel Dunbar
d6f761e0eb llvm-mc/Mach-O: Support .o emission for .org and .align.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 23:07:38 +00:00
Anton Korobeynikov
7e844f128e Implement APInt <-> APFloat conversion for IEEE 128-bit floats.
This fixes PR2555

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 22:10:30 +00:00
Reid Kleckner
01248e6711 Fix a bug where the DWARF emitter in the JIT was not initializing alignment
bytes.  libgcc doesn't seem to mind, but if you pass this DWARF to GDB, it
doesn't like it.  

Also make the JIT memory manager to initialize it's memory to garbage in debug
mode, so that it's easier to find bugs like these in the future.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79674 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 21:03:57 +00:00
Owen Anderson
9085750d31 Try again at privatizing the layout info map, with a rewritten patch.
This preserves the existing behavior much more closely than my previous attempt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79663 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 19:59:12 +00:00
Daniel Dunbar
0705fbf52f llvm-mc/Mach-O: Support byte and fill value emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 18:29:01 +00:00
Bob Wilson
d23b33435a Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79643 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 17:41:48 +00:00
Benjamin Kramer
1f2b32c5c6 Fix build on platforms where stdint.h is not implicitly included in the standard headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79629 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 13:59:49 +00:00
Daniel Dunbar
fb4a6b3976 llvm-mc: Start MCAssembler and MCMachOStreamer.
- Together these form the (Mach-O) back end of the assembler.

 - MCAssembler is the actual assembler backend, which is designed to have a
   reasonable API. This will eventually grow to support multiple object file
   implementations, but for now its Mach-O/i386 only.

 - MCMachOStreamer adapts the MCStreamer "actions" API to the MCAssembler API,
   e.g. converting the various directives into fragments, managing state like
   the current section, and so on.

 - llvm-mc will use the new backend via '-filetype=obj', which may eventually
   be, but is not yet, since I hear that people like assemblers which actually
   assemble.

 - The only thing that works at the moment is changing sections. For the time
   being I have a Python Mach-O dumping tool in test/scripts so this stuff can
   be easily tested, eventually I expect to replace this with a real LLVM tool.

 - More doxyments to come.

I assume that since this stuff doesn't touch any of the things which are part of
2.6 that it is ok to put this in not so long before the freeze, but if someone
objects let me know, I can pull it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79612 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 09:11:24 +00:00
Bob Wilson
d4b4cf524b Remove Neon intrinsics for VZIP, VUZP, and VTRN. We will represent these as
vector shuffles.  Temporarily remove the tests for these operations until the
new implementation is working.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79579 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 00:01:42 +00:00
Owen Anderson
2ea20154ce Re-revert r79555. Apparently it's not just buildbot weirdness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 23:51:44 +00:00
Owen Anderson
28998d1806 Reapply r79555 for testing. Daniel's trying to work out some buildbot weirdnesss.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 23:14:20 +00:00
Bill Wendling
607abd262e --- Reverse-merging r79555 into '.':
U    include/llvm/Target/TargetData.h
U    lib/Target/TargetData.cpp

Temporarily revert 79555. It was causing hangs and test failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79568 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 22:04:42 +00:00
Owen Anderson
d9b207122e Make the StructType->StructLayout table private to TargetData, allowing us to avoid locking on it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 18:26:03 +00:00
Dan Gohman
5078f84c82 Rename hasNoUnsignedOverflow and hasNoSignedOverflow to hasNoUnsignedWrap
and hasNoSignedWrap, for consistency with the nuw and nsw properties.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 17:11:38 +00:00
Dan Gohman
4c0d5d5db8 Various comment and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 16:42:55 +00:00
Erick Tryzelaar
a7f7c25834 Rename FirstExtendedValueType to INVALID_SIMPLE_VALUE_TYPE
as that's a bit more descriptive of what we're testing for.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79513 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 05:09:43 +00:00
Dan Gohman
583b6dbcc5 Add some comments clarifying what appear to be the intent of various
error handling mechanisms. Please correct these if I've misunderstood
something.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 01:46:24 +00:00
Dan Gohman
a5595b02da Reword a few comments for AnalyzeBranch and InsertBranch, and fix
a few typos.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79503 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 01:33:25 +00:00
Daniel Dunbar
5149932068 Add a fast path for setName("") on an unnamed value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 23:37:23 +00:00
David Greene
f189004d3b Remove an unnecessary include. Now we won't have circular include
problems later on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 23:00:07 +00:00
Daniel Dunbar
9d8f004266 Switch IRBuilder to using Twine references for names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 22:34:21 +00:00
David Greene
9fa24c9619 Add missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 21:22:18 +00:00
David Greene
abd9855af3 Add missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79468 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 21:19:41 +00:00
David Greene
3a190f5e5e Add missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 21:17:28 +00:00
David Greene
de0cc5a660 Add missing header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79463 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 20:52:54 +00:00
Eli Friedman
74db89e30f Add triple parsing support for TCE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 20:46:03 +00:00
Dan Gohman
7ab2fef792 Unbreak GetBufferSize() on uninitialized streams. This fixes a problem
that led to errs() getting made buffered.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79458 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 20:27:57 +00:00
Daniel Dunbar
dddfd34e32 Switch to SmallString::str from SmallString::c_str, and remove
SmallString::c_str.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79456 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 20:07:03 +00:00
Daniel Dunbar
04087d069a Add SmallString::str (which returns a StringRef); this is more efficient than
c_str().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 19:57:55 +00:00
Daniel Dunbar
921be7a6f2 Remove SmallString::append_*int* methods; how many copies of int -> str
conversion code do we really need?
 - S.append_uint(N) can be replaced with 'raw_svector_ostream(S) << N' which is
   somewhat slower due to the extra set up cost, but still plenty fast
   (especially if the svector set up cost can be amortized).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79450 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 19:28:18 +00:00
Daniel Dunbar
d14787e497 Change raw_svector_ostream to reserve the input buffer if necessary, Ted was
right.
 - This class turns out to be much more convenient to use if we do this; clients
   can make sure the buffer is always big enough if they care (since our current
   idiom tends to be to use a SmallString<256> for the input to this we should
   generally be avoiding an unnecessary malloc).

Also, add a convenience raw_svector_ostream::str method which flushes the buffer
and returns a StringRef for the vector contents.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 18:40:58 +00:00
Dan Gohman
6a402dc952 Add an x86 peep that narrows TEST instructions to forms that use
a smaller encoding. These kinds of patterns are very frequent in
sqlite3, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79439 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 18:16:17 +00:00
Daniel Dunbar
425d08c654 Switch raw_svector_ostream to use the vector as the ostream buffer.
- This avoids unnecessary malloc/free overhead in the common case, and
   unnecessary copying from the ostream buffer into the output vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79434 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 17:54:29 +00:00
Daniel Dunbar
c2da6fb3e5 Add SmallVector::{capacity,set_size}.
- These allow clients to make use of the extra elements in the vector which
   have already been allocated, without requiring them to be value initialized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 17:48:28 +00:00
Erick Tryzelaar
f7e8b5c722 BasicBlock::getContext can no longer return a NULL so update the doc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 17:40:05 +00:00
Owen Anderson
c34ebf65af Reapply my less-lock-contention-in-leak-detector patch, now with new files
actually added.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79429 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 17:07:46 +00:00
David Goodwin
dc4bdcdef1 Use the schedule itinerary operand use/def cycle information to adjust dependence edge latency for post-RA scheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 16:08:58 +00:00
Erick Tryzelaar
44a708f6f4 Expose some extra functions to llvm-c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 08:36:49 +00:00
Chris Lattner
2d32086749 ExuberantAsm is no more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 06:36:30 +00:00
Chris Lattner
6c2f9e14fd eliminate AsmPrinter::SwitchToSection and just have clients
talk to the MCStreamer directly instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 05:49:37 +00:00
Erick Tryzelaar
a8f0bc04d3 Fix gcc-4.4/fedora 11 by adding a sentinel value to SimpleValueType.
gcc-4.4 was optimizing away comparisons against SimpleValueType when
it was compared to a value larger than the largest value in the enum.
This patch works around it by adding one extra item to the enum so
that these tests will now be valid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 02:53:07 +00:00
Owen Anderson
021d664a38 Revert my last patch temporarily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79388 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 00:52:13 +00:00
Owen Anderson
ba43a385a8 Privatize part of the leak detector mechanism, which turned out to be heavily contended
when trying to run opt in parallel.  This lets parallel opt crunch 403.gcc in about a third
of the time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 00:37:02 +00:00
Daniel Dunbar
d29d497b53 raw_ostream: Remove pointless redefinitions of tell().
- The base class implementation is correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 00:14:25 +00:00
Daniel Dunbar
906d5b4455 raw_ostream: Add the capability for subclasses to manually install an external
buffer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79382 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 23:42:36 +00:00
Daniel Dunbar
ab81027544 raw_ostream: Reduce FormattedStream's reliance on raw_ostream's implementation.
- Kill off begin(), end(), and iterator. It isn't clear what these
   mean. Instead provide getBufferStart(), which can be used with
   GetNumBytesInBuffer to the same effect.

 - Update ComputeColumn to take arguments for the buffer to scan, this
   simplifies the implementation of write_impl substantially.

 - This should also fix possible problems with the scanning pointer pointing
   outside of the current raw_ostream buffer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 23:36:04 +00:00
Jakob Stoklund Olesen
c0823fe7c6 Simplify RegScavenger::FindUnusedReg.
- Drop the Candidates argument and fix all callers. Now that RegScavenger
  tracks available registers accurately, there is no need to restict the
  search.
- Make sure that no aliases of the found register are in use. This was a potential bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79369 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 21:14:54 +00:00
Daniel Dunbar
35979c021e Revert r78924, disabling buffering defeats all the fast paths in raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 20:07:36 +00:00
Daniel Dunbar
651aa689cc Improve Triple to recognize the OS in i386-mingw32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 19:26:55 +00:00
David Greene
fe37ab335b Make various changes suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 19:22:55 +00:00
Daniel Dunbar
323a3e6533 Fix pasto in StringRef::count(char)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 18:34:22 +00:00
Daniel Dunbar
5caba3bcb1 Add StringRef::count({char,StringRef})
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79354 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 18:26:35 +00:00
Dan Gohman
c40f17b087 Generalize ScalarEvolution to be able to analyze GEPs when
TargetData is not present. It still uses TargetData when available.
This generalization also fixed some limitations in the TargetData
case; the attached testcase covers this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79344 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 16:46:41 +00:00
Misha Brukman
b2bacd9263 Fixed spelling of MSP430.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79333 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 13:50:28 +00:00
Chris Lattner
dabf07c70a Make AsmStreamer maintain a notion of the current section, pushing it up from the
MCAsmStreamer.  Based on this, eliminate the current section from AsmPrinter.

While I'm at it, clean up the last of the horrible "switch to null section" stuff
and add an assert.  This change is in preparation for completely eliminating 
asmprinter::switchtosection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79324 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 06:15:16 +00:00
Daniel Dunbar
2447389bac Recognize xscale as an ARM arch.
- Patch by Yonggang Luo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79315 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 04:51:26 +00:00
Daniel Dunbar
fdb0b7b555 Add Triple matching for pic16 arch and solaris OS.
- Patch by Yonggang Luo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79314 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 04:43:27 +00:00
Daniel Dunbar
baf3eddc78 Add LLVMInitializeAllTargetInfos for C api, and update
LLVMInitializeNativeTarget to initialize target info.
 - Patch by Jose Fonseca.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79307 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 03:03:27 +00:00
Jim Grosbach
2962664227 Remove a bit more cruft from the sjlj moving to a backend pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 20:25:04 +00:00
Jim Grosbach
8b818d7e98 Move the sjlj exception handling conversions to a back-end pass where they
more properly belong. This allows removing the front-end conditionalized
SJLJ code, and cleans up the generated IR considerably. All of the
infrastructure code (calling _Unwind_SjLj_Register/Unregister, etc) is
added by the SjLjEHPrepare pass.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 16:41:22 +00:00
David Goodwin
fac8541dd4 Extend the instruction itinerary model to include the ability to indicate the def and use cycle for each operand. This additional information is optional, so existing itineraries do not need to be changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 16:02:57 +00:00
Chris Lattner
8f4b1ec02b the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 15:48:08 +00:00
Chris Lattner
975780bb59 change AsmPrinter to switch sections using AsmStreamer instead of
doing it directly.  This requires const'izing a bunch of stuff that
took sections, but this seems like the right semantic thing to do:
emitting a label to a section shouldn't mutate the MCSection object
itself, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 05:49:08 +00:00
Chris Lattner
f3ce009fcb give MCAsmStreamer a TargetAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79222 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 04:23:44 +00:00
Oscar Fuentes
f70bc559a1 Make a declaration consistent with its definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79220 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 04:10:20 +00:00
Erick Tryzelaar
e0a1bf64c9 Expose creating constant ints and floats from strings in llvm-c.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 23:36:46 +00:00
Erick Tryzelaar
0e81f660db Add helper functions to ConstantInt and ConstantFP to accept strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79212 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 23:36:33 +00:00
Erick Tryzelaar
a15d890c34 Modify APFloat to take a StringRef instead of a c string.
This also adds unit tests to APFloat that mainly tests the
string handling of APFloat, but not much else of it's api.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 23:36:19 +00:00
Dan Gohman
3778f21b17 Add a getOffsetOf, for building a target-independent expression for
offsetof, similar to getSizeOf for sizeof.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 21:26:11 +00:00
Jakob Stoklund Olesen
66a39699fb Replace RegScavenger::DistanceMap with a simpler local algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79195 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 17:41:39 +00:00
Jakob Stoklund Olesen
e689ce626c Clean up the public interface of RegScavenger.
Remove unused methods and make others private.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 17:41:20 +00:00
Erick Tryzelaar
5c1c208296 Add an llvm-c function that lets you insert an instruction with a name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 02:20:57 +00:00
Erick Tryzelaar
56b22697d8 Expose most of the Constant creation functions to llvm-c.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79160 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 02:20:12 +00:00
Erick Tryzelaar
f72596c04a Expose most of the rest of IRBuilder's functions to llvm-c.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79159 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 02:19:59 +00:00
Erick Tryzelaar
02904d5d84 Add more casts to the IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 02:19:46 +00:00
Bill Wendling
af56634058 Reapply r79127. It was fixed by d0k.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79136 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 21:21:19 +00:00
Bill Wendling
f865ea85bd Revert r79127. It was causing compilation errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79135 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 21:14:01 +00:00
Evan Cheng
088880cb19 Change allowsUnalignedMemoryAccesses to take type argument since some targets
support unaligned mem access only for certain types. (Should it be size
instead?)

ARM v7 supports unaligned access for i16 and i32, some v6 variants support it
as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 19:23:44 +00:00
Chris Lattner
7d996d907f add support for target-specific ELF section flags, add a new MCSectionXCore
class which represents the XCore cp/dp section flags.  No functionality
change yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 05:56:11 +00:00
Dan Gohman
a4a68c1b43 Move FormattedStream's write_impl out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79064 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 02:01:04 +00:00
Eric Christopher
0abee0754b Add sse4.2 string/text processing intrinsics. We'll select these later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79037 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 20:27:57 +00:00
Eric Christopher
801179579e Whitespace cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79036 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 20:27:12 +00:00
Anton Korobeynikov
72977a45a8 Allow targets to specify their choice of calling conventions per
libcall. Take advantage of this in the ARM backend to rectify broken
choice of CC when hard float is in effect. PIC16 may want to see if
it could be of use in MakePIC16Libcall, which works unchanged.

Patch by Sandeep!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79033 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 20:10:52 +00:00
Bruno Cardoso Lopes
abd7514a68 *try* to use a better name to describe how common symbols are marked on the elf object file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79029 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 19:45:38 +00:00
Owen Anderson
5ee3ba2f9e Add doxygen comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 19:41:50 +00:00
Argyrios Kyrtzidis
9a0b165cb5 Revert r78424.
In order for the changes in r78424 to work properly, cast_retty<X,Y> should return an object instead of a reference, and it's not clear that this approach has real advantages.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79023 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 19:01:37 +00:00
Erick Tryzelaar
d644cb8ff5 A couple IRBuilder functions were still using getGlobalContext().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 06:12:30 +00:00
Daniel Dunbar
c22e0b2443 Update llvm-mc / MCAsmStreamer to print the instruction using the actual target
specific printer (this only works on x86, for now).
 - This makes it possible to do some correctness checking of the parsing and
   matching, since we can compare the results of 'as' on the original input, to
   those of 'as' on the output from llvm-mc.

 - In theory, we could now have an easy ATT -> Intel syntax converter. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 03:48:55 +00:00
Daniel Dunbar
575327b77e Add virtual printMCInst method to AsmPrinter, as a quick way to expose the API
to print one instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 03:43:57 +00:00
Daniel Dunbar
1689e0cf55 Add MCSymbol::{print, dump}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78983 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 03:41:23 +00:00
Daniel Dunbar
2c11624b65 Add MCValue::{print, dump}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78982 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 03:11:09 +00:00
Owen Anderson
0668dc7955 Add helpers for fetching basic types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 00:30:41 +00:00
Erick Tryzelaar
22c3f1877d Expose LLVMContext to llvm-c.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 00:01:31 +00:00
Daniel Dunbar
7894578470 TargetRegistry: Change AsmPrinter constructor to be typed as returning an
AsmPrinter instance (instead of just a FunctionPass)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:48:47 +00:00
Daniel Dunbar
011e4db845 llvm-mc: Add dummy MCStreamer implementation, (eventually) for use in profiling.
- Currently unused.

 - A few other random comment fixes lumped in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:36:34 +00:00
Bruno Cardoso Lopes
fdf229eda9 Remove HasCrazyBSS and add a flag in TAI to indicate that '.section'
must be emitted for PowerPC-Linux '.bss' section


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78958 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:30:21 +00:00
Owen Anderson
0e275dc538 Actually privatize a IntegerTypes, and fix a few bugs exposed by this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:27:32 +00:00
Dan Gohman
6c304f2314 Make formatted_raw_ostream restore the buffer settings of the
underlying stream when it is finished, so that clients don't
have to do this manually.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:16:59 +00:00
Owen Anderson
1d0be15f89 Push LLVMContexts through the IntegerType APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:58:54 +00:00
Bruno Cardoso Lopes
b8e1055f41 Add a method to return BSSSection from TargetLoweringObjectFile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78939 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:10:28 +00:00
Bruno Cardoso Lopes
4aa688e997 Add a method to return if the ELF section contains only common symbols!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78937 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:08:56 +00:00
Dan Gohman
2907542a3f Add unimplemented destructor declarations to hopefully address
compiler warnings on windows (PR4714).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 20:43:13 +00:00
Daniel Dunbar
67d894ea64 TargetRegistry: Reorganize AsmPrinter construction so that clients pass in the
TargetAsmInfo. This eliminates a dependency on TargetMachine.h from
TargetRegistry.h, which technically was a layering violation.
 - Clients probably can only sensibly pass in the same TargetAsmInfo as the
   TargetMachine has, but there are only limited clients of this API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 19:38:51 +00:00
Dan Gohman
0ba50bb056 Set raw_os_ostream, raw_string_ostream, and raw_svector_ostream to be
unbuffered. std::ostream does its own buffering, and std::string and
SmallVector both have allocation strategies intended to handle frequent
appending.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78924 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 17:41:40 +00:00
Dan Gohman
208ec0f32e Add support to raw_ostream for sizing the buffer according to the
needs of the underlying output mechanism. raw_fd_ostream now uses
st_blksize from fstat to determine a buffer size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 17:27:29 +00:00
Dan Gohman
b3667ae9b6 Make raw_ostream non-copyable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 17:07:08 +00:00
Daniel Dunbar
b42dad4761 Revert 78892 and 78895, these break generating working executables on
x86_64-apple-darwin10.

--- Reverse-merging r78895 into '.':
U    test/CodeGen/PowerPC/2008-12-12-EH.ll
U    lib/Target/DarwinTargetAsmInfo.cpp
--- Reverse-merging r78892 into '.':
U    include/llvm/Target/DarwinTargetAsmInfo.h
U    lib/Target/X86/X86TargetAsmInfo.cpp
U    lib/Target/X86/X86TargetAsmInfo.h
U    lib/Target/ARM/ARMTargetAsmInfo.h
U    lib/Target/ARM/ARMTargetMachine.cpp
U    lib/Target/ARM/ARMTargetAsmInfo.cpp
U    lib/Target/PowerPC/PPCTargetAsmInfo.cpp
U    lib/Target/PowerPC/PPCTargetAsmInfo.h
U    lib/Target/PowerPC/PPCTargetMachine.cpp
G    lib/Target/DarwinTargetAsmInfo.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78919 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 17:03:38 +00:00
Jakob Stoklund Olesen
4a0f08c5fc Add MachineFrameInfo::getPristineRegisters(MBB) method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78911 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 16:19:33 +00:00
David Goodwin
710461688b Add callback to allow target to adjust latency of schedule dependency edge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78910 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 16:05:04 +00:00
Dan Gohman
524dea4d4c Move SetBufferSize and SetUnbuffered out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 15:58:55 +00:00
Dan Gohman
33e49ef5e5 Fix the buffer handling logic so that write_impl is always called with
a full buffer, rather than often being called with a
slightly-less-than-full buffer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78907 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 15:44:52 +00:00
Jakob Stoklund Olesen
d4c00c0f55 Fix the N>=64 case in the isInt<> and isUint<> templates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78899 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 06:24:02 +00:00
Chris Lattner
b2d3169d96 fix a minor fixme. When building with SL and later tools, the ".eh" symbols
don't need to be exported from the .o files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 05:30:22 +00:00
Bruno Cardoso Lopes
b808588a3a Change MCSectionELF to represent a section semantically instead of
syntactically as a string, very similiar to what Chris did with MachO.
The parsing support and validation is not introduced yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 05:07:35 +00:00
Daniel Dunbar
689ad6ef3f Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef.
- Patch by Erick Tryzelaar, with some edits (and a bug fix) from me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 02:33:34 +00:00
Daniel Dunbar
ac55b85438 Add StringRef::front (with some small tweaks while I was in the area).
- Patch by Erick Tryzelaar


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78883 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 02:03:30 +00:00
Chris Lattner
38cff389af sink uniquing of sections out of MCContext into the ELF and PECOFF TLOF implementations.
MCContext no longer maintains a string -> section map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 00:37:15 +00:00
Chris Lattner
c9d31524ee add some comments: MCContext owns the MCSections, but it bump pointer allocates
them, so it doesn't have to explicitly free them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78870 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 00:21:53 +00:00
Chris Lattner
e309cfa0d8 reject invalid code like:
int x __attribute__((section("_foo, _bar"))) = 4;
int y __attribute__((section("_foo, _bar, 4byte_literals"))) = 1;




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78867 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 00:05:07 +00:00
Chris Lattner
5dc47ff039 implement support for uniquing MachO sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78866 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 23:55:02 +00:00
Chris Lattner
d3c4486f46 reduce #includage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78860 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 23:34:27 +00:00
Jim Grosbach
066dbb6415 Mark the callsite intrinsic such that the opimizers know it's not dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 23:03:43 +00:00
Bob Wilson
36e3e668be Add a new "SDTCisVec" SDTypeConstraint. This complements the vAny type.
There have been a few times where I've wanted this but ended up leaving the
operand type unconstrained.  It is easy to add this now and should help
catch errors in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 22:30:59 +00:00
Dan Gohman
a9ad04191c This void is implicit in C++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 22:10:57 +00:00
Dan Gohman
f3e488476e Add a GetBufferSize() member to raw_ostream and use it to
simplify some formatted_raw_ostream code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78836 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 20:52:45 +00:00
David Goodwin
1a8f36e3ce Enhance the InstrStage object to enable the specification of an Itinerary with overlapping stages. The default is to maintain the current behavior that the "next" stage immediately follows the previous one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 18:31:53 +00:00
Dan Gohman
4ae5126d04 Remove a bunch more now-unnecessary Context arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78809 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 16:23:25 +00:00
Gabor Greif
e2b16504be catch a typo and simplify call syntax
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78804 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 09:05:11 +00:00
Gabor Greif
9befba80be here comes the CMAKE part on LLVM_COMPACT_SENTINELS; see also r78628 and r78661
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 08:37:37 +00:00
Chris Lattner
a7ac47cee1 Change TargetAsmInfo to be constructed via TargetRegistry from a Target+Triple
pair instead of from a virtual method on TargetMachine.  This cuts the final
ties of TargetAsmInfo to TargetMachine, meaning that MC can now use 
TargetAsmInfo.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 07:22:17 +00:00
Chris Lattner
8e6208304b add support for mingw64 target triples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 06:32:10 +00:00
Jakob Stoklund Olesen
d6eb635d1a Move immediate constant predicate templates from the Blackfin target to MathExtras.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78793 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 06:22:07 +00:00
Chris Lattner
dfc17f75e8 add a couple of helpers to the Triple class for decoding
the darwin version string.  This should help consolidate
the variety of weird functions we have scattered around the
codebase that do stuff like this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78792 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 06:19:40 +00:00
Bob Wilson
394346ba3a Add some comments to clarify the arguments to the vtbl and vtbx intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 01:48:30 +00:00
Owen Anderson
23b9b19b1a Add contexts to some of the MVT APIs. No functionality change yet, just the infrastructure work needed to get the contexts to where they need to be first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78759 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 00:36:31 +00:00
Daniel Dunbar
7417b761c2 Add 'isCodeGenOnly' bit to Instruction .td records.
- Used to mark fake instructions which don't correspond to an actual machine
   instruction (or are duplicates of a real instruction). This is to be used for
   "special cases" in the .td files, which should be ignored by things like the
   assembler and disassembler. We still need a good solution to handle pervasive
   duplication, like with the Int_ instructions.

 - Set the bit on fake "mov 0" style instructions, which allows turning an
   assembler matcher warning into a hard error.

 - -2 FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 22:17:52 +00:00