Rafael Espindola
f6cae95276
Reject uses of unnamed_addr in declarations.
...
llvm-svn: 123358
2011-01-13 01:30:30 +00:00
Benjamin Kramer
cd6c025b08
Push twines deeper into SourceMgr's error handling methods.
...
llvm-svn: 114847
2010-09-27 17:42:11 +00:00
Chris Lattner
ecf276b787
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
979850aeb6
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
3c2bff91d0
Extend function-local metadata to be usable as attachments.
...
llvm-svn: 111895
2010-08-24 02:24:03 +00:00
Dan Gohman
c68320f6ad
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
8c1d1d0b27
Factor out metadata parsing into a separate function.
...
llvm-svn: 108343
2010-07-14 18:26:50 +00:00
Chris Lattner
0f513e1c22
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
b77a53bb60
include header.
...
llvm-svn: 100087
2010-04-01 05:20:21 +00:00
Chris Lattner
b0cddaebe0
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
98c3d20ae4
eliminate a temporary smallvector
...
llvm-svn: 100082
2010-04-01 04:51:13 +00:00
Chris Lattner
2265d6280b
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
d69c12ecc6
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
81f0fa06d7
Remove MetadataBase class because it is not adding significant value.
...
llvm-svn: 94243
2010-01-22 22:52:10 +00:00
Victor Hernandez
1ca202f9ea
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
f4272b50d6
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
6551d8e0be
When parsing function-local metadata, create a function-local MDNode
...
llvm-svn: 92838
2010-01-06 17:00:21 +00:00
Victor Hernandez
0e7561092b
Re-add parsing of function-local metadata; this time with testcase.
...
llvm-svn: 92793
2010-01-05 22:22:14 +00:00
Chris Lattner
c3422a8190
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
fb3b372e6d
reimplement ParseOptionalInfo as ParseOptionalCommaAlign, correctly
...
handle the comma case for metadata.
llvm-svn: 92301
2009-12-30 05:44:30 +00:00
Chris Lattner
f7b95d1fbc
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
89aae53e72
convert 4 more instructions over.
...
llvm-svn: 92299
2009-12-30 05:27:33 +00:00
Chris Lattner
2aaf4a0490
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
03a91d987f
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
6664b8bd4d
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
bc506fa595
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
9583b65fb9
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
41a3666fc1
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
4f406c8c74
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
4803e84704
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
bfd6a6f096
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
6dd4686b48
Metadata.h doesn't need to include ValueHandle.h anymore.
...
llvm-svn: 92211
2009-12-28 08:20:46 +00:00
Victor Hernandez
e2129e2966
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
02635b0c7a
Use WeakVH while storing metadata in containers.
...
This fixes PR5393.
llvm-svn: 86091
2009-11-05 01:13:02 +00:00
Chris Lattner
e897be280c
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
2bc8002f4c
rename indbr -> indirectbr to appease the residents of #llvm.
...
llvm-svn: 85351
2009-10-28 00:19:10 +00:00
Chris Lattner
fdda543cea
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
e8998896f5
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
4d7283f82c
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
629ad89954
Parse custom metadata attached with an instruction.
...
llvm-svn: 83033
2009-09-29 00:01:14 +00:00
Devang Patel
d836a7d651
Do not use global typedef for MDKindID.
...
llvm-svn: 83016
2009-09-28 21:14:55 +00:00
Victor Hernandez
f772c0b8b2
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
ff8027ced6
Auto-upgrade malloc instructions to malloc calls.
...
Reviewed by Devang Patel.
llvm-svn: 82694
2009-09-24 17:47:49 +00:00
Devang Patel
d90471a00d
Fix parsing of optional metadata for 'load', 'store' and 'alloc' instructions.
...
llvm-svn: 82175
2009-09-17 23:04:48 +00:00
Sandeep Patel
9c4e094e2a
Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
...
llvm-svn: 80773
2009-09-02 08:44:58 +00:00
Dan Gohman
4ee8471442
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
127ab37209
Parse named metadata.
...
llvm-svn: 77410
2009-07-29 00:34:02 +00:00
Devang Patel
6b2162686a
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
5794cb80ad
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
25ea06491e
Refactor metadata parsing routines into separate functions.
...
llvm-svn: 76455
2009-07-20 19:00:08 +00:00