Commit Graph

9615 Commits

Author SHA1 Message Date
Jim Grosbach 43bbb9de66 Remove a bit more cruft from the sjlj moving to a backend pass.
llvm-svn: 79272
2009-08-17 20:25:04 +00:00
Jim Grosbach 486be66dbd 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.

llvm-svn: 79250
2009-08-17 16:41:22 +00:00
David Goodwin d813cbfe72 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.
llvm-svn: 79247
2009-08-17 16:02:57 +00:00
Chris Lattner ee97b8b11c the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.

llvm-svn: 79246
2009-08-17 15:48:08 +00:00
Chris Lattner aa1526419c 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.

llvm-svn: 79227
2009-08-17 05:49:08 +00:00
Chris Lattner a61e93d4b5 give MCAsmStreamer a TargetAsmInfo.
llvm-svn: 79222
2009-08-17 04:23:44 +00:00
Oscar Fuentes 8710d9831b Make a declaration consistent with its definition.
llvm-svn: 79220
2009-08-17 04:10:20 +00:00
Erick Tryzelaar dd99135721 Expose creating constant ints and floats from strings in llvm-c.
llvm-svn: 79213
2009-08-16 23:36:46 +00:00
Erick Tryzelaar fc2280d874 Add helper functions to ConstantInt and ConstantFP to accept strings.
llvm-svn: 79212
2009-08-16 23:36:33 +00:00
Erick Tryzelaar 19f63b2e4d 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.

llvm-svn: 79210
2009-08-16 23:36:19 +00:00
Dan Gohman ff3af725ea Add a getOffsetOf, for building a target-independent expression for
offsetof, similar to getSizeOf for sizeof.

llvm-svn: 79208
2009-08-16 21:26:11 +00:00
Jakob Stoklund Olesen 84b4d2241f Replace RegScavenger::DistanceMap with a simpler local algorithm.
llvm-svn: 79195
2009-08-16 17:41:39 +00:00
Jakob Stoklund Olesen ac09a9a1f5 Clean up the public interface of RegScavenger.
Remove unused methods and make others private.

llvm-svn: 79194
2009-08-16 17:41:20 +00:00
Erick Tryzelaar 9813beadcd Add an llvm-c function that lets you insert an instruction with a name.
llvm-svn: 79163
2009-08-16 02:20:57 +00:00
Erick Tryzelaar 4cc690cce4 Expose most of the Constant creation functions to llvm-c.
llvm-svn: 79160
2009-08-16 02:20:12 +00:00
Erick Tryzelaar 3045b8b5d6 Expose most of the rest of IRBuilder's functions to llvm-c.
llvm-svn: 79159
2009-08-16 02:19:59 +00:00
Erick Tryzelaar a24e5504d0 Add more casts to the IRBuilder.
llvm-svn: 79158
2009-08-16 02:19:46 +00:00
Bill Wendling bae6b2cca3 Reapply r79127. It was fixed by d0k.
llvm-svn: 79136
2009-08-15 21:21:19 +00:00
Bill Wendling d3fade656f Revert r79127. It was causing compilation errors.
llvm-svn: 79135
2009-08-15 21:14:01 +00:00
Evan Cheng 52d4e64711 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.

llvm-svn: 79127
2009-08-15 19:23:44 +00:00
Chris Lattner 0fbe0f51a4 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.

llvm-svn: 79077
2009-08-15 05:56:11 +00:00
Dan Gohman 250635e3ac Move FormattedStream's write_impl out of line.
llvm-svn: 79064
2009-08-15 02:01:04 +00:00
Eric Christopher 846e35b26c Add sse4.2 string/text processing intrinsics. We'll select these later.
llvm-svn: 79037
2009-08-14 20:27:57 +00:00
Eric Christopher 86f7f77cc5 Whitespace cleanup.
llvm-svn: 79036
2009-08-14 20:27:12 +00:00
Anton Korobeynikov a6b3ce203a 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!

llvm-svn: 79033
2009-08-14 20:10:52 +00:00
Bruno Cardoso Lopes c773141e66 *try* to use a better name to describe how common symbols are marked on the elf object file.
llvm-svn: 79029
2009-08-14 19:45:38 +00:00
Owen Anderson 8cd3566d6d Add doxygen comments.
llvm-svn: 79027
2009-08-14 19:41:50 +00:00
Argyrios Kyrtzidis ac74c4c2a1 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.

llvm-svn: 79023
2009-08-14 19:01:37 +00:00
Erick Tryzelaar 330b1b4cd8 A couple IRBuilder functions were still using getGlobalContext().
llvm-svn: 78997
2009-08-14 06:12:30 +00:00
Daniel Dunbar 80d484e7cc 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. :)

llvm-svn: 78986
2009-08-14 03:48:55 +00:00
Daniel Dunbar 50327c561b Add virtual printMCInst method to AsmPrinter, as a quick way to expose the API
to print one instruction.

llvm-svn: 78985
2009-08-14 03:43:57 +00:00
Daniel Dunbar 1a019d8554 Add MCSymbol::{print, dump}
llvm-svn: 78983
2009-08-14 03:41:23 +00:00
Daniel Dunbar afe6603590 Add MCValue::{print, dump}
llvm-svn: 78982
2009-08-14 03:11:09 +00:00
Owen Anderson 7a336d3126 Add helpers for fetching basic types.
llvm-svn: 78969
2009-08-14 00:30:41 +00:00
Erick Tryzelaar 262332f24b Expose LLVMContext to llvm-c.
llvm-svn: 78964
2009-08-14 00:01:31 +00:00
Daniel Dunbar 9abdc6cc3c TargetRegistry: Change AsmPrinter constructor to be typed as returning an
AsmPrinter instance (instead of just a FunctionPass)

llvm-svn: 78962
2009-08-13 23:48:47 +00:00
Daniel Dunbar aba5fb8c9a llvm-mc: Add dummy MCStreamer implementation, (eventually) for use in profiling.
- Currently unused.

 - A few other random comment fixes lumped in.

llvm-svn: 78960
2009-08-13 23:36:34 +00:00
Bruno Cardoso Lopes 62e6a8bbe6 Remove HasCrazyBSS and add a flag in TAI to indicate that '.section'
must be emitted for PowerPC-Linux '.bss' section

llvm-svn: 78958
2009-08-13 23:30:21 +00:00
Owen Anderson a42ac6953b Actually privatize a IntegerTypes, and fix a few bugs exposed by this.
llvm-svn: 78955
2009-08-13 23:27:32 +00:00
Dan Gohman d57cbfc7d8 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.

llvm-svn: 78952
2009-08-13 23:16:59 +00:00
Owen Anderson 55f1c09e31 Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Bruno Cardoso Lopes e795f7bed5 Add a method to return BSSSection from TargetLoweringObjectFile
llvm-svn: 78939
2009-08-13 21:10:28 +00:00
Bruno Cardoso Lopes df743ae603 Add a method to return if the ELF section contains only common symbols!
llvm-svn: 78937
2009-08-13 21:08:56 +00:00
Dan Gohman e6e417149f Add unimplemented destructor declarations to hopefully address
compiler warnings on windows (PR4714).

llvm-svn: 78934
2009-08-13 20:43:13 +00:00
Daniel Dunbar 95f58463e5 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.

llvm-svn: 78928
2009-08-13 19:38:51 +00:00
Dan Gohman 854ea3c580 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.

llvm-svn: 78924
2009-08-13 17:41:40 +00:00
Dan Gohman 84487b98a5 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.

llvm-svn: 78923
2009-08-13 17:27:29 +00:00
Dan Gohman f0b93441a4 Make raw_ostream non-copyable.
llvm-svn: 78920
2009-08-13 17:07:08 +00:00
Daniel Dunbar 86c065dd68 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

llvm-svn: 78919
2009-08-13 17:03:38 +00:00
Jakob Stoklund Olesen 3de4a60e1e Add MachineFrameInfo::getPristineRegisters(MBB) method.
llvm-svn: 78911
2009-08-13 16:19:33 +00:00