1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

17104 Commits

Author SHA1 Message Date
Cameron Zwarich
1ff3c2a1d4 Renumber SlotIndexes locally when a new block is inserted.
llvm-svn: 174937
2013-02-12 03:49:22 +00:00
Cameron Zwarich
12bc4a8f01 Add blocks to the LiveIntervalAnalysis RegMaskBlocks array when splitting
a critical edge.

llvm-svn: 174936
2013-02-12 03:49:20 +00:00
David Blaikie
ec946c1606 DIBuilder: make the return type of createBasicType more specific
llvm-svn: 174924
2013-02-12 00:40:41 +00:00
Michael J. Spencer
1696e9f28b [Support][Compiler] Add LLVM_HAS_VARIADIC_TEMPLATES.
llvm-svn: 174913
2013-02-11 22:51:07 +00:00
Bill Wendling
4ebafe3a4e Rename to something more sensible. No functionality change.
llvm-svn: 174909
2013-02-11 22:31:34 +00:00
Justin Holewinski
f41b45202c [NVPTX] Remove NoCapture from address space conversion intrinsics. NoCapture is not valid in this case, and was causing incorrect optimizations.
llvm-svn: 174896
2013-02-11 18:56:35 +00:00
Tim Northover
e77be415c6 AArch64: Add basic relocation processing for llvm-dwarfdump.
This allows llvm-dwarfdump to handle the relocations needed, at least
for LLVM-produced code.

llvm-svn: 174874
2013-02-11 11:16:02 +00:00
Cameron Zwarich
a494e12ad8 Fix some problems with the updating of SlotIndexes after adding a new MBB. In
particular, holes were being left between two blocks after splitting an edge.

llvm-svn: 174868
2013-02-11 09:24:42 +00:00
Bill Wendling
f45666e4e9 Add support for printing out the attribute groups.
This emits the attribute groups that are used by the functions. (It currently
doesn't print out return type or parameter attributes within attribute groups.)

Note: The functions still retrieve their attributes from the "old" bitcode
format (using the deprecated 'Raw()' method). This means that string attributes
within an attribute group will not show up during a disassembly. This will be
addressed in a future commit.

llvm-svn: 174867
2013-02-11 08:43:33 +00:00
Kostya Serebryany
8e2f1fbfb7 [tsan/msan] adding thread_safety and uninitialized_checks attributes
llvm-svn: 174864
2013-02-11 08:13:54 +00:00
Bob Wilson
3fa3bbfe65 Revert "Rename LLVMContext diagnostic handler types and functions."
This reverts my commit 171047. Now that I've removed my misguided attempt to
support backend warnings, these diagnostics are only about inline assembly.
It would take quite a bit more work to generalize them properly, so I'm
just reverting this.

llvm-svn: 174860
2013-02-11 05:37:07 +00:00
Evan Cheng
d6beb40882 Currently, codegen may spent some time in SDISel passes even if an entire
function is successfully handled by fast-isel. That's because function
arguments are *always* handled by SDISel. Introduce FastLowerArguments to
allow each target to provide hook to handle formal argument lowering.

As a proof-of-concept, add ARMFastIsel::FastLowerArguments to handle
functions with 4 or fewer scalar integer (i8, i16, or i32) arguments. It
completely eliminates the need for SDISel for trivial functions.

rdar://13163905

llvm-svn: 174855
2013-02-11 01:27:15 +00:00
David Blaikie
9ca06623be Fix unnecessary removal of const through cast machinery
I have some uncommitted changes to the cast code that catch this sort of thing
at compile-time but I still need to do some other cleanup before I can enable
it.

llvm-svn: 174853
2013-02-11 01:16:51 +00:00
Cameron Zwarich
99633d18d6 Fix the unused but nearly correct method SlotIndexes::insertMBBInMaps() and add
support for updating SlotIndexes to MachineBasicBlock::SplitCriticalEdge(). This
calls renumberIndexes() every time; it should be improved to only renumber
locally.

llvm-svn: 174851
2013-02-10 23:29:54 +00:00
Bill Wendling
b7596c1019 Add code for emitting the attribute groups.
This is some initial code for emitting the attribute groups into the bitcode.

NOTE: This format *may* change! Do not rely upon the attribute groups' bitcode
not changing.

llvm-svn: 174845
2013-02-10 23:09:32 +00:00
Bill Wendling
b1c6e7b69e Add 'empty' query methods to the builder and use them in the verifier.
llvm-svn: 174832
2013-02-10 10:12:06 +00:00
Chris Lattner
979e8f6aa8 ok, ok, stop fighting type punning warnings by just using a union.
llvm-svn: 174827
2013-02-10 06:36:29 +00:00
Chris Lattner
a144781e5c hopefully "really" fix a type punning warning by defining the buffer as
type char, which can't have TBAA tags.

llvm-svn: 174826
2013-02-10 06:07:16 +00:00
Chris Lattner
2f0d5c4436 attempt to defeat a gcc warning that is breaking a -Werror buildbot.
llvm-svn: 174825
2013-02-10 05:45:34 +00:00
Bill Wendling
eb7e06de6d Add accessor for the LLVMContext.
llvm-svn: 174824
2013-02-10 05:00:40 +00:00
Jakub Staszak
55ac81cd78 Remove unneeded "TargetMachine.h" #includes.
llvm-svn: 174817
2013-02-09 20:54:05 +00:00
Bill Wendling
ea41aacc9c Add a DenseMapInfo class for the AttributeSet.
We are going to place the AttributeSet into a DenseMap during assembly writing.

llvm-svn: 174812
2013-02-09 15:42:51 +00:00
Jakub Staszak
5ad2bc2adc Simplify code.
llvm-svn: 174807
2013-02-09 13:29:31 +00:00
Jakub Staszak
eb31170ee2 Remove unneeded #includes.
llvm-svn: 174806
2013-02-09 13:29:10 +00:00
Chris Lattner
11c104ab45 This is the correct version of r174802.
llvm-svn: 174804
2013-02-09 07:37:59 +00:00
Chris Lattner
b156b50ede Fix a nasty off-by one error that only manifests with 64-bit word size (which is
not enabled yet).

llvm-svn: 174803
2013-02-09 07:37:26 +00:00
Chris Lattner
247a573f43 Fix the underlying problem that was causing read(0) to be called: sometimes the
bitcode writer would generate abbrev records saying that the abbrev should be
filled with fixed zero-bit bitfields (this happens in the .bc writer when 
the number of types used in a module is exactly one, since log2(1) == 0).

In this case, just handle it as a literal zero.  We can't "just fix" the writer
without breaking compatibility with existing bc files, so have the abbrev reader
do the substitution.

Strengthen the assert in read to reject reads of zero bits so we catch such 
crimes in the future, and remove the special case designed to handle this.

llvm-svn: 174801
2013-02-09 07:07:29 +00:00
Chris Lattner
009aa5a10a recommit r173072 (preparing bitstream reader to read a machine word at a time,
instead of always 32-bits at a time) with two changes:

1. Make Read(0) always return zero without affecting the state of our cursor.
2. Hack word_t to always be 32 bits, as staging.

These two caveats will change shortly.

llvm-svn: 174800
2013-02-09 06:52:14 +00:00
Jakub Staszak
37b69de035 Remove trailing spaces.
llvm-svn: 174791
2013-02-09 01:19:12 +00:00
Jakub Staszak
8dbe1b5619 Remove unneeded #includes.
llvm-svn: 174790
2013-02-09 01:15:18 +00:00
Jakub Staszak
ac504d22d0 Remove #includes from the commonly used LoopInfo.h.
llvm-svn: 174786
2013-02-09 01:04:28 +00:00
Jakob Stoklund Olesen
ae224c70b4 Remove the old liveness algorithm.
This is part of the plan to delete LiveVariables.

llvm-svn: 174783
2013-02-09 00:04:07 +00:00
Sergei Larin
e7fdf91e88 Enable *BasicBlockPass::createPrinterPass()
Enables raw_ostream I/O for BasicBlockPass.

llvm-svn: 174776
2013-02-08 23:37:41 +00:00
Bob Wilson
1540efb8f2 Revert "Add LLVMContext::emitWarning methods and use them. <rdar://problem/12867368>"
This reverts r171041. This was a nice idea that didn't work out well.
Clang warnings need to be associated with warning groups so that they can
be selectively disabled, promoted to errors, etc. This simplistic patch didn't
allow for that. Enhancing it to provide some way for the backend to specify
a front-end warning type seems like overkill for the few uses of this, at
least for now.

llvm-svn: 174748
2013-02-08 21:48:29 +00:00
Bob Wilson
d9dfcce74f Revert 172027 and 174336. Remove diagnostics about over-aligned stack objects.
Aside from the question of whether we report a warning or an error when we
can't satisfy a requested stack object alignment, the current implementation
of this is not good.  We're not providing any source location in the diagnostics
and the current warning is not connected to any warning group so you can't
control it.  We could improve the source location somewhat, but we can do a
much better job if this check is implemented in the front-end, so let's do that
instead.  <rdar://problem/13127907>

llvm-svn: 174741
2013-02-08 20:35:15 +00:00
Arnold Schwaighofer
381c4a3e54 ARM cost model: Address computation in vector mem ops not free
Adds a function to target transform info to query for the cost of address
computation. The cost model analysis pass now also queries this interface.
The code in LoopVectorize adds the cost of address computation as part of the
memory instruction cost calculation. Only there, we know whether the instruction
will be scalarized or not.
Increase the penality for inserting in to D registers on swift. This becomes
necessary because we now always assume that address computation has a cost and
three is a closer value to the architecture.

radar://13097204

llvm-svn: 174713
2013-02-08 14:50:48 +00:00
Michael J. Spencer
3abd3b4219 [Object][ELF] Add a way to get the dynamic symbol table section.
llvm-svn: 174682
2013-02-07 23:37:58 +00:00
Michael J. Spencer
dd5b92981e [Object][ELF] Add {begin,end}_elf_dynamic_symbols to non-virtually iterate over dynamic symbols.
llvm-svn: 174681
2013-02-07 23:37:46 +00:00
Meador Inge
58a7392486 ADT: Correct APInt::getActiveWords for zero values
PR15138 was opened because of a segfault in the Bitcode writer.
The actual issue ended up being a bug in APInt where calls to
APInt::getActiveWords returns a bogus value when the APInt value
is 0.  This patch fixes the problem by ensuring that getActiveWords
returns 1 for 0 valued APInts.

llvm-svn: 174641
2013-02-07 18:36:50 +00:00
Michael J. Spencer
d9e9c95c02 [Object][ELF] Fix crash on no dynamic section.
llvm-svn: 174639
2013-02-07 18:26:45 +00:00
Michael J. Spencer
e7a1b674e3 80-col
llvm-svn: 174572
2013-02-07 01:43:18 +00:00
Michael J. Spencer
053ee2fc5c [Object][ELF] Do the actual devirtualization.
llvm-svn: 174568
2013-02-07 01:24:22 +00:00
Michael J. Spencer
552d05feae [Object][ELF] Devirtualize and simplify dynamic table iteration.
llvm-svn: 174566
2013-02-07 01:17:23 +00:00
Owen Anderson
09e506b2be Fix CMake detection of various cmath functions, and XFAIL the test on platforms that are known to be missing them.
llvm-svn: 174564
2013-02-07 00:54:05 +00:00
Owen Anderson
4d8f6634c5 Conditionalize constant folding of math intrinsics on the availability of an implementation on the host. This is a little bit unfortunate, but until someone decides to implement a full libm for APFloat, we don't have a better way to get this functionality.
llvm-svn: 174561
2013-02-07 00:21:34 +00:00
Michael J. Spencer
c795dd0ca7 [Support][ErrorOr] Add support for convertable types.
Thanks to Andrew, David, and Aaron for helping fix this.

llvm-svn: 174552
2013-02-06 22:28:53 +00:00
Bill Wendling
87925691e8 Improve comment.
llvm-svn: 174536
2013-02-06 20:05:44 +00:00
Jim Grosbach
6f7278da17 Allow targets to add custom asm operand matching logic.
For example, ARM has several instructions with a literal '#0' immediate in the syntax
that's not represented as an actual operand. The asm matcher is expected a token
operand, but the parser will have created an immediate operand. This is currently
handled by dedicated per-instruction C++ munging of the ParsedAsmOperand list, but
will be better handled by this hook.

llvm-svn: 174487
2013-02-06 06:00:06 +00:00
Bill Wendling
f45bd45085 Add a 'StringRef' version of hasAttribute.
Fix the 'operator==' and 'hasAttributes' queries to take into account
target-dependent attributes.

llvm-svn: 174481
2013-02-06 01:33:42 +00:00
Bill Wendling
555fe288d9 Add methods to merge an AttrBuilder into another builder.
This is useful when parsing an object that references multiple attribute groups.

N.B. If both builders have alignments specified, then they should match!

llvm-svn: 174480
2013-02-06 01:16:00 +00:00
Bill Wendling
dffa0dbdc3 Add the target-dependent (string) attributes from the AttrBuilder to the AttributeSet.
llvm-svn: 174467
2013-02-05 23:48:36 +00:00
Eli Bendersky
0802d28eff Initial support for DWARF CFI parsing and dumping in LLVM
llvm-svn: 174463
2013-02-05 23:30:58 +00:00
Eli Bendersky
3576be2063 Be consistent about the field name - AddressSize, not PointerSize. Add
a setter and fix some comments.

llvm-svn: 174462
2013-02-05 23:26:02 +00:00
Andrew Trick
2e729a5aff Revert "[Support][ErrorOr] Add support for convertable types."
This reverts commit a33e1fafac7fedb1b080ef07ddf9ad6ddff3a830.

This unit test crashes on Darwon. It needs to be temporarily reverted
to unblock the test infrastructure.

llvm-svn: 174458
2013-02-05 22:50:20 +00:00
Bill Wendling
baf40a92db Convert to storing the attribute's internals as enums, integers, and strings.
The stuff we're handing are all enums (Attribute::AttrKind), integers and
strings. Don't convert them to Constants, which is an unnecessary step here. The
rest of the changes are mostly mechanical.

llvm-svn: 174456
2013-02-05 22:37:24 +00:00
Manman Ren
b9bd895a06 Dwarf: support for LTO where a single object file can have multiple line tables
We generate one line table for each compilation unit in the object file.
Reviewed by Eric and Kevin.

rdar://problem/13067005

llvm-svn: 174445
2013-02-05 21:52:47 +00:00
Jakob Stoklund Olesen
df739a3c69 Remove liveout lists from MachineRegisterInfo.
All targets are now adding return value registers as implicit uses on
return instructions, and there is no longer a need for the live out
lists.

llvm-svn: 174417
2013-02-05 18:21:56 +00:00
Derek Schuff
7be534824b [MC] Bundle alignment: Invalidate relaxed fragments
Currently, when a fragment is relaxed, its size is modified, but its
offset is not (it gets laid out as a side effect of checking whether
it needs relaxation), then all subsequent fragments are invalidated
because their offsets need to change. When bundling is enabled,
relaxed fragments need to get laid out again, because the increase in
size may push it over a bundle boundary. So instead of only
invalidating subsequent fragments, also invalidate the fragment that
gets relaxed, which causes it to get laid out again.

This patch also fixes some trailing whitespace and fixes the
bundling-related debug output of MCFragments.

llvm-svn: 174401
2013-02-05 17:55:27 +00:00
Eli Bendersky
6966ba794c Format comments & clean whitespace
llvm-svn: 174396
2013-02-05 17:10:07 +00:00
Eli Bendersky
92b09964b5 Fix comment formatting
llvm-svn: 174388
2013-02-05 16:40:22 +00:00
Meador Inge
fc41768dd0 Support: ensure proper state in ErrorOr copy ctors before calling 'get'
Some paths through the copy constructors for 'ErrorOr' were calling
'get' when 'HasError' and 'IsValid' were not properly initialized.
Depending on what happened to be in memory for those member variables
the asserts in 'get' might incorrectly fire.  Fixed by ensuring that
the member variables in question are always initialized before calling
'get'.

llvm-svn: 174381
2013-02-05 15:41:27 +00:00
Jack Carter
10d56b481a This patch that sets the Mips ELF header flag for
MicroMips architectures. 

Contributer: Zoran Jovanovic
 
llvm-svn: 174360
2013-02-05 09:30:03 +00:00
Michael J. Spencer
2da5c2c32d [Support][ErrorOr] Add support for convertable types.
llvm-svn: 174357
2013-02-05 08:22:27 +00:00
Bill Wendling
5bcf9a9307 Add target-dependent versions of addAttribute/removeAttribute to AttrBuilder.
llvm-svn: 174356
2013-02-05 08:09:32 +00:00
Michael Gottesman
5c843dc701 Changed in comment cxx -> C++. Thanks Richard Smith!.
llvm-svn: 174355
2013-02-05 08:01:22 +00:00
Jack Carter
76ef2c7e2c This patch changes a static_cast to dyn_cast
for MipsELFStreamer objects.

Contributer: Jack Carter
 
llvm-svn: 174354
2013-02-05 07:47:41 +00:00
Michael Gottesman
aee18ff695 Add code to GlobalVariable.h so that global variables marked as
externally_initialized return false for hasDefiniteInitializer and
hasUniqueInitializer.

rdar://12580965.

llvm-svn: 174345
2013-02-05 06:53:26 +00:00
Bill Wendling
401162ecf9 Initial cleanups of the param-attribute code in the bitcode reader/writer.
Rename the PARAMATTR_CODE_ENTRY to PARAMATTR_CODE_ENTRY_OLD. It will be replaced
by another encoding. Keep around the current LLVM attribute encoder/decoder
code, but move it to the bitcode directories so that no one's tempted to use
them.

llvm-svn: 174335
2013-02-04 23:32:23 +00:00
Benjamin Kramer
aa2475fd87 SelectionDAG: Teach FoldConstantArithmetic how to deal with vectors.
This required disabling a PowerPC optimization that did the following:
input:
x = BUILD_VECTOR <i32 16, i32 16, i32 16, i32 16>
lowered to:
tmp = BUILD_VECTOR <i32 8, i32 8, i32 8, i32 8>
x = ADD tmp, tmp

The add now gets folded immediately and we're back at the BUILD_VECTOR we
started from. I don't see a way to fix this currently so I left it disabled
for now.

Fix some trivially foldable X86 tests too.

llvm-svn: 174325
2013-02-04 15:19:18 +00:00
Evgeniy Stepanov
389e9dd213 More MSan/ASan annotations.
This change lets us bootstrap LLVM/Clang under ASan and MSan. It contains
fixes for 2 issues:

- X86JIT reads return address from stack, which MSan does not know is
  initialized.
- bugpoint tests run binaries with RLIMIT_AS. This does not work with certain
  Sanitizers.

We are no longer including config.h in Compiler.h with this change.

llvm-svn: 174306
2013-02-04 07:03:24 +00:00
Michael Gottesman
e7a0dbefe5 Added instance variable/initializers/getter/setters for new keyword externally initialized to GlobalVariable. No *TRUE* functionality change.
I am going to add in the actual test cases with the actual functionality
changes in a later patch because I want to include some test cases.

To be clear when I say no *TRUE* functionality change I mean that this
patch (like it says in the title) only contains getters/setters and sets
up a default initial value of the instance variable to false so that
this patch does not affect any other uses of Global Variable.h.

llvm-svn: 174295
2013-02-03 21:54:38 +00:00
Michael J. Spencer
5c9c5547e6 [Object][Archive] Improve performance.
Improve performance of iterating over children and accessing the member file
buffer by caching the file size and moving code out to the header.

This also makes getBuffer return a StringRef instead of a MemoryBuffer. Both
fixing a memory leak and removing a malloc.

This takes getBuffer from ~10% of the time in lld to unmeasurable.

llvm-svn: 174272
2013-02-03 10:48:50 +00:00
Michael J. Spencer
2eb480f731 [Support] Add LLVM_IS_UNALIGNED_ACCESS_FAST.
llvm-svn: 174271
2013-02-03 10:48:31 +00:00
Bill Wendling
16d277acec Remove AttrBuilder::Raw().
llvm-svn: 174251
2013-02-02 00:52:44 +00:00
Manman Ren
7ddbce87d4 Correct indentation for dumping LexicalScope.
llvm-svn: 174237
2013-02-02 00:02:03 +00:00
Bill Wendling
867f5df67b Change the AttributeImpl to hold a single Constant* for the values.
This Constant could be an aggregate to represent multiple values.

llvm-svn: 174228
2013-02-01 22:32:30 +00:00
Bill Wendling
b272a4d3bf Remove one of the odious 'Raw' methods.
llvm-svn: 174130
2013-02-01 00:48:14 +00:00
Bill Wendling
a55db587cd Add iterators to the AttributeSet class so that we can access the Attributes in a nice way.
llvm-svn: 174120
2013-01-31 23:53:05 +00:00
Chandler Carruth
8e942972d2 Fix a think-o in the condition here. =[ I would commit the test that
caught this, but I want that in a separate commit in case there is
a need to revert the actual functional bit as part of reverting other
patches. This way, the commits relating to just getting the RTTI bits in
place are separate from the functional changes that start using them.

llvm-svn: 174117
2013-01-31 23:43:12 +00:00
Bill Wendling
eb853de95f s/AttrBuilder::addAttributes/AttrBuilder::addAttribute/g because that's more descriptive of what it actually is.
llvm-svn: 174116
2013-01-31 23:38:01 +00:00
Chandler Carruth
0c74d78ebf Give the MCStreamer class hierarchy LLVM RTTI facilities for use with
isa<> and dyn_cast<>. In several places, code is already hacking around
the absence of this, and there seem to be several interfaces that might
be lifted and/or devirtualized using this.

This change was based on a discussion with Jim Grosbach about how best
to handle testing for specific MCStreamer subclasses. He said that this
was the correct end state, and everything else was too hacky so
I decided to just make it so.

No functionality should be changed here, this is just threading the kind
through all the constructors and setting up the classof overloads.

llvm-svn: 174113
2013-01-31 23:29:57 +00:00
Bill Wendling
7faa9ee1dc Remove the AttrBuilder form of the Attribute::get creators.
The AttrBuilder is for building a collection of attributes. The Attribute object
holds only one attribute. So it's not really useful for the Attribute object to
have a creator which takes an AttrBuilder.

This has two fallouts:

1. The AttrBuilder no longer holds its internal attributes in a bit-mask form.
2. The attributes are now ordered alphabetically (hence why the tests have changed).

llvm-svn: 174110
2013-01-31 23:16:25 +00:00
Dan Gohman
1f16fc6f7b Document another instsimplify assumption.
llvm-svn: 174100
2013-01-31 22:13:00 +00:00
Chad Rosier
ebbd4433e6 [PEI] Pass the frame index operand number to the eliminateFrameIndex function.
Each target implementation was needlessly recomputing the index.
Part of rdar://13076458

llvm-svn: 174083
2013-01-31 20:02:54 +00:00
Tim Northover
e2b0519ed8 Add AArch64 as an experimental target.
This patch adds support for AArch64 (ARM's 64-bit architecture) to
LLVM in the "experimental" category. Currently, it won't be built
unless requested explicitly.

This initial commit should have support for:
    + Assembly of all scalar (i.e. non-NEON, non-Crypto) instructions
      (except the late addition CRC instructions).
    + CodeGen features required for C++03 and C99.
    + Compilation for the "small" memory model: code+static data <
      4GB.
    + Absolute and position-independent code.
    + GNU-style (i.e. "__thread") TLS.
    + Debugging information.

The principal omission, currently, is performance tuning.

This patch excludes the NEON support also reviewed due to an outbreak of
batshit insanity in our legal department. That will be committed soon bringing
the changes to precisely what has been approved.

Further reviews would be gratefully received.

llvm-svn: 174054
2013-01-31 12:12:40 +00:00
Evgeniy Stepanov
51eee1f016 Annotate BumpPtrAllocator for MemorySanitizer.
This change adds MemorySanitizer annotations to BumpPtrAllocator to
improve report quality.

llvm-svn: 174051
2013-01-31 09:58:59 +00:00
Bill Wendling
2fe5911bfe Remove the Attribute::hasAttributes() function.
That function doesn't make sense anymore because there's only one attribute per
Attribute object now.

llvm-svn: 174044
2013-01-31 06:22:35 +00:00
NAKAMURA Takumi
ad566655e3 Revert r174026, "Remove Attribute::hasAttributes() and make Attribute::hasAttribute() private."
It broke many hosts to crash.

llvm-svn: 174035
2013-01-31 03:47:28 +00:00
Dan Gohman
6968f40e37 Move isKnownNonNull out of AliasAnalysis.h and into ValueTracking.cpp since
it isn't really an AliasAnalysis concept, and ValueTracking has similar things
that it could plausibly share code with some day.

llvm-svn: 174027
2013-01-31 02:40:59 +00:00
Bill Wendling
37dbbd1577 Remove Attribute::hasAttributes() and make Attribute::hasAttribute() private.
The Attribute::hasAttributes() is kind of meaningless since an Attribute can
have only one attribute. And we would rather people use the 'operator=='
instead of Attribute::hasAttribute().

llvm-svn: 174026
2013-01-31 02:18:19 +00:00
Dan Gohman
7eac0c2694 Change GetPointerBaseWithConstantOffset's DataLayout argument from a
reference to a pointer, so that it can handle the case where DataLayout
is not available and behave conservatively.

llvm-svn: 174024
2013-01-31 02:00:45 +00:00
Bill Wendling
967a150cda Make the AttrBuilder creation method of Attribute private so that people won't use it.
llvm-svn: 174023
2013-01-31 01:51:27 +00:00
Bill Wendling
bc16a254b0 Revert for now:
--- Reverse-merging r174010 into '.':
U    include/llvm/IR/Attributes.h
U    lib/IR/Verifier.cpp
U    lib/IR/Attributes.cpp

llvm-svn: 174012
2013-01-31 01:04:51 +00:00
Bill Wendling
d1d96ba2d8 Remove the AttrBuilder version of the Attribute::get function.
The AttrBuilder is there to build up multiple attributes. The Attribute class
represents only one attribute at a time. So remove this unnecessary builder
creator method.

llvm-svn: 174010
2013-01-31 00:53:21 +00:00
Bill Wendling
b7a478403d Make sure that the Attribute object represents one attribute only.
Several places were still treating the Attribute object as respresenting
multiple attributes. Those places now use the AttributeSet to represent
multiple attributes.

llvm-svn: 174003
2013-01-31 00:29:54 +00:00
Bill Wendling
afbeb93c35 Remove addRetAttributes and addFnAttributes, which aren't useful abstractions.
llvm-svn: 173992
2013-01-30 23:40:31 +00:00
Bill Wendling
c926e2a691 Convert typeIncompatible to return an AttributeSet.
There are still places which treat the Attribute object as a collection of
attributes. I'm systematically removing them.

llvm-svn: 173990
2013-01-30 23:07:40 +00:00
Michael Gottesman
2f09172b35 Doxygenified some comments in IRBuilder.h.
llvm-svn: 173986
2013-01-30 22:56:31 +00:00
Michael Gottesman
1e063570f0 Removed CreateFPExtOrFPTrunc for now until I have the time to get in my vector convert patch.
What I thought was going to be a quick thing has extended out a little bit in
time *sigh*. So after some thought in order to not cruft up the tree I am
removing this for now since it is the right thing to do.

llvm-svn: 173985
2013-01-30 22:53:21 +00:00
Michael Gottesman
2a32ac5a3e Encapsulate testing that we have an iOS Triple in Triple.h in the method isiOS
so we follow the convention that all other platforms follow by having an is*
test method.

llvm-svn: 173983
2013-01-30 22:38:19 +00:00
Bill Wendling
bc6ec815db Use the number of 'slots' in the AttributeSetImpl being 0 to indicate that the AttributeSet is empty.
llvm-svn: 173962
2013-01-30 19:39:21 +00:00
Eli Bendersky
128c58bab5 Clean up whitespace and indentation a bit
llvm-svn: 173960
2013-01-30 19:24:23 +00:00
Dmitri Gribenko
2a17a96403 LLDB uses ConvertUTF16toUTF8, remove #ifdef
llvm-svn: 173936
2013-01-30 15:10:12 +00:00
Dmitri Gribenko
2eaa3b382c Move UTF conversion routines from clang/lib/Basic to llvm/lib/Support
This is required to use them in TableGen.

llvm-svn: 173923
2013-01-30 12:05:05 +00:00
Jack Carter
7c25c2553c This patch implements runtime ARM specific
setting of ELF header e_flags.

Contributer: Jack Carter
 
llvm-svn: 173885
2013-01-30 02:24:33 +00:00
Jack Carter
7cd7b1f749 This patch reworks how llvm targets set
and update ELF header e_flags.

Currently gathering information such as symbol, 
section and data is done by collecting it in an 
MCAssembler object. From MCAssembler and MCAsmLayout 
objects ELFObjectWriter::WriteObject() forms and 
streams out the ELF object file.

This patch just adds a few members to the MCAssember 
class to store and access the e_flag settings. It 
allows for runtime additions to the e_flag by 
assembler directives. The standalone assembler can 
get to MCAssembler from getParser().getStreamer().getAssembler().

This patch is the generic infrastructure and will be
followed by patches for ARM and Mips for their target 
specific use.

Contributer: Jack Carter
 
llvm-svn: 173882
2013-01-30 02:09:52 +00:00
NAKAMURA Takumi
546831d369 [autoconf]: Fix description in HAVE_CRASHREPORTER_INFO.
http://llvm-reviews.chandlerc.com/D332

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
llvm-svn: 173879
2013-01-30 01:38:03 +00:00
Bill Wendling
d6a0aeff10 Add a couple of accessor methods to get the kind and values of an attribute.
llvm-svn: 173828
2013-01-29 20:45:34 +00:00
Bill Wendling
0bbff6db82 Convert getAttributes() to return an AttributeSetNode.
The AttributeSetNode contains all of the attributes. This removes one (hopefully
last) use of the Attribute class as a container of multiple attributes.

llvm-svn: 173761
2013-01-29 03:20:31 +00:00
Evan Cheng
2e2cde560f Teach SDISel to combine fsin / fcos into a fsincos node if the following
conditions are met:
1. They share the same operand and are in the same BB.
2. Both outputs are used.
3. The target has a native instruction that maps to ISD::FSINCOS node or
   the target provides a sincos library call.

Implemented the generic optimization in sdisel and enabled it for
Mac OSX. Also added an additional optimization for x86_64 Mac OSX by
using an alternative entry point __sincos_stret which returns the two
results in xmm0 / xmm1.

rdar://13087969
PR13204

llvm-svn: 173755
2013-01-29 02:32:37 +00:00
Bill Wendling
dcd0d9c27f Use an AttrBuilder to generate the correct AttributeSet.
We no longer accept an encoded integer as representing all of the
attributes. Convert this via the AttrBuilder class into an AttributeSet with the
correct representation (an AttributeSetImpl that holds a list of Attribute
objects).

llvm-svn: 173750
2013-01-29 01:43:29 +00:00
Bill Wendling
2c8641d0f2 S'more small non-functional changes in comments and #includes.
llvm-svn: 173738
2013-01-29 00:48:16 +00:00
Bill Wendling
ddceb848ff Reorder some functions and add comments. No functionality change.
llvm-svn: 173733
2013-01-29 00:34:06 +00:00
Bill Wendling
a15e00ef6c Try to appease some broken compilers by using 'unsigned' instead of 'uint64_t'.
llvm-svn: 173725
2013-01-28 22:33:39 +00:00
Bill Wendling
1d30e7f569 Remove the AttributeWithIndex class.
The AttributeWithIndex class exposed the interior structure of the AttributeSet
class. That was gross. Remove it and all of the code that relied upon it.

llvm-svn: 173722
2013-01-28 21:55:20 +00:00
Dan Gohman
4dd335efb1 Add a comment mentioning that InstructionSimplify routines do,
in fact, resolve undef uses.

llvm-svn: 173721
2013-01-28 21:45:32 +00:00
Bill Wendling
fbc4fffb48 Mid-air collision. reapply r173656.
llvm-svn: 173661
2013-01-28 05:51:40 +00:00
Bill Wendling
29a48a09e5 Rewrite the removeAttr() method.
This now uses the AttributeSet object instead of the Attribute /
AttributeWithIndex objects. It's fairly simple now. It goes through all of the
subsets before the one we're modifying, adds them to the new set. It then adds
the modified subset (with the requested attributes removed). And then adds the
rest of the subsets.

llvm-svn: 173660
2013-01-28 05:44:14 +00:00
Bill Wendling
bc011af4a0 Rewrite the addAttr() method.
This now uses the AttributeSet object instead of the Attribute /
AttributeWithIndex objects. It's fairly simple now. It goes through all of the
subsets before the one we're modifying, adds them to the new set. It then adds
the modified subset. And then adds the rest of the subsets.

llvm-svn: 173659
2013-01-28 05:23:28 +00:00
NAKAMURA Takumi
e02fd3448b Revert r173646, "Use proper type for the index."
Unfortunately, msvc miscompiles it. Investigating.

llvm-svn: 173656
2013-01-28 04:29:01 +00:00
Michael Gottesman
3d8ed99b1f Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer.
llvm-svn: 173647
2013-01-28 01:35:51 +00:00
Bill Wendling
5534b9814d Use proper type for the index.
llvm-svn: 173646
2013-01-28 01:30:29 +00:00
Bill Wendling
5783e1e4be Use proper return type for attribute index.
llvm-svn: 173639
2013-01-27 23:50:44 +00:00
Bill Wendling
dd604e3b22 Push the calculation of the 'Raw' attribute mask down into the implementation. It in turn uses the correct list for calculating the 'Raw' value.
llvm-svn: 173637
2013-01-27 23:41:29 +00:00
Bill Wendling
fefacc5936 Don't erase these methods. They're used during testing.
llvm-svn: 173636
2013-01-27 22:46:17 +00:00
Bill Wendling
89179c02f8 Add special 'get' methods to create an Attribute with an alignment. Also do some random cleanup. No functionality change.
llvm-svn: 173635
2013-01-27 22:43:04 +00:00
Bill Wendling
bc0a92c4bd s/AttrList/pImpl/g in AttributeSet. No functionality change.
llvm-svn: 173628
2013-01-27 21:23:46 +00:00
Bill Wendling
8e66ee6471 Fix miscompile. Add back the use of the ArrayRef version of the ::get method.
llvm-svn: 173613
2013-01-27 10:28:39 +00:00
Bill Wendling
d3b2ea02ca Rearrange some deckchairs. Moving the class before it's use.
llvm-svn: 173612
2013-01-27 10:00:13 +00:00
Bill Wendling
920cb6d54f Remove dead methods.
llvm-svn: 173611
2013-01-27 09:55:44 +00:00
Bill Wendling
d8d5c37332 Hide the method that creates an AttributeSet with AttributeWithIndexes.
This method will go away once AttributeWithIndex goes away. In the meantime,
hide it from general use.

llvm-svn: 173607
2013-01-27 03:35:32 +00:00
David Blaikie
cb286de665 PR14566: Debug Info: Removing top level lexical blocks
This adds support for LLVM to accept metadata that doesn't include a top level
lexical block in a function. Specifically LLVM couldn't handle this when there
were file changes relating to these blocks. I've updated a few test cases to
ensure other functionality (such as inlining) isn't affected by this change, but
haven't pervasively updated all the test cases.

llvm-svn: 173592
2013-01-26 21:55:23 +00:00
David Blaikie
86f83366e8 IRBuilder: Remove redundant check around SetInstDebugLocation call.
llvm-svn: 173591
2013-01-26 21:55:19 +00:00
NAKAMURA Takumi
ecc293a43b Object/RelocVisitor: Add minimal support, R_MIPS_32, for mips.
It fixes llvm-dwarfdump for mips and mipsel.

llvm-svn: 173567
2013-01-26 08:27:36 +00:00
NAKAMURA Takumi
3e419cb67d Object/RelocVisitor: Add minimal support, R_PPC64_ADDR32, for ppc64.
It fixes llvm-dwarfdump for ppc64-elf.

llvm-svn: 173566
2013-01-26 08:27:29 +00:00
NAKAMURA Takumi
fad4802abd RelocVisitor::visit(): Set hasError in the default path.
llvm-svn: 173565
2013-01-26 08:27:23 +00:00
Andrew Kaylor
2677c75e5d Add DIContext::getLineInfoForAddressRange() function and test. This function allows a caller to obtain a table of line information for a function using the function's address and size.
llvm-svn: 173537
2013-01-26 00:28:05 +00:00
Bill Wendling
d5b4c9438f Convert BuildLibCalls.cpp to using the AttributeSet methods instead of AttributeWithIndex.
llvm-svn: 173536
2013-01-26 00:03:11 +00:00
Bill Wendling
46a6a632dc Remove dead method.
llvm-svn: 173524
2013-01-25 23:14:36 +00:00
Bill Wendling
47efd8b988 Remove some introspection functions.
The 'getSlot' function and its ilk allow introspection into the AttributeSet
class. However, that class should be opaque. Allow access through accessor
methods instead.

llvm-svn: 173522
2013-01-25 23:09:36 +00:00
Andrew Kaylor
c9fa0590eb Add support for applying in-memory relocations to the .debug_line section and, in the case of ELF files, using symbol addresses when available for relocations to the .debug_info section. Also extending the llvm-rtdyld tool to add the ability to dump line number information for testing purposes.
llvm-svn: 173517
2013-01-25 22:50:58 +00:00
Reid Kleckner
2796011be7 Add parens to suppress an MSVC 2012 << precedence warning
It doesn't seem to like instantiating the isUInt<unsigned N> template
with 6+3, and then doing <<N.

llvm-svn: 173507
2013-01-25 22:12:45 +00:00
Nick Lewycky
4c1f132b0c Add an insert() method to MapVector. Adds the first MapVector unit test.
llvm-svn: 173505
2013-01-25 22:11:02 +00:00
Bill Wendling
4e9de7c89b Add an accessor method to get the slot's index. This will limit the use of AttributeWithIndex.
llvm-svn: 173495
2013-01-25 21:30:53 +00:00
David Blaikie
d448736e8c This is no trule.
llvm-svn: 173487
2013-01-25 20:47:58 +00:00
Eli Bendersky
1b58747212 Add command-line flags for DWARF dumping.
Flags for dumping specific DWARF sections added in lib/DebugInfo and
llvm-dwarfdump.

llvm-svn: 173480
2013-01-25 20:26:43 +00:00
Hal Finkel
4279c8573b Add an addition operator to TableGen
This adds an !add(a, b) operator to tablegen; this will be used
to cleanup the PPC register definitions.

llvm-svn: 173445
2013-01-25 14:49:08 +00:00
Andrew Trick
efbba4d345 MachineScheduler support for viewGraph.
llvm-svn: 173432
2013-01-25 07:45:29 +00:00
Andrew Trick
8da14ff342 ScheduleDAG: colorize the DOT graph and improve formatting.
llvm-svn: 173431
2013-01-25 07:45:25 +00:00
Andrew Trick
1e8e17b0f3 ScheduleDAG: Added isBoundaryNode to conveniently detect a common corner case.
This fixes DAG subtree analysis at the boundary.

llvm-svn: 173427
2013-01-25 06:52:30 +00:00