Rafael Espindola
026d152e58
Reject uses of unnamed_addr in declarations.
...
llvm-svn: 123358
2011-01-13 01:30:30 +00:00
Benjamin Kramer
c758311025
Push twines deeper into SourceMgr's error handling methods.
...
llvm-svn: 114847
2010-09-27 17:42:11 +00:00
Chris Lattner
13ee795c42
remove unions from LLVM IR. They are severely buggy and not
...
being actively maintained, improved, or extended.
llvm-svn: 112356
2010-08-28 04:09:24 +00:00
Dan Gohman
7c7f13a5e6
Add a comment explaining why this code is more complex than it
...
initially seems it should require.
llvm-svn: 111913
2010-08-24 14:31:06 +00:00
Dan Gohman
c828c5465d
Extend function-local metadata to be usable as attachments.
...
llvm-svn: 111895
2010-08-24 02:24:03 +00:00
Dan Gohman
338d9a4935
Give ParseInstructionMetadata access to the PerFunctionState object.
...
This is in preparation for generalizing its parsing of function-local
values.
llvm-svn: 111893
2010-08-24 02:05:17 +00:00
Dan Gohman
8939ba337d
Factor out metadata parsing into a separate function.
...
llvm-svn: 108343
2010-07-14 18:26:50 +00:00
Chris Lattner
2e664bd915
fix a crash on invalid metadata, e.g.: call i32 @foo(), XXXX
...
We would return the error without inserting the new instruction
into the program, so it wouldn't get deallocated, and an abort
would trigger when the module was deleted.
llvm-svn: 100602
2010-04-07 04:08:57 +00:00
Chris Lattner
e04505e717
include header.
...
llvm-svn: 100087
2010-04-01 05:20:21 +00:00
Chris Lattner
8eff0157b2
rewrite handling of forward ref'd instruction metadata
...
to used deferred resolution instead of creating a temporary
node + rauw. There is no reason to create the temporary
mdnode, then do rauw, then destroy it.
llvm-svn: 100086
2010-04-01 05:14:45 +00:00
Chris Lattner
ef0ec99665
eliminate a temporary smallvector
...
llvm-svn: 100082
2010-04-01 04:51:13 +00:00
Chris Lattner
392be58cad
Add support for a union type in LLVM IR. Patch by Talin!
...
llvm-svn: 96011
2010-02-12 20:49:41 +00:00
Charles Davis
be5557e86b
Add a new function attribute, 'alignstack'. It will indicate (when the backends
...
implement support for it) that the stack should be forcibly realigned in the
prologue (and the process reversed in the epilogue).
llvm-svn: 95945
2010-02-12 00:31:15 +00:00
Devang Patel
ac277eb930
Remove MetadataBase class because it is not adding significant value.
...
llvm-svn: 94243
2010-01-22 22:52:10 +00:00
Victor Hernandez
9d75c966e0
Consolidate ConvertGlobalValIDToValue, ConvertGlobalOrMetadataValIDToValue, and ConvertValIDToValue into a more powerful ConvertValIDToValue() that does all three's work
...
llvm-svn: 93197
2010-01-11 22:31:58 +00:00
Victor Hernandez
b8fd152d94
Compute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnresolved().
...
Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue().
llvm-svn: 93108
2010-01-10 07:14:18 +00:00
Victor Hernandez
127286c58b
When parsing function-local metadata, create a function-local MDNode
...
llvm-svn: 92838
2010-01-06 17:00:21 +00:00
Victor Hernandez
dc6e65a6a8
Re-add parsing of function-local metadata; this time with testcase.
...
llvm-svn: 92793
2010-01-05 22:22:14 +00:00
Chris Lattner
94b9c5a73b
now that instruction metadata is only parsed in one place, eliminate the
...
parser-global MDsOnInst vector and make ParseInstructionMetadata return
its result by-ref through an argument like the entire rest of the parser.
llvm-svn: 92302
2009-12-30 05:48:36 +00:00
Chris Lattner
b2f3950da7
reimplement ParseOptionalInfo as ParseOptionalCommaAlign, correctly
...
handle the comma case for metadata.
llvm-svn: 92301
2009-12-30 05:44:30 +00:00
Chris Lattner
5c42763452
rename ParseOptionalCustomMetadata -> ParseInstructionMetadata,
...
and make it non-optional. This fixes the bug where we'd accept
and ignore a spurious comma after some instructions.
llvm-svn: 92300
2009-12-30 05:31:19 +00:00
Chris Lattner
f4f0342b08
convert 4 more instructions over.
...
llvm-svn: 92299
2009-12-30 05:27:33 +00:00
Chris Lattner
77b89dc58b
add facilities to start factoring instruction metadata parsing
...
out of each opcode's handler. Change ret over so far.
llvm-svn: 92298
2009-12-30 05:23:43 +00:00
Chris Lattner
28f1eebe3e
reimplement insertvalue/extractvalue metadata handling to not blindly
...
accept invalid input. Actually add a testcase.
llvm-svn: 92297
2009-12-30 05:14:00 +00:00
Chris Lattner
fc58af26d5
rename MetadataCache -> NumberedMetadata to follow the convention
...
used by other things. Convert it to a vector since it is a dense
numbering.
llvm-svn: 92293
2009-12-30 04:51:58 +00:00
Chris Lattner
a01ddfc2a3
rewrite ParseMDNodeVector to follow the normal patter used in the .ll parser.
...
llvm-svn: 92292
2009-12-30 04:42:57 +00:00
Chris Lattner
6dac02a4f7
rename ParseMDNode -> ParseMDNodeID, since it parses !42 , not !{... } as you'd expect.
...
llvm-svn: 92291
2009-12-30 04:15:23 +00:00
Chris Lattner
95471e49c5
remove the code added in r90497. It has several major issues and no tests.
...
llvm-svn: 92288
2009-12-30 02:20:07 +00:00
Chris Lattner
5b4a962bdd
split t_Metadata into t_MDNode and t_MDString, eliminating some unsafe casting.
...
llvm-svn: 92287
2009-12-30 02:11:14 +00:00
Chris Lattner
1797fc7009
change ParseMDString and ParseMDNode to take arguments of the right type.
...
This exposed a raft of other problems, which I'll deal with in subsequent
patches.
llvm-svn: 92273
2009-12-29 21:53:55 +00:00
Chris Lattner
218b22f33b
switch to TrackingVH instead of WeakVH, since these can never
...
be RAUW'd and go to null. This also gets us some sorely lacking
type safety.
llvm-svn: 92272
2009-12-29 21:43:58 +00:00
Chris Lattner
f8d22fc77d
Metadata.h doesn't need to include ValueHandle.h anymore.
...
llvm-svn: 92211
2009-12-28 08:20:46 +00:00
Victor Hernandez
fa23223d4a
Add ParseInlineMetadata() which can parses metadata that refers to an instruction. Extend ParseParameterList() to use this new function so that calls to llvm.dbg.declare can pass inline metadata
...
llvm-svn: 90497
2009-12-03 23:40:58 +00:00
Devang Patel
ba52f03052
Use WeakVH while storing metadata in containers.
...
This fixes PR5393.
llvm-svn: 86091
2009-11-05 01:13:02 +00:00
Chris Lattner
3432c62d93
full asmparser support for blockaddress. We can now do:
...
$ llvm-as foo.ll -d -disable-output
which reads and prints the .ll file. BC encoding is the
next project. Testcase will go in once that works.
llvm-svn: 85368
2009-10-28 03:39:23 +00:00
Chris Lattner
d04cb6d0fa
rename indbr -> indirectbr to appease the residents of #llvm.
...
llvm-svn: 85351
2009-10-28 00:19:10 +00:00
Chris Lattner
3ed871fe62
add enough support for indirect branch for the feature test to pass
...
(assembler,asmprinter, bc reader+writer) and document it. Codegen
currently aborts on it.
llvm-svn: 85274
2009-10-27 19:13:16 +00:00
Victor Hernandez
e297149e26
Auto-upgrade free instructions to calls to the builtin free function.
...
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.
llvm-svn: 84987
2009-10-24 04:23:03 +00:00
Victor Hernandez
c7d6a8327c
Autoupgrade malloc insts to malloc calls.
...
Update testcases that rely on malloc insts being present.
Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step.
llvm-svn: 84292
2009-10-17 00:00:19 +00:00
Devang Patel
ba4a6fdd17
Parse custom metadata attached with an instruction.
...
llvm-svn: 83033
2009-09-29 00:01:14 +00:00
Devang Patel
b1a4477f1f
Do not use global typedef for MDKindID.
...
llvm-svn: 83016
2009-09-28 21:14:55 +00:00
Victor Hernandez
e6ff7662b6
Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it causes regressions in the nightly tests.
...
llvm-svn: 82784
2009-09-25 18:11:52 +00:00
Victor Hernandez
46cd467310
Auto-upgrade malloc instructions to malloc calls.
...
Reviewed by Devang Patel.
llvm-svn: 82694
2009-09-24 17:47:49 +00:00
Devang Patel
ea8a4b984c
Fix parsing of optional metadata for 'load', 'store' and 'alloc' instructions.
...
llvm-svn: 82175
2009-09-17 23:04:48 +00:00
Sandeep Patel
68c5f477fa
Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
...
llvm-svn: 80773
2009-09-02 08:44:58 +00:00
Dan Gohman
466876b0a6
Extend the AsmWriter to print unnamed numbered types as "%0 = type ..."
...
and unnamed numbered global variables as "@0 = global ...". Extend the
AsmParser to recognize these forms.
llvm-svn: 78859
2009-08-12 23:32:33 +00:00
Devang Patel
be62697e6b
Parse named metadata.
...
llvm-svn: 77410
2009-07-29 00:34:02 +00:00
Devang Patel
e059ba6ed2
Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK in bitcode file.
...
llvm-svn: 76834
2009-07-23 01:07:34 +00:00
Devang Patel
7428d8acec
Introduce MetadataBase, a base class for MDString and MDNode.
...
Derive MDString directly from MetadataBase.
Introduce new bitcode block to hold metadata.
llvm-svn: 76759
2009-07-22 17:43:22 +00:00
Devang Patel
8ff0f8d79b
Refactor metadata parsing routines into separate functions.
...
llvm-svn: 76455
2009-07-20 19:00:08 +00:00