1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

342 Commits

Author SHA1 Message Date
Tom Stellard
c0349078dc C API: Add LLVMGetBufferStart()
llvm-svn: 179646
2013-04-16 23:12:47 +00:00
Tom Stellard
18edd84b8a C API: Add LLVMAddTargetDependentFunctionAttr()
llvm-svn: 179645
2013-04-16 23:12:43 +00:00
Bill Wendling
024e24d7f3 Print out the target-independent attributes in a comment before the function definition.
llvm-svn: 179622
2013-04-16 20:55:47 +00:00
Eli Bendersky
6bcfbc1d6e Cleanup naming: DataLayout s/TD/DL/
llvm-svn: 179601
2013-04-16 15:41:18 +00:00
Hans Wennborg
6c6c92e0af Add four new functions and one new enum to the C API:
LLVMGetThreadLocalMode - exposes GlobalVariable::getThreadLocalMode
LLVMSetThreadLocalMode - exposes GlobalVariable::setThreadLocalMode
LLVMIsExternallyInitialized - exposes GlobalVariable::isExternallyInitialized
LLVMSetExternallyInitialized - exposes GlobalVariable::setExternallyInitialized
LLVMThreadLocalMode - maps to GlobalVariable::ThreadLocalMode

Patch by Moritz Maxeiner!

llvm-svn: 179588
2013-04-16 08:58:59 +00:00
Benjamin Kramer
fedd86f086 Fix a scalability issue with complex ConstantExprs.
This is basically the same fix in three different places. We use a set to avoid
walking the whole tree of a big ConstantExprs multiple times.

For example: (select cmp, (add big_expr 1), (add big_expr 2))
We don't want to visit big_expr twice here, it may consist of thousands of
nodes.

The testcase exercises this by creating an insanely large ConstantExprs out of
a loop. It's questionable if the optimizer should ever create those, but this
can be triggered with real C code. Fixes PR15714.

llvm-svn: 179458
2013-04-13 12:53:18 +00:00
Benjamin Kramer
b7bf971543 Fix a disconcerting bug in Value::isUsedInBasicBlock, which gave wrong answers for blocks larger than 3 instrs.
Also add a unit test. PR15727.

llvm-svn: 179370
2013-04-12 08:33:11 +00:00
Eli Bendersky
70bff7a437 Measure time that IR parsing took as part of the -time-passes measurement.
llvm-svn: 178662
2013-04-03 15:33:45 +00:00
Eric Christopher
c6f97cf1a0 Support and test template arguments for unions.
llvm-svn: 178586
2013-04-02 22:55:56 +00:00
Eric Christopher
41b88bf92e Reformat arguments.
llvm-svn: 178585
2013-04-02 22:55:52 +00:00
David Blaikie
377434ec76 Revert "Adding DIImportedModules to DIScopes."
This reverts commit 342d92c7a0adeabc9ab00f3f0d88d739fe7da4c7.

Turns out we're going with a different schema design to represent
DW_TAG_imported_modules so we won't need this extra field.

llvm-svn: 178215
2013-03-28 02:44:59 +00:00
David Blaikie
5289cb3fe6 Fix comment
llvm-svn: 178155
2013-03-27 17:50:12 +00:00
Benjamin Kramer
f47297d659 Silence warning about mixing || in &&, fix up 80-cols.
llvm-svn: 178144
2013-03-27 15:03:14 +00:00
David Blaikie
75da1f2b54 Adding DIImportedModules to DIScopes.
This is just the basic groundwork for supporting DW_TAG_imported_module but I
wanted to commit this before pushing support further into Clang or LLVM so that
this rather churny change is isolated from the rest of the work. The major
churn here is obviously adding another field (within the common DIScope prefix)
to all DIScopes (files, classes, namespaces, lexical scopes, etc). This should
be the last big churny change needed for DW_TAG_imported_module/using directive
support/PR14606.

llvm-svn: 178099
2013-03-27 00:07:26 +00:00
David Blaikie
597cfb7439 Make DIBuilder::createClassType more type safe by returning DICompositeType rather than DIType
llvm-svn: 178091
2013-03-26 23:46:39 +00:00
David Blaikie
9f980d923f DebugInfo: more support for mutating DICompositeType to reduce magic number usage in Clang
llvm-svn: 178090
2013-03-26 23:46:36 +00:00
David Blaikie
5d99940617 Debug Info: Provide a means to update the members of a composite type
This will be used to factor out some uses of magic number operand offsets
inside Clang where these fields were updated in an effort to resolve forward
declarations/circular references.

llvm-svn: 178078
2013-03-26 21:59:17 +00:00
David Blaikie
55942ffd01 Swap the DIFile in DILexicalBlockFile out for the raw name/directory pair
This is the last change in transitioning all DIScopes to have a common prefix.

llvm-svn: 177756
2013-03-22 20:18:46 +00:00
David Blaikie
43ccb69f6a reorder the fields in DILexicalBlockFile to match the common prefix for DIScopes
llvm-svn: 177754
2013-03-22 19:13:22 +00:00
Bill Wendling
52cf114e8c Revert r177675. This is language-specific and shouldn't be in the API.
llvm-svn: 177748
2013-03-22 18:46:32 +00:00
David Blaikie
c2fe0cb2ae Refactor out the DIFile parameter to DILexicalBlock to refer to the raw file/directory pair
llvm-svn: 177742
2013-03-22 17:33:20 +00:00
Arnaud A. de Grandmaison
7a4226244b InstCombine: Improve the result bitvect type when folding (cmp pred (load (gep GV, i)) C) to a bit test.
The original code used i32, and i64 if legal. This introduced unneeded
casts when they aren't legal, or when the index variable i has another
type. In order of preference: try to use i's type; use the smallest
fitting legal type (using an added DataLayout method); default to i32.
A testcase checks that this works when the index gep operand is i16.

Patch by : Ahmed Bougacha <ahmed.bougacha@gmail.com>
Reviewed by : Duncan

llvm-svn: 177712
2013-03-22 08:25:01 +00:00
David Blaikie
620d0ae359 Reorder the DIFile field in DILexicalBlock to become a prefix common with other DIScopes
llvm-svn: 177703
2013-03-22 05:47:44 +00:00
David Blaikie
c9d598113b Refactor the filename/directory information in DISubprogram to refer directly to the pair rather than the DIFile.
llvm-svn: 177677
2013-03-21 23:08:34 +00:00
Bill Wendling
05a454cd6d Add a query to tell if a landing pad has a catch-all.
llvm-svn: 177675
2013-03-21 23:01:03 +00:00
David Blaikie
648a81f32c Move the DIFile in DISubprogram to the beginning to be a common prefix along with other DIScopes
llvm-svn: 177674
2013-03-21 22:29:36 +00:00
David Blaikie
67c9dc82dc Remove unused field in DISubprogram
llvm-svn: 177661
2013-03-21 20:28:52 +00:00
Chandler Carruth
8613f86d1c Hoist the definition of getTypeSizeInBits to be inlinable and in the
header.

This method is called in the hot path for *many* passes, SROA is what
caught my interest. A common pattern is that which branch of the switch
should be taken is known in the callsite and so it is a very good
candidate for inlining and simplification. Moving it into the header
allows the optimizer to fold a lot of boring, repeatitive code in
callers of this routine.

I'm seeing pretty significant speedups in parts of SROA and I suspect
other passes will see similar speedups if they end up working with type
sizes frequently. I've not seen any significant growth of the binaries
as a consequence, but let me know if you see anything suspicious here.

llvm-svn: 177632
2013-03-21 09:52:22 +00:00
David Blaikie
b2d35852ea Debug info: refactor the first field of DICompileUnit to be a raw file/directory pair
This removes the DICompileUnit special case from DIScope.

llvm-svn: 177610
2013-03-20 23:58:12 +00:00
Jakub Staszak
9d539599f4 Use pre-inc, pre-dec when possible.
They are generally faster (at least not slower) than post-inc, post-dec.

llvm-svn: 177608
2013-03-20 23:56:19 +00:00
David Blaikie
78d3bdea74 Debug Info: Swap the 2nd and 3rd parameters to DICompileUnit to match the common DIScope prefix
llvm-svn: 177595
2013-03-20 22:52:54 +00:00
David Blaikie
30abbc718f Remove unused field in DICompileUnit
llvm-svn: 177590
2013-03-20 22:34:33 +00:00
Chris Lattner
b012286d85 minor code style cleanup.
llvm-svn: 177576
2013-03-20 21:04:53 +00:00
David Blaikie
6ddc4bafc5 Refactor file/directory path in namespace debug info to refer directly to the pair rather than the DIFile
(paired to a Clang test - excuse the buildbot skew/fallout)

llvm-svn: 177566
2013-03-20 19:39:15 +00:00
David Blaikie
6089c97e3f DIBuilder: allow linkage name to be specified for global variables
Patch by Kai Nacke (kai@redstar.de)

llvm-svn: 177547
2013-03-20 17:49:48 +00:00
David Blaikie
2a48d29317 Reorder the DIFile parameter in DINameSpace
Moving the DIFile parameter to immediately proceed the tag so that it will be a
common prefix with other DIScopes (once the DIFile is replaced with the raw
file/directory pair).

llvm-svn: 177492
2013-03-20 06:27:06 +00:00
David Blaikie
f8be0ba302 Provide more details for DINameSpace debug info in the IR comment annotations
Sorry for the version skew - I should've committed this before the
corresponding Clang test case.

llvm-svn: 177486
2013-03-20 05:14:14 +00:00
David Blaikie
b9f490e28c Refactor the DIFile (2nd) parameter to DITypes to be an MDNode reference to a raw directory/file pair
This makes DIType's first non-tag parameter the same as DIFile's, allowing them
to both share the common implementation of getFilename/getDirectory in DIScope.

llvm-svn: 177467
2013-03-20 00:26:26 +00:00
David Blaikie
dd2f7e5b88 Move the DIFile operand to DITypes from the 4th operand to the 2nd.
This is another step along the way to making all DIScopes have a common prefix
which can be added to in a general manner to support using directives
(DW_TAG_imported_module).

llvm-svn: 177462
2013-03-19 23:25:22 +00:00
David Tweed
5652836d44 The testing to ensure a vector of zeros of type floating point isn't misclassified as negative zero can be simplified, as pointed out by Duncan Sands.
llvm-svn: 177386
2013-03-19 10:16:40 +00:00
David Tweed
1904cbefd1 The optimization a + (-0.0f) -> a was being misapplied to a + (+0.0f) in the vector case (because
we weren't differntiating floating-point zeroinitializers from other zero-initializers)
which was causing problems for code relying upon a + (+0.0f) to, eg, flush denormals to
0. Make the scalar and vector cases have the same behaviour.

llvm-svn: 177279
2013-03-18 11:54:44 +00:00
David Blaikie
32d86f85d9 Fix the build broken in r177239
Seems some accidental C++11 crept in there. Reported by the C++98 buildbots.

llvm-svn: 177241
2013-03-17 21:32:54 +00:00
David Blaikie
3193e0599a Split out filename & directory from DIFile to start generalizing over DIScopes
This is the first step to making all DIScopes have a common metadata prefix (so
that things (using directives, for example) that can appear in any scope can be
added to that common prefix). DIFile is itself a DIScope so the common prefix
of all DIScopes cannot be a DIFile - instead it's the raw filename/directory
name pair.

llvm-svn: 177239
2013-03-17 21:13:55 +00:00
David Blaikie
127d79d573 Remove the unused 4th operand for DIFile debug info metadata
llvm-svn: 176983
2013-03-13 22:05:21 +00:00
Reed Kotler
6f984e6349 Add some additonal attribute helper functions. Test will be on follow
up putback to clang for mips16.

llvm-svn: 176968
2013-03-13 20:20:08 +00:00
David Blaikie
3c701e7671 Refactor filename/directory in DICompileUnit into a DIFile
This is the next step towards making the metadata for DIScopes have a common
prefix rather than having to delegate based on their tag type.

llvm-svn: 176913
2013-03-13 00:01:35 +00:00
David Blaikie
98d9ccffb8 Remove unused "isMain" field from DICompileUnit
llvm-svn: 176910
2013-03-12 22:43:04 +00:00
David Blaikie
c37a0a822a Update debug info test cases with empty SplitDebugFilename field.
This could be 'null' or the empty string, DIDescriptor::getStringField
coalesces the two cases anyway so it's just a matter of legible/efficient
representation.

The change in behavior of the DICompileUnit::get* functions could be
subsumed by the full verification check - but ideally that should just be an
assertion if we could front-load the actual debug info metadata failure paths.

llvm-svn: 176907
2013-03-12 22:25:36 +00:00
Pete Cooper
7a5199df98 Add a doFinalization method to the DataLayout pass.
This pass is meant to be immutable, however it holds mutable state to cache StructLayouts.
This method will allow the pass manager to clear the mutable state between runs.

Note that unfortunately it is still necessary to have the destructor, even though it does the
same thing as doFinalization.  This is because most TargetMachines embed a DataLayout on which
doFinalization isn't run as its never added to the pass manager.

I also didn't think it was necessary to complication things with a deInit method for which
doFinalization and ~DataLayout both call as there's only one field of mutable state.  If we had
more fields to finalize i'd have added this.

llvm-svn: 176877
2013-03-12 17:37:31 +00:00
David Blaikie
cae22d7ca6 Remove support for versioned debug info.
Versioned debug info support has been a burden to maintain & also compromised
current debug info verification by causing test cases testing old debug info to
remain rather than being updated to the latest. It also makes it hard to add or
change the metadata schema by requiring various backwards-compatibility in the
DI* hierarchy.

So it's being removed in preparation for new changes to the schema to tidy up
old/unnecessary fields and add new fields needed for new debug info (well, new
to LLVM at least).

The more surprising part of this is the changes to DI*::Verify - this became
necessary due to the changes to AsmWriter. AsmWriter was relying on the version
test to decide which bits of metadata were actually debug info when printing
the comment annotations. Without the version information the tag numbers were
too common & it would print debug info on random metadata that happened to
start with an integer that matched a tag number. Instead this change makes the
Verify functions more precise (just adding "number of operands" checks - not
type checking those operands yet) & relies on that to decide which metadata is
debug info metadata.

llvm-svn: 176838
2013-03-11 23:39:23 +00:00
David Blaikie
cb48c2473b Add asserts to DIBuilder & fix DINameSpace::Verify to allow unnamed namespaces.
llvm-svn: 176837
2013-03-11 23:21:19 +00:00
David Blaikie
e0efb3660f Assert to bounds check MDNode::getOperand.
The getOperandPtr utility already bounds checks, but allows one-off-the-end.
This assert should catch the cases that could previously have been dereferencing
these one-off-the-end pointer. Happily, no cases of this came up with this
change.

llvm-svn: 176721
2013-03-08 21:08:23 +00:00
Benjamin Kramer
91b6dfab6b Replace temporary vectors with arrays.
llvm-svn: 176651
2013-03-07 20:53:34 +00:00
Nadav Rotem
1a77ebbc40 ArrayRef has a OneElt constructor. Beautify the code.
llvm-svn: 176604
2013-03-07 01:38:04 +00:00
Nadav Rotem
a79262c9eb Switch from std::vector to ArrayRef. Speedup FoldBitCast by 5x.
llvm-svn: 176602
2013-03-07 01:30:40 +00:00
Shuxin Yang
048b100cc5 Memory Dependence Analysis (not mem-dep test) take advantage of "invariant.load" metadata.
The "invariant.load" metadata indicates the memory unit being accessed is immutable.
A load annotated with this metadata can be moved across any store.

As I am not sure if it is legal to move such loads across barrier/fence, this
change dose not allow such transformation.

rdar://11311484

Thank Arnold for code review.

llvm-svn: 176562
2013-03-06 17:48:48 +00:00
Peter Collingbourne
8b72c382d6 Modify {Call,Invoke}Inst::addAttribute to take an AttrKind.
llvm-svn: 176397
2013-03-02 01:20:18 +00:00
Jean-Luc Duprat
29a7c88237 Removed extraneous #include "LLVMContextImpl.h" from lib/IR/Module.cpp
llvm-svn: 176382
2013-03-01 21:37:24 +00:00
Michael Ilseman
6bd55f4125 Cache the result of Function::getIntrinsicID() in a DenseMap attached to the LLVMContext.
This reduces the time actually spent doing string to ID conversion and shows a 10% improvement in compile time for a particularly bad case that involves ARM Neon intrinsics (these have many overloads).

Patch by Jean-Luc Duprat!

llvm-svn: 176365
2013-03-01 18:48:54 +00:00
Bill Wendling
c631018808 Don't add the 'Value' string if there isn't one.
This was causing the folding set to fail to fold attributes, because it was
being calculated in one spot without an empty values string but here with an
empty values string.

llvm-svn: 176301
2013-02-28 21:17:03 +00:00
Bill Wendling
f8dd7555be Don't add an attribute that already exists and don't remove an attribute that doesn't exist.
llvm-svn: 176289
2013-02-28 19:17:40 +00:00
Meador Inge
c24a74205b IR: Don't constant fold GEP bitcasts between different address spaces
PR15262 reported a bug where the following instruction:

  i8 getelementptr inbounds i8* bitcast ([4 x i8] addrspace(12)* @buf to i8*),
                                i32 2

was getting folded into:

  addrspace(12)* getelementptr inbounds ([4 x i8] addrspace(12)* @buf, i32 0,
                                        i32 2)

This caused instcombine to crash because the original instruction and
the folded instruction have different types.  The issue was fixed by
disallowing bitcasts between different address spaces to be folded away.

llvm-svn: 176156
2013-02-27 02:26:42 +00:00
Kostya Serebryany
f560b78692 Unify clang/llvm attributes for asan/tsan/msan (LLVM part)
These are two related changes (one in llvm, one in clang).
LLVM: 
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory

CLANG: 
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))

for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S

llvm-svn: 176075
2013-02-26 06:58:09 +00:00
Michael Ilseman
46cd4a307a Use a DenseMap instead of a std::map for AnalysisID -> Pass* maps. This reduces the pass-manager overhead from FPPassManager::runOnFunction() by about 10%.
llvm-svn: 176072
2013-02-26 01:31:59 +00:00
David Blaikie
31258c581d DIBuilder: support structs with vtable pointers in the same way as classes
llvm-svn: 176004
2013-02-25 01:07:18 +00:00
Eric Christopher
fb90604970 Add a field to the compile unit of where we plan on splitting out
the debug info for -gsplit-dwarf so we can encode that location
in the skeleton cu.

llvm-svn: 175933
2013-02-22 23:50:04 +00:00
Eric Christopher
446940d29d Add a TODO and explain when we can get rid of the isMain field.
llvm-svn: 175932
2013-02-22 23:50:01 +00:00
Bill Wendling
db672f1bc8 Use references to attribute groups on the call/invoke instructions.
Listing all of the attributes for the callee of a call/invoke instruction is way
too much and makes the IR unreadable. Use references to attributes instead.

llvm-svn: 175877
2013-02-22 09:09:42 +00:00
Bill Wendling
1c47920d57 Remove warning about default covering no cases.
llvm-svn: 175846
2013-02-22 00:50:09 +00:00
Bill Wendling
2f6959fb95 Add a bitmask for NoBuiltin. This should *not* be used.
llvm-svn: 175843
2013-02-22 00:40:12 +00:00
Bill Wendling
eecb534c87 Implement the NoBuiltin attribute.
The 'nobuiltin' attribute is applied to call sites to indicate that LLVM should
not treat the callee function as a built-in function. I.e., it shouldn't try to
replace that function with different code.

llvm-svn: 175835
2013-02-22 00:12:35 +00:00
Bill Wendling
34f1dacd7d Don't assert on empty attributes.
llvm-svn: 175785
2013-02-21 19:46:51 +00:00
Bill Wendling
99d51760ba Add and remove the attribute from the correct slot.
The slot that we're adding/removing the attribute from may not be the same as
the attribute coming in. Make sure that they match up before we try to
add/remove them.
PR15313

llvm-svn: 175684
2013-02-20 23:04:11 +00:00
Bill Wendling
74351693ea Modify the LLVM assembly output so that it uses references to represent function attributes.
This makes the LLVM assembly look better. E.g.:

     define void @foo() #0 { ret void }
     attributes #0 = { nounwind noinline ssp }

llvm-svn: 175605
2013-02-20 07:21:42 +00:00
Bill Wendling
11a5b30dde Add the function attributes from an inline asm call. These don't have declarations that set the attribute groups, so we must do it on our own.
llvm-svn: 175577
2013-02-20 00:04:41 +00:00
Nadav Rotem
f1aab5f6b7 Fix a bug in mayHaveSideEffects. Functions that do not return are now considered as instructions with side effects.
rdar://13227456

llvm-svn: 175553
2013-02-19 20:02:09 +00:00
Nadav Rotem
9eca7cc973 Fix a bug that was found by the clang static analyzer. The var "AT" is null so we cant deref it.
llvm-svn: 175550
2013-02-19 19:36:59 +00:00
Benjamin Kramer
3137f73f0e Futureproof AttrBuild if we ever have more than 64 attr enum values.
Currently we're at 34. Bitset should compile into virtually the same code as
uint64_t here.

llvm-svn: 175437
2013-02-18 12:09:51 +00:00
David Blaikie
136cd29e34 DIBuilder: Correct the null/0 type of trailing fields in struct debug info.
Paired with an Clang commit so this may cause temporary build failures.

llvm-svn: 175426
2013-02-18 07:27:30 +00:00
David Blaikie
5a469eb56d DIBuilder: Add function and method definitions to the list of all subprograms
Previously we seemed to be assuming that all functions were definitions and all
methods were declarations. This may be consistent with how Clang uses DIBuilder
but doesn't have to be true of all clients (such as DragonEgg).

llvm-svn: 175423
2013-02-18 07:10:22 +00:00
David Blaikie
4cbcad5731 Narrow the return types of a few DIBuilder utility functions.
llvm-svn: 175421
2013-02-18 06:41:57 +00:00
Duncan Sands
b50d4cfa0b Add multithreading functions and shutdown to the C API. Patch by Moritz
Maxeiner.

llvm-svn: 175398
2013-02-17 16:35:51 +00:00
Benjamin Kramer
920e1f81a3 GCC doesn't like ++ on enums.
llvm-svn: 175373
2013-02-16 19:22:28 +00:00
Benjamin Kramer
493e1a2895 Turn the enum attributes DenseSet in AttrBuilder into a set of bits.
Avoids malloc and is a lot denser. We lose iteration over target independent
attributes, but that's a strange interface anyways and didn't have any users
outside of AttrBuilder.

llvm-svn: 175370
2013-02-16 19:13:18 +00:00
Bill Wendling
12753ce9bc Simplify the 'operator<' for the attribute object.
llvm-svn: 175252
2013-02-15 05:25:26 +00:00
Anna Zaks
ebd25dd190 Revert "Simplify the attributes '<' comparison function."
This reverts commit 82c101153fe7b35bce48781fab038e1b8f31a7bd.

llvm-svn: 175250
2013-02-15 04:15:55 +00:00
Bill Wendling
67e51ec173 Simplify the attributes '<' comparison function.
llvm-svn: 175235
2013-02-15 00:55:08 +00:00
Bill Wendling
0b2ac39b29 s/bool/LLVMBool/
llvm-svn: 175204
2013-02-14 19:40:27 +00:00
Bill Wendling
cff8f3e5f2 Add two new functions to the C API:
LLVMCreateMemoryBufferWithMemoryRange - exposes MemoryBuffer::getMemBuffer
 LLVMCreateMemoryBufferWithMemoryRangeCopy - exposes MemoryBuffer::getMemBufferCopy

Patch by Moritz Maxeiner!

llvm-svn: 175199
2013-02-14 19:11:28 +00:00
Bill Wendling
8d3d898234 Use array_pod_sort.
llvm-svn: 175048
2013-02-13 09:26:26 +00:00
Bill Wendling
45be8c5d89 Add some accessor and query methods for retrieving Attribute objects and such.
llvm-svn: 175046
2013-02-13 08:42:21 +00:00
Guy Benyei
92dac48079 Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration.
llvm-svn: 175006
2013-02-12 21:21:59 +00:00
Bill Wendling
03550a5d33 Support string attributes in the AttrBuilder.
llvm-svn: 174948
2013-02-12 07:56:49 +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
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
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
Bill Wendling
9d49d49b2a The 'Raw' method cannot handle 'string' attributes. Don't even try.
llvm-svn: 174848
2013-02-10 23:18:05 +00:00
Bill Wendling
3eaebd7f41 Handle string attributes in the AttrBuilder.
llvm-svn: 174834
2013-02-10 10:13:23 +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
Bill Wendling
eb7e06de6d Add accessor for the LLVMContext.
llvm-svn: 174824
2013-02-10 05:00:40 +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
Dan Gohman
9986030aee Minor cleanup.
llvm-svn: 174756
2013-02-08 22:01:47 +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
Craig Topper
4ba9d33da9 Remove extra blank line between closing curly brace and 'else'
llvm-svn: 174492
2013-02-06 06:50:38 +00:00
Craig Topper
d4a8a10013 Remove unused private field to suppress a build warning.
llvm-svn: 174491
2013-02-06 06:48:10 +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
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
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
15a605b34e Added LLVM Asm/Bitcode Reader/Writer support for new IR keyword externally_initialized.
llvm-svn: 174340
2013-02-05 05:57:38 +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
David Blaikie
3f58472b83 [DebugInfo] remove more node indirection (this time from the subprogram's variable lists)
llvm-svn: 174305
2013-02-04 05:56:36 +00:00
David Blaikie
727f1e8774 PR15149: crash when printing debug info metadata containing an invalid language spec
llvm-svn: 174304
2013-02-04 05:31:37 +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
David Blaikie
7c3ec60da7 Remove the (apparently) unnecessary debug info metadata indirection.
The main lists of debug info metadata attached to the compile_unit had an extra
layer of metadata nodes they went through for no apparent reason. This patch
removes that (& still passes just as much of the GDB 7.5 test suite). If anyone
can show evidence as to why these extra metadata nodes are there I'm open to
reverting this patch & documenting why they're there.

llvm-svn: 174266
2013-02-02 05:56:24 +00:00
Bill Wendling
16d277acec Remove AttrBuilder::Raw().
llvm-svn: 174251
2013-02-02 00:52:44 +00:00
Bill Wendling
7a69360bb2 Use the AttributeSet's iterators.
Use the AttributeSet's iterators in AttrBuilder::hasAttributes() when
determining of the intersection of the AttrBuilder and AttributeSet is non-null.

llvm-svn: 174250
2013-02-02 00:42:06 +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
5c32451ec5 Remove some dead code, improve some asserts, and other assorted changes. No functionality change.
llvm-svn: 174132
2013-02-01 01:04:27 +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
f2edd83fe8 Use iterators instead of relying upon a bitmask of attributes to remove attributes from an AttrBuilder.
llvm-svn: 174123
2013-02-01 00:13:50 +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
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
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
Bill Wendling
0b0b695442 Add support for emitting a string attribute.
Attributes that are strings are typically target-dependent attributes. They are
of this form in the IR:

   "attr"
   "attr" = "val"

llvm-svn: 174090
2013-01-31 20:59:05 +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
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
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
Dan Gohman
e688173b6b Fix ConstantFold's folding of icmp instructions to recognize that,
for example, a one-past-the-end pointer from one global variable may
be equal to the base pointer of another global variable.

llvm-svn: 173995
2013-01-31 00:01:45 +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
Bill Wendling
045f95da4a Remove redundant code.
It was creating a new AttrBuilder when we could just fill in the AttrBuilder
we're building.

llvm-svn: 173975
2013-01-30 21:22:59 +00:00
Eli Bendersky
128c58bab5 Clean up whitespace and indentation a bit
llvm-svn: 173960
2013-01-30 19:24:23 +00:00
Bill Wendling
67fe3298b1 Attempt to fix dragonegg. Use the number of slots to determine if the AttributeSet has attributes or not.
llvm-svn: 173902
2013-01-30 06:54:41 +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
06e3c96d61 s/Data/Kind/g. No functionality change.
llvm-svn: 173827
2013-01-29 20:37:10 +00:00
NAKAMURA Takumi
f9f76dc502 AttributeSet::get(): Fix a valgrind error. It doesn't affect actual behavior, though.
Don't touch I->first on the end iterator, I == E!

llvm-svn: 173804
2013-01-29 15:18:16 +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
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
4754ae5130 Convert the AttrBuilder into a list of Attributes instead of one Attribute object that holds all of its attributes.
llvm-svn: 173742
2013-01-29 01:02:03 +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