mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2026-02-06 21:11:38 -05:00
Merge LLVM upstream SVN r80601.
This brings in some memory leak fixes for LLVMCOntext. Squashed commit of the following: commit 4cfaf41d499ce05b11ecb62746c3e86b04440f62 Author: Bill Wendling <isanbard@gmail.com> Date: Mon Aug 31 18:26:48 2009 +0000 Output a hex value, because all of the others are hex. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80601 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7829e5a6558bb97589d47d61da3142f7ebbdaeac Author: Dale Johannesen <dalej@apple.com> Date: Mon Aug 31 18:05:23 2009 +0000 Fix some misspellings of XTARGET. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80598 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8364630e4cb67b6f64a704960e73ae44ce3f10ed Author: Dale Johannesen <dalej@apple.com> Date: Mon Aug 31 17:49:20 2009 +0000 Mark test as passing on all x86, which it should, although I don't think anyone cares about this feature except Darwin. PR 4825. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80596 91177308-0d34-0410-b5e6-96231b3b80d8 commit cf91fb4cb2e15b1fa07dc1282ac59c3659d80015 Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 17:08:30 2009 +0000 cleanups pointed out by duncan git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80595 91177308-0d34-0410-b5e6-96231b3b80d8 commit 752d366fe7a9d0f68258465ce554cdf40af2918e Author: Duncan Sands <baldrick@free.fr> Date: Mon Aug 31 16:45:16 2009 +0000 Revert commit 80428. It completely broke exception handling on x86-32 linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80592 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3c8dfbb88bb125c2b7d1105645937b14dce9bcd3 Author: Edwin Török <edwintorok@gmail.com> Date: Mon Aug 31 16:14:59 2009 +0000 Free the constants that have no uses in ~LLVMContext. This fixes leaks from LLVMContext in multithreaded apps. Since constants are only deleted if they have no uses, it is safe to not delete a Module on shutdown, as many single-threaded tools do. Multithreaded apps should however delete the Module before destroying the Context to ensure that there are no leaks (assuming they use a different context for each thread). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80590 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6d5f43b77a907a2b42ff405ab16e078c6598c70e Author: Edwin Török <edwintorok@gmail.com> Date: Mon Aug 31 16:12:29 2009 +0000 Fix ExplicitSymbols leak. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80589 91177308-0d34-0410-b5e6-96231b3b80d8 commit b759ebc5bc48ee93a9f4b031ec6ed3247028d77c Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Mon Aug 31 13:05:24 2009 +0000 Normalize makefile comments and sort cmake file lists. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80584 91177308-0d34-0410-b5e6-96231b3b80d8 commit d79f43204be2893e74872f1062e2a44f023d39e1 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 31 08:09:28 2009 +0000 llvm-mc: Pass values to MCStreamer as MCExprs, not MCValues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80578 91177308-0d34-0410-b5e6-96231b3b80d8 commit f4c67959b5ea0bbd3a39085c91c2d3162c6fd973 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 31 08:09:09 2009 +0000 llvm-mc: Simplify EmitAssignment ('.set' is identical to '='). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80577 91177308-0d34-0410-b5e6-96231b3b80d8 commit b6a03e093598d90c10c8d1cab8425e3d107b12cf Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 31 08:08:50 2009 +0000 llvm-mc: Remove MCAsmParser::Parse[Paren]RelocatableExpression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80576 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6e96621a502ddebc12cd4d139756b7a90fd1ca8a Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 31 08:08:38 2009 +0000 llvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue. Also, use MCInst::print instead of custom code in MCAsmPrinter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80575 91177308-0d34-0410-b5e6-96231b3b80d8 commit 667cfd44ac3394697e60f54f72bfd190436c061a Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 31 08:08:17 2009 +0000 llvm-mc: Add MCAsmParser::Parse[Paren]Expression forms which return an MCExpr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80574 91177308-0d34-0410-b5e6-96231b3b80d8 commit 22ad5f80f751da3ba986022d09c49fcc4416048a Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 31 08:08:06 2009 +0000 llvm-mc: Make MCSymbolData symbol member const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80573 91177308-0d34-0410-b5e6-96231b3b80d8 commit 29efe7e0c9d32aaefa2a2924a8ded5fd4c76ff28 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 31 08:07:55 2009 +0000 llvm-mc: Add MCContext to MCAssembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80572 91177308-0d34-0410-b5e6-96231b3b80d8 commit 890ebe2d940760796e088902a2613cdf30b16e76 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 31 08:07:44 2009 +0000 llvm-mc: Add MCAsmParser::getContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80571 91177308-0d34-0410-b5e6-96231b3b80d8 commit 510c1a5512b7de68dc9b272eaba0e5d6c3ddc8b9 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 31 08:07:33 2009 +0000 llvm-mc: Add MCExpr::{dump,print}. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80570 91177308-0d34-0410-b5e6-96231b3b80d8 commit bc4d607b1a5fd13c1f19ef812ebb6fe814831d56 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 31 08:07:22 2009 +0000 llvm-mc: Switch MCExpr construction to using static member functions, and taking the MCContext (which now owns all MCExprs). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80569 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6e3b031540ae25a464bfa37cdbd19e2cad301ee7 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 31 08:07:08 2009 +0000 llvm-mc: Add some doxyment markers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80568 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3679d2f3156d001053bae8fa5a162852b7700a27 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 31 08:06:59 2009 +0000 llvm-mc: Move AsmExpr into MC lib (as MCExpr). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80567 91177308-0d34-0410-b5e6-96231b3b80d8 commit 298ea10f4da28d9be51f8be5af59f88ea86ce7ec Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 07:23:46 2009 +0000 Step #1 to giving Callgraph some sane invariants. The problems with callgraph stem from the fact that we have two types of passes that need to update it: 1. callgraphscc and module passes that are explicitly aware of it 2. Functionpasses (and loop passes etc) that are interlaced with CGSCC passes by the CGSCC Passmgr. In the case of #1, we can reasonably expect the passes to update the call graph just like any analysis. However, functionpasses are not and generally should not be CG aware. This has caused us no end of problems, so this takes a new approach. Logically, the CGSCC Pass manager can rescan every function after it runs a function pass over it to see if the functionpass made any updates to the IR that affect the callgraph. This allows it to catch new calls introduced by the functionpass. In practice, doing this would be slow. This implementation keeps track of whether or not the current scc is dirtied by a function pass, and, if so, delays updating the callgraph until it is actually needed again. This was we avoid extraneous rescans, but we still have good invariants when the callgraph is needed. Step #2 of the "give Callgraph some sane invariants" is to change CallGraphNode to use a CallBackVH for the callsite entry of the CallGraphNode. This way we can immediately remove entries from the callgraph when a FunctionPass is active instead of having dangling pointers. The current pass tries to tolerate these dangling pointers, but it is just an evil hack. This is related to PR3601/4835/4029. This also reverts r80541, a hack working around the sad lack of invariants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80566 91177308-0d34-0410-b5e6-96231b3b80d8 commit 21d79e26df48405ff2fdfde682c4fdf6c646ef8a Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 06:57:37 2009 +0000 fix some cases where instcombine would change hte IR but not return true from runOnFunction git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80562 91177308-0d34-0410-b5e6-96231b3b80d8 commit 223479b6087a6d9a1470c857c459e408ba51df84 Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 06:01:21 2009 +0000 cleanups, factor some code out to a helper function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80542 91177308-0d34-0410-b5e6-96231b3b80d8 commit f5313424550268526a14fd910cfb59efb95e0f30 Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 05:46:59 2009 +0000 fix a crash building SPASS by tolerating a callsite that doesn't exist in the callgraph, see the big comment at the top of the testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80541 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4c76b7e8e15bf7ed6607393535f64a9070b6df8c Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 05:34:32 2009 +0000 comment and simplify some code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80540 91177308-0d34-0410-b5e6-96231b3b80d8 commit d441cd63a37ec3589fed1cfba11bbb177dab8fa6 Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 05:22:48 2009 +0000 add -debug output git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80539 91177308-0d34-0410-b5e6-96231b3b80d8 commit 26b7f945b3a935e44755202ef7be13fdee8c75b5 Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 05:17:58 2009 +0000 improve -debug output, so that -debug is more likely to print when instcombine is changing stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80538 91177308-0d34-0410-b5e6-96231b3b80d8 commit adba7ea53650f26a6752f606041ac6d741c1fd4f Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 04:36:22 2009 +0000 fix a bug I introduced with my 'instcombine builder' refactoring changes: SimplifyDemandedBits can't use the builder yet because it has the wrong insertion point. This fixes a crash building MultiSource/Benchmarks/PAQ8p git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80537 91177308-0d34-0410-b5e6-96231b3b80d8 commit b74203603b43d08ddef33e9a4c9c03752d86aee6 Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 04:09:04 2009 +0000 simplify some code by making the SCCNodes set contain Function*'s instead of CallGraphNode*'s. This also papers over a callgraph problem where a pass (in this case, MemCpyOpt) introduces a new function into the module (llvm.memset.i64) but doesn't add it to the call graph (nor should it, since it is a function pass). While it might be a good idea for MemCpyOpt to not synthesize functions in a runOnFunction(), there is no need for FunctionAttrs to be boneheaded, so fix it there. This fixes an assertion building 176.gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80535 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3e30f91f1c190b8f3ba93de2c8746e0addaf056e Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 03:22:35 2009 +0000 only print the override triple if it exists! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80534 91177308-0d34-0410-b5e6-96231b3b80d8 commit fd7079292b43ca5eceae2c585fc2899033a448f7 Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 03:15:49 2009 +0000 Fix PR4834, a tricky case where the inliner would resolve an indirect function pointer, inline it, then go to delete the body. The problem is that the callgraph had other references to the function, though the inliner had no way to know it, so we got a dangling pointer and an invalid iterator out of the deal. The fix to this is pretty simple: stop the inliner from deleting the function by knowing that there are references to it. Do this by making CallGraphNodes contain a refcount. This requires moving deletion of available_externally functions to the module-level cleanup sweep where it belongs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80533 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7d7776f7adca3f51d05c3bbfbacaf65a5ae5167f Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 02:24:20 2009 +0000 use an accessor instead of poking internals of a node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80532 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7032b5cbb5282c844008e780c7bbdddf8f8cf096 Author: Oscar Fuentes <ofv@wanadoo.es> Date: Mon Aug 31 01:58:50 2009 +0000 CMake: updated library dependencies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80531 91177308-0d34-0410-b5e6-96231b3b80d8 commit 54b6adfbb882f2f9b96c241fb87d0128ce840960 Author: Jim Grosbach <grosbach@apple.com> Date: Mon Aug 31 01:35:03 2009 +0000 PR4747 Shared landing pads run into trouble with SJLJ, as the dispatch table is mapped to call sites, and merging the pads will throw that off. There needs to be a one-to-one mapping of landing pad exception table entries to invoke call points. Detecting the shared pad during lowering of SJLJ info insn't sufficient, as the dispatch function may still need separate destinations to properly handle phi-nodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80530 91177308-0d34-0410-b5e6-96231b3b80d8 commit 86ab47ae9c388e9e046dedd9d9d554268290e450 Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 00:28:46 2009 +0000 update unit test for previous change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80528 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3dab7152eedc0d822a9499102303eba526026021 Author: Chris Lattner <sabre@nondot.org> Date: Mon Aug 31 00:19:58 2009 +0000 Fix some nasty callgraph dangling pointer problems in argpromotion and structretpromote. Basically, when replacing a function, they used the 'changeFunction' api which changes the entry in the function map (and steals/reuses the callgraph node). This has some interesting effects: first, the problem is that it doesn't update the "callee" edges in any callees of the function in the call graph. Second, this covers for a major problem in all the CGSCC pass stuff, which is that it is completely broken when functions are deleted if they *don't* reuse a CGN. (there is a cute little fixme about this though :). This patch changes the protocol that CGSCC passes must obey: now the CGSCC pass manager copies the SCC and preincrements its iterator to avoid passes invalidating it. This allows CGSCC passes to mutate the current SCC. However multiple passes may be run on that SCC, so if passes do this, they are now required to *update* the SCC to be current when they return. Other less interesting parts of this patch are that it makes passes update the CG more directly, eliminates changeFunction, and requires clients of replaceCallSite to specify the new callee CGN if they are changing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80527 91177308-0d34-0410-b5e6-96231b3b80d8 commit 637d133ffeaa961837ebc87ee6934be5ef401b8f Author: Erick Tryzelaar <idadesub@users.sourceforge.net> Date: Sun Aug 30 23:41:20 2009 +0000 Fix header comment for bindings/ocaml/llvm/Makefile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80526 91177308-0d34-0410-b5e6-96231b3b80d8 commit ad465d7013a6ec529a34605d51377202af71b418 Author: Erick Tryzelaar <idadesub@users.sourceforge.net> Date: Sun Aug 30 23:38:06 2009 +0000 Make sure we specify no arguments for context functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80525 91177308-0d34-0410-b5e6-96231b3b80d8 commit ba263e5f1b2320558e3935bbfbdc10c6d581c19d Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 22:24:32 2009 +0000 add a dump() method on callgraph. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80524 91177308-0d34-0410-b5e6-96231b3b80d8 commit 72489759fa9fb63fdfa9f2e363222f0c45bf1340 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 22:14:17 2009 +0000 rename test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80523 91177308-0d34-0410-b5e6-96231b3b80d8 commit fae478e46e8ba5192eebbe569a627fdb954e587f Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 22:13:26 2009 +0000 merge all sinking tests into one and convert them to filecheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80522 91177308-0d34-0410-b5e6-96231b3b80d8 commit a94b6974dd77e6457eba731fc6bf760d150f4207 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 22:08:19 2009 +0000 convert scalar_promote to filecheck style and merge 2003-12-13-VolatilePromote.ll into it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80521 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9e2f641e11c20fa64e5f605e00168ecc7c0207b6 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 21:45:23 2009 +0000 eliminate some uses of prcontext. Any help here would be appreciated :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80520 91177308-0d34-0410-b5e6-96231b3b80d8 commit b5d911fe3ad0daa3bab9f6ddb24931db969fed00 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 21:36:39 2009 +0000 rename test so that name reflects what it is testing for. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80519 91177308-0d34-0410-b5e6-96231b3b80d8 commit 16078ca613ec085b395afbabf5b68b7062e0ac1c Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 21:36:06 2009 +0000 convert to filecheck format. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80518 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0799dd19d3f0c2f1beb1b17ef7842ae5b61043d2 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 21:31:34 2009 +0000 suck a bunch more gep tests into getelementptr.ll and filecheckize them all. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80517 91177308-0d34-0410-b5e6-96231b3b80d8 commit 16d7262e7a2e523c97e2c8bb2b4ab8823cf05772 Author: Daniel Dunbar <daniel@zuster.org> Date: Sun Aug 30 21:14:05 2009 +0000 Tweak comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80516 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6a8458c86c784f7955ab7815b4840fc21f27b2d8 Author: Daniel Dunbar <daniel@zuster.org> Date: Sun Aug 30 21:13:58 2009 +0000 Fix some possible-use-of-uninitialized warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80515 91177308-0d34-0410-b5e6-96231b3b80d8 commit 909749e25e3d5442e5b407781d2de92871f81a64 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 21:02:36 2009 +0000 consolodate various GEP tests into getelementptr.ll using filecheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80514 91177308-0d34-0410-b5e6-96231b3b80d8 commit ccf7551a0445599b24a0eae667242e67b5f5d298 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 21:02:02 2009 +0000 another huge testcase, this time from 'gs' in llvm-test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80513 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1fa629a0ffe6aa837bda41389c098e236a5b0f0c Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 21:01:14 2009 +0000 remove another poorly-reduced testcase which came from ldecod in llvm-test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80512 91177308-0d34-0410-b5e6-96231b3b80d8 commit 36d9c48134861d576a78c09e001d7773a502ea76 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 21:00:11 2009 +0000 this testcase is 500 lines long and is distilled from bzip2, just remove it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80511 91177308-0d34-0410-b5e6-96231b3b80d8 commit 586de4da4bffce2aae9110a60a39a3318014674c Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 20:48:15 2009 +0000 convert to filecheck git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80510 91177308-0d34-0410-b5e6-96231b3b80d8 commit 83288fa512830d723318bf99060d3ec4fbf53abc Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 20:38:21 2009 +0000 Fix PR4748: don't fold gep(bitcast(x)) into bitcast(gep) when x is itself a bitcast. Since we have gep(bitcast(bitcast(y))) in this case, just wait for the two bitcasts to get zapped. This prevents instcombine from confusing some aliasing stuff, and allows it to directly eliminate the load in the testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80508 91177308-0d34-0410-b5e6-96231b3b80d8 commit f3a2359906e6939a2552c7c23877592693d757f1 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 20:36:46 2009 +0000 misc cleanup git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80507 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6807a24de176e563843a0c5a21c9358b5eeefc2d Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 20:06:40 2009 +0000 add getPointerAddressSpace() to GEP instruction, use the method in a few scalar xforms to simplify things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80506 91177308-0d34-0410-b5e6-96231b3b80d8 commit d6164c20cdaaa27a2cc7b340604b4df3f2b97129 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 20:01:10 2009 +0000 eliminate InsertCastBefore, use the builder instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80505 91177308-0d34-0410-b5e6-96231b3b80d8 commit 78628294ebe9a062fbd7e55edf5240e9b7c53fce Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 19:47:22 2009 +0000 eliminate InsertBitCastBefore, just use the builder instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80504 91177308-0d34-0410-b5e6-96231b3b80d8 commit b77b0464ba62108a07af655f626f5bfe3bd63162 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 19:45:21 2009 +0000 add a "getPointerAddressSpace" helper method to LoadInst and StoreInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80503 91177308-0d34-0410-b5e6-96231b3b80d8 commit d33527768525e6447c6fdcf521ffb975165dbc7a Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Sun Aug 30 19:06:39 2009 +0000 Add missed pattern git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80502 91177308-0d34-0410-b5e6-96231b3b80d8 commit ad7516ac00ede459691feba7f448a4c3654ea6fc Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 18:50:58 2009 +0000 convert a bunch more calls to InsertNewInstBefore to use the new Instcombine builder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80501 91177308-0d34-0410-b5e6-96231b3b80d8 commit 36ec3b4e9828905bdc6bf7ef91ac808ab11e7d45 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 17:53:59 2009 +0000 fix typo git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80500 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8ba22dd113839d66b3f2912aff6bdd27776b1608 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 17:44:10 2009 +0000 hopefully unbreak the build by making this-> explicit for dependent base class lookup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80499 91177308-0d34-0410-b5e6-96231b3b80d8 commit 243874430bb02c8f76b7603cbc8f31ebf2749785 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Sun Aug 30 17:14:54 2009 +0000 EXTRACT_VECTOR_ELEMENT can have result type different from element type. Remove the assertion and generalize the code for ARM NEON stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80498 91177308-0d34-0410-b5e6-96231b3b80d8 commit 42cee05a28e87ba96760daaf9699f8355ea53f6e Author: Edwin Török <edwintorok@gmail.com> Date: Sun Aug 30 08:24:09 2009 +0000 Add regular expression matching support, based on OpenBSD regexec()/regcomp() implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80493 91177308-0d34-0410-b5e6-96231b3b80d8 commit c769485a593b86360597d913c083292279730695 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 07:44:24 2009 +0000 give instcombine a custom IRBuilder that adds new instructions to the workslist and is set to insert new instructions before the current one. Convert a bunch of stuff that used to call InsertNewInstBefore over to use it, greatly simplifying code and making it more natural. There is still a lot more to go, but this is a good start. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80492 91177308-0d34-0410-b5e6-96231b3b80d8 commit f0b47f327e20f338c90202ea21001dd9b06f7ef5 Author: Daniel Dunbar <daniel@zuster.org> Date: Sun Aug 30 07:01:09 2009 +0000 Update test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80490 91177308-0d34-0410-b5e6-96231b3b80d8 commit c5ad98f04a19b2b7d463713a77634471578d1a64 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 06:27:41 2009 +0000 add a new InstCombineWorklist::AddValue method that works even if the operand is not an instruction. Simplify most uses of AddOperandsToWorkList to use AddValue and inline it into the one remaining callsite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80488 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4796b62fccd6f8c414b5a642ebe0f6dbbabd5b61 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 06:22:51 2009 +0000 move AddUsersToWorkList to the worklist processing class, make the argument stronger typed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80487 91177308-0d34-0410-b5e6-96231b3b80d8 commit 059cfc7570d47711c1b53c909ab0f9c347cb23c3 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 06:20:05 2009 +0000 rename AddUsesToWorkList -> AddOperandsToWorkList. The former looks too much like AddUsersToWorkList and keeps confusing me. Remove AddSoonDeadInstToWorklist and change its two callers to do the same thing in a simpler way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80486 91177308-0d34-0410-b5e6-96231b3b80d8 commit a8d310b5231890e926000c6939540b93fe094b61 Author: Daniel Dunbar <daniel@zuster.org> Date: Sun Aug 30 06:17:49 2009 +0000 llvm-mc/X86: Encode constant MCValue's correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80485 91177308-0d34-0410-b5e6-96231b3b80d8 commit b03d1179e934cb99e30190835fea1e7f4a59ecad Author: Daniel Dunbar <daniel@zuster.org> Date: Sun Aug 30 06:17:16 2009 +0000 llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now. - Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80484 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3183fb6b613c15627c33a8257cbbfe10dbf0bb7f Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 06:13:40 2009 +0000 inline the trivial AddToWorkList/RemoveFromWorkList methods into their callers. simplify ReplaceInstUsesWith. Make EraseInstFromFunction only add operands to the worklist if there aren't too many of them (this was a scalability win for crazy programs that was only infrequently enforced). Switch more code to using EraseInstFromFunction instead of duplicating it inline. Change some fcmp/icmp optimizations to modify fcmp/icmp in place instead of creating a new one and deleting the old one just to change the predicate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80483 91177308-0d34-0410-b5e6-96231b3b80d8 commit bf09d6330ea039406e250493d7e45d001f81734d Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 05:56:44 2009 +0000 fix a bug I introduced in r80478 found by the build bot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80482 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5119c70d1620b79288c50ca2ad6a3ea4f11a3f35 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 05:55:36 2009 +0000 refactor instcombine's worklist processing stuff out to its own class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80481 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1dde4eb8a0aef903bfd53d8dabfc61a560e1b327 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 05:55:04 2009 +0000 make DenseMap::clear() early exit if there is nothing to do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80480 91177308-0d34-0410-b5e6-96231b3b80d8 commit 69af0ff152a949c41ea8ff4550c74627306262f7 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 05:42:59 2009 +0000 some minor cleanups to IRBuilder, factor the insertion hook out of the main IRBuilder class to allow clients to override it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80479 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1c641fc37fc42d878883b0325810a5c8c02a436c Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 05:30:55 2009 +0000 more cleanups: remove some redundant code, and simplify some other places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80478 91177308-0d34-0410-b5e6-96231b3b80d8 commit c2c8a0ac3f529c9e536862b213e18f67de05f422 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 05:08:50 2009 +0000 eliminate the temporary SrcGEPOperands smallvector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80477 91177308-0d34-0410-b5e6-96231b3b80d8 commit 95ba1ec4cbb14614f9ac26c9aabe5cac6640c4b0 Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 05:00:50 2009 +0000 simplify/detangle some control flow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80476 91177308-0d34-0410-b5e6-96231b3b80d8 commit c0f553e874121b6a0feb35e580040c02da05ac3c Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 04:49:01 2009 +0000 simplify and cleanup some code, remove some code that just does constant folding of gep's: this is already handled in a more general way. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80475 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9da50553ef4596ea75c3a5434bf9ad356fb574ee Author: Chris Lattner <sabre@nondot.org> Date: Sun Aug 30 04:25:40 2009 +0000 default count-aa to -print-all. The whole reason to use count-aa is to see what queries are being made by a transformation, we might as well default to printing them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80474 91177308-0d34-0410-b5e6-96231b3b80d8 commit 09880947395319ff0df656549ddf0b080b7af385 Author: Bill Wendling <isanbard@gmail.com> Date: Sun Aug 30 00:28:57 2009 +0000 Nuke moribund "std::string" version of EOL(..., Encoding). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80466 91177308-0d34-0410-b5e6-96231b3b80d8 commit cdfb9b17b94bffa0de0e4862d22369fa1dcd9099 Author: Dan Gohman <gohman@apple.com> Date: Sat Aug 29 23:54:26 2009 +0000 Add AutoGenerated.inc to svn:ignore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80455 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5d138f96f048cc7009397708ed10edea7cede5a6 Author: Dan Gohman <gohman@apple.com> Date: Sat Aug 29 23:39:38 2009 +0000 Remove an unnecessary Context argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80454 91177308-0d34-0410-b5e6-96231b3b80d8 commit f928ad4af07aaac5e7e81757dcd514acbb5cb39c Author: Dan Gohman <gohman@apple.com> Date: Sat Aug 29 23:37:49 2009 +0000 Minor logic simplification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80453 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3d9354c841746f1802babcd465e542d7a7ea2a10 Author: Dan Gohman <gohman@apple.com> Date: Sat Aug 29 23:36:57 2009 +0000 Add some comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80452 91177308-0d34-0410-b5e6-96231b3b80d8 commit 18e06cf39d0313f80b055eb98dba8d8f42fd08cd Author: Dan Gohman <gohman@apple.com> Date: Sat Aug 29 23:35:16 2009 +0000 Cleanup whitespace and indentation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80451 91177308-0d34-0410-b5e6-96231b3b80d8 commit b006a1010559be4bc9d5e577c50fc750194f34a6 Author: Dan Gohman <gohman@apple.com> Date: Sat Aug 29 23:34:14 2009 +0000 Remove some unused fields. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80450 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1596dd23f3e2df5225cdfcea0904a017f96aaa90 Author: Dan Gohman <gohman@apple.com> Date: Sat Aug 29 22:19:15 2009 +0000 CMOV_GR8 clobbers EFLAGS when its expansion involves an xor to set a register to 0. This fixes PR4814. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80445 91177308-0d34-0410-b5e6-96231b3b80d8 commit ac09afaf40216429fad53899cce2f9fde8e267d4 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Sat Aug 29 13:38:21 2009 +0000 Inline empty destructor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80431 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3c5374802712a3d28cd13207ed3979a95457075c Author: Bill Wendling <isanbard@gmail.com> Date: Sat Aug 29 12:31:38 2009 +0000 Fix warning about non-virtual destructor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80429 91177308-0d34-0410-b5e6-96231b3b80d8 commit b4ac493684cdeb2147000a6816a563269fcf3c70 Author: Bill Wendling <isanbard@gmail.com> Date: Sat Aug 29 12:20:54 2009 +0000 - Add target lowering methods to get the preferred format for the FDE and LSDA encodings. - Make some of the values emitted by the FDEs dependent upon the pointer size. This is in line with how GCC does things. And it has the benefit of working for Darwin in 64-bit mode now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80428 91177308-0d34-0410-b5e6-96231b3b80d8 commit 946b521498866b3d83c4447c9c0ece6095a56874 Author: Bill Wendling <isanbard@gmail.com> Date: Sat Aug 29 12:17:53 2009 +0000 Add a form of EOL which emits the text version of a DWARF format encoding. This doesn't handle all values of the formatting. Those can be added as needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80427 91177308-0d34-0410-b5e6-96231b3b80d8 commit 502c35e863882790a94ad432d0a03c4a7e1a0aad Author: Bob Wilson <bob.wilson@apple.com> Date: Sat Aug 29 05:53:25 2009 +0000 PR4795: Remove EEVT::isFP, isInt and isVec types used by TableGen's type inferencing. As far as I can tell, these are equivalent to the existing MVT::fAny, iAny and vAny types, and having both of them makes it harder to reason about and modify the type inferencing code. The specific problem in PR4795 occurs when updating a vAny type to be fAny or iAny, or vice versa. Both iAny and fAny include vector types -- they intersect with the set of types represented by vAny. When merging them, choose fAny/iAny to represent the intersection. This is not perfect, since fAny/iAny also include scalar types, but it is good enough for TableGen's type inferencing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80423 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0ac7faa993d472be4a23e0e58fa6e9372960cfe8 Author: Eric Christopher <echristo@apple.com> Date: Sat Aug 29 01:12:46 2009 +0000 Make the augmentation size and next set of bytes agree on size, and make the reference pointer size as it should be. Fixes an abort on a testcase derived from libunwind's personality test in 64-bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80414 91177308-0d34-0410-b5e6-96231b3b80d8 commit 83b551c5efdc49183f744103cd8e22a75117d07f Author: Jeffrey Yasskin <jyasskin@google.com> Date: Sat Aug 29 00:44:16 2009 +0000 Fix OProfile support after r80406 changed the DebugInfo interface from GlobalVariables to MDNodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80411 91177308-0d34-0410-b5e6-96231b3b80d8 commit e54c004ea5ea6c7e89b1cef9531ce05096122bbf Author: David Goodwin <david_goodwin@apple.com> Date: Sat Aug 29 00:11:13 2009 +0000 Another stab at fixing up register kill flags after post-RA scheduling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80410 91177308-0d34-0410-b5e6-96231b3b80d8 commit cb7c98d9ef32354166106ff8218fb9fcbb8b2d24 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Sat Aug 29 00:08:18 2009 +0000 Do not assert on too wide splats we don't support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80409 91177308-0d34-0410-b5e6-96231b3b80d8 commit 44e0a6cee931258a05b190f9e6e411a6d276c96a Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Fri Aug 28 23:41:26 2009 +0000 Add missed extract_element pattern git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80408 91177308-0d34-0410-b5e6-96231b3b80d8 commit 15e723d2c6021bbeacad9baa9c0d946d4a19867e Author: Devang Patel <dpatel@apple.com> Date: Fri Aug 28 23:24:31 2009 +0000 Reapply 79977. Use MDNodes to encode debug info in llvm IR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80406 91177308-0d34-0410-b5e6-96231b3b80d8 commit c299914a58baed2d7cf594494dbba60880d476cd Author: Evan Cheng <evan.cheng@apple.com> Date: Fri Aug 28 23:18:09 2009 +0000 Let Darwin linker auto-synthesize stubs and lazy-pointers. This deletes a bunch of nasty code in ARM asm printer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80404 91177308-0d34-0410-b5e6-96231b3b80d8 commit a14f4474b2d915579e9e9bd8bf4080d7f25e7dcd Author: Eric Christopher <echristo@apple.com> Date: Fri Aug 28 22:33:43 2009 +0000 Nuke trailing whitespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80401 91177308-0d34-0410-b5e6-96231b3b80d8 commit c6750c9bc8e555f632777eb1c69793b3b0dc40f6 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 16:14:46 2009 +0000 Fix creation of .bca libraries with EXPORTED_SYMBOLS_LIST, this was putting the llvm-ld shell wrapper script in the archive, not the relinked object! Also, rename the temp file to avoid conflicts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80373 91177308-0d34-0410-b5e6-96231b3b80d8 commit 72d34e1a91e3f2b58559f92e5c1716ba10586bf1 Author: Andreas Neustifter <astifter@gmx.at> Date: Fri Aug 28 16:13:45 2009 +0000 Read Makefile.config before using LLVMGCC. See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090824/085828.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80372 91177308-0d34-0410-b5e6-96231b3b80d8 commit ab4193ba50b6b5fcda5e2230e4705676ec07b463 Author: Edwin Török <edwintorok@gmail.com> Date: Fri Aug 28 16:12:48 2009 +0000 install-sh chmods to 0755 by default, and this causes 'git diff' to show that all the Makefiles changed mode. Fix this by tellint install-sh to chmod only to 0644, these are not executable files after all! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80371 91177308-0d34-0410-b5e6-96231b3b80d8 commit b5cc6d8ae5a5813f059b0f03511b29c101c3a8ba Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Fri Aug 28 16:06:41 2009 +0000 Short-term workaround for frame-related weirdness on win64. Some other minor win64 fixes as well. Patch by Michael Beck! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80370 91177308-0d34-0410-b5e6-96231b3b80d8 commit 422cc43971693fd61517993472065277cb0cc903 Author: Edwin Török <edwintorok@gmail.com> Date: Fri Aug 28 14:05:07 2009 +0000 rm needs -f git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80363 91177308-0d34-0410-b5e6-96231b3b80d8 commit da6633bee39686d02cd348b5c79c9dfc14eea6fd Author: Edwin Török <edwintorok@gmail.com> Date: Fri Aug 28 13:35:44 2009 +0000 Remove the llvmprof.out from the test output, otherwise running make check in a non-clean directory causes it to fail (for example when running make check twice), since execution counts will differ. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80362 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3f10e8664f46c60e4153da5da0ce33cd6b0b2ea3 Author: Andreas Neustifter <astifter@gmx.at> Date: Fri Aug 28 11:28:24 2009 +0000 Preparation for Optimal Edge Profiling: This implements the maximum spanning tree algorithm on CFGs according to weights given by the ProfileEstimator. This is then used to implement Optimal Edge Profiling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80358 91177308-0d34-0410-b5e6-96231b3b80d8 commit c99a43a3864aee1121af69db21545a3974226d41 Author: Andreas Neustifter <astifter@gmx.at> Date: Fri Aug 28 10:38:26 2009 +0000 Remove profiling output file because two consecutive runs of make check give error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80357 91177308-0d34-0410-b5e6-96231b3b80d8 commit 354f75a94252e20f1d61ff7b047f34070dcccfc9 Author: Andreas Neustifter <astifter@gmx.at> Date: Fri Aug 28 10:07:41 2009 +0000 Removed unnecessary file creation during test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80356 91177308-0d34-0410-b5e6-96231b3b80d8 commit 975ad9a72fa60d0e8946c9ec584eb5c29d14386e Author: Andreas Neustifter <astifter@gmx.at> Date: Fri Aug 28 10:00:28 2009 +0000 Pulled all tests into one test. Removed some redundant tests. Rename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80355 91177308-0d34-0410-b5e6-96231b3b80d8 commit f14af431e0f9724474dfa923ba940ecaf19316c7 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 08:08:22 2009 +0000 Fix -Asserts warning, round two. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80354 91177308-0d34-0410-b5e6-96231b3b80d8 commit 796a639383578ff065b5c32539c88f9adb5327c2 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 07:08:47 2009 +0000 llvm-mc: .lsym is more unsupported than unimplemented, pending a use case appearing. Also, all one of the file level flags are implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80352 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8388a8fed449aa79d848dd2e7b0cf8650e063028 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 07:08:35 2009 +0000 llvm-mc: Support .comm emission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80351 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3ab6715ba17ac6726bd92a4514c68c5e58c3c884 Author: Evan Cheng <evan.cheng@apple.com> Date: Fri Aug 28 06:59:37 2009 +0000 Print a nl before pic labels so they start at a new line. This makes assembly more readable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80350 91177308-0d34-0410-b5e6-96231b3b80d8 commit fd5e315e8d6dca8cab80789552b6bbfef4d960e0 Author: Andreas Neustifter <astifter@gmx.at> Date: Fri Aug 28 06:48:25 2009 +0000 Since all std::cout is gone, also remove iostream include. (See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090824/085620.html) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80349 91177308-0d34-0410-b5e6-96231b3b80d8 commit a2aca168e5c7bbb35569f6f77a3cd4e8bc17520a Author: Andreas Neustifter <astifter@gmx.at> Date: Fri Aug 28 06:41:00 2009 +0000 Readded test from r79615, this tests the complete profiling tool chain. Furhter tests can test only parts of this system. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80348 91177308-0d34-0410-b5e6-96231b3b80d8 commit df98a14701fe2de1d0b83205f32edcdfef8ca141 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 05:49:21 2009 +0000 llvm-mc: Support .zerofill emission. - I'm still trying to figure out the cleanest way to implement this and match the assembler, currently there are some substantial differences. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80347 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1c215be1a50bfd6f0b994d61d0c0548fefa52795 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 05:49:04 2009 +0000 llvm-mc: Tweak section alignment and size computation to match 'as' closer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80345 91177308-0d34-0410-b5e6-96231b3b80d8 commit 91e7ee60faaf7867aebddbf4915e1422c6895337 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 05:48:54 2009 +0000 llvm-mc: Factor getSectionData out of SwitchSection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80344 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3f952b45c4791659fe6b6addfdc2812f11a21a41 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 05:48:46 2009 +0000 llvm-mc: Emit .lcomm as .zerofill. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80343 91177308-0d34-0410-b5e6-96231b3b80d8 commit c12c27bdbc93d517025612eab112f28366256839 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 05:48:29 2009 +0000 llvm-mc: Unique zero fill sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80342 91177308-0d34-0410-b5e6-96231b3b80d8 commit 15f1a5cc63c5f08b31c8a67884efd2604067711e Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 05:48:22 2009 +0000 llvm-mc: Add const to EmitZeroFill section argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80341 91177308-0d34-0410-b5e6-96231b3b80d8 commit b6eff3bcb6f481500df60e028ceaff6b60336a1d Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 05:48:10 2009 +0000 llvm-mc: Fix thinko in emitting values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80340 91177308-0d34-0410-b5e6-96231b3b80d8 commit a8425d44b7ffa3397ac7d010598e9caab54e1ed4 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 05:48:04 2009 +0000 Add MathExtras.h OffsetToAlignment, like RoundUpToAlignment but returns the offset to the next aligned integer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80339 91177308-0d34-0410-b5e6-96231b3b80d8 commit c24bcdb66bd5b6904147ac443ca44da2660f9223 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 05:47:56 2009 +0000 Fix -Asserts warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80338 91177308-0d34-0410-b5e6-96231b3b80d8 commit d7e5bacf57cba6f139d726a0c63cb195f38cd39d Author: Chris Lattner <sabre@nondot.org> Date: Fri Aug 28 04:48:54 2009 +0000 finish a half formed thought :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80334 91177308-0d34-0410-b5e6-96231b3b80d8 commit ac6a9258ed6e7fa1e1e40ef505799ac54e852be4 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 03:06:28 2009 +0000 Another NO_RUNTIME_LIBRARIES tweak... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80331 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1497c39481d4d8616d4ba1fb2cde490cfc100baa Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Aug 28 02:20:39 2009 +0000 Tweak NO_RUNTIME_LIBS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80330 91177308-0d34-0410-b5e6-96231b3b80d8 commit c4823b9ee92e32a666e03406c46a530fcdbdda1a Author: Chris Lattner <sabre@nondot.org> Date: Fri Aug 28 00:45:47 2009 +0000 Mark Andersen's as experimental. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80328 91177308-0d34-0410-b5e6-96231b3b80d8 commit a8b647dc112f792cb21b0b675e6d2b300207a4fa Author: Chris Lattner <sabre@nondot.org> Date: Fri Aug 28 00:43:14 2009 +0000 Fix PR3913, patch by Jakub Staszak! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80327 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5e1d21856de4bf387cccf8365885c45c87642dfb Author: Evan Cheng <evan.cheng@apple.com> Date: Fri Aug 28 00:31:43 2009 +0000 v4, v5 does not support sxtb / sxth. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80322 91177308-0d34-0410-b5e6-96231b3b80d8 commit 66f3f9e7356761c91f8063a38b37293ce750c1c2 Author: Bob Wilson <bob.wilson@apple.com> Date: Fri Aug 28 00:21:13 2009 +0000 Disable optional bindings for Apple-style builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80319 91177308-0d34-0410-b5e6-96231b3b80d8 commit dc8f15c7a771649ab75bdf2dea1b27067ee9f269 Author: Bob Wilson <bob.wilson@apple.com> Date: Fri Aug 28 00:10:15 2009 +0000 Revert 76080. This broke some powerpc cross compiles. It also makes the llvmCore build dependent on whatever version of llvm-gcc happens to be installed on the build machine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80316 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6decb644026d266aaed9bc51e5840529a4af8df0 Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 23:58:10 2009 +0000 Revert r80305, I forgot a dependent change. --- Reverse-merging r80305 into '.': U tools/llvm-mc/AsmParser.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80309 91177308-0d34-0410-b5e6-96231b3b80d8 commit 20b3210d23b9c5633787e3d8bbd98d7cc0083c32 Author: Devang Patel <dpatel@apple.com> Date: Thu Aug 27 23:51:51 2009 +0000 Closure is a very generic name. Use AppleBlock instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80307 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3edc5f01bcfec50757d8cbdb7cd0fb6abb561d67 Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 23:45:06 2009 +0000 llvm-mc: Unique sections in .zerofill. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80305 91177308-0d34-0410-b5e6-96231b3b80d8 commit ab36e15e689a516f8ff2af4c2c0210a90a423652 Author: Gabor Greif <ggreif@gmail.com> Date: Thu Aug 27 23:44:33 2009 +0000 eliminate all 80-col violations that I have introduced in my recent checkins (and some others more) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80304 91177308-0d34-0410-b5e6-96231b3b80d8 commit 41d850e034d4f33728c8d8d51a3811dbe0fccf8c Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 23:43:28 2009 +0000 Don't build runtime libraries in an Apple style build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80303 91177308-0d34-0410-b5e6-96231b3b80d8 commit f5b6d86316d71c3eae687ecb56abfdfd12679a54 Author: Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Date: Thu Aug 27 19:57:56 2009 +0000 Revert 80278 for now, it caused a lot of MIPS tests to fail git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80280 91177308-0d34-0410-b5e6-96231b3b80d8 commit 862f67b71f0aaeccdd24a0cbd4d99a9a9413c43a Author: Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Date: Thu Aug 27 19:40:40 2009 +0000 Revamp our friend Mips :) Add MO flags to simplify the printing of relocations. Remove the support for printing large code model relocs (which aren't supported anyway). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80278 91177308-0d34-0410-b5e6-96231b3b80d8 commit 90adb6c4bd8c285660db59e5ac10fd71fa3c1076 Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 18:16:24 2009 +0000 Don't mark CMOV_GR8 as two-address, or commutable, since it's a pseudo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80271 91177308-0d34-0410-b5e6-96231b3b80d8 commit fa4c3253f6dd9f328549aa73e2710981ac3a2881 Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 18:14:26 2009 +0000 Adjust the MachineBasicBlock verifier rules to be more tolerant of blocks that end with "unreachable". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80270 91177308-0d34-0410-b5e6-96231b3b80d8 commit 20391ca63ee850ffd6fb86bfd058ff61b698197d Author: Eric Christopher <echristo@apple.com> Date: Thu Aug 27 18:08:16 2009 +0000 Add FIXME for when we support more specific XMM registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80269 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3d82bbd2ddfb775d59f271cc25cade73551f976c Author: Eric Christopher <echristo@apple.com> Date: Thu Aug 27 18:07:15 2009 +0000 Nuke trailing whitespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80268 91177308-0d34-0410-b5e6-96231b3b80d8 commit f8b840f45084d2486be3fd074807d9a37564a33d Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 18:02:03 2009 +0000 Use stripPointerCasts instead of doing the same manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80267 91177308-0d34-0410-b5e6-96231b3b80d8 commit a578538e9fde98cb05ce9740d7c63aafbd1c69f4 Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 17:59:08 2009 +0000 Minor code simplification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80266 91177308-0d34-0410-b5e6-96231b3b80d8 commit c99596ddbf78116260c177edcfad9261bf186b68 Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 17:55:13 2009 +0000 Teach getUnderlyingObject and skipPointerCasts about GlobalAliases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80265 91177308-0d34-0410-b5e6-96231b3b80d8 commit fe1256903404065be182735c1402411c4940e9e5 Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 17:54:15 2009 +0000 Be somewhat more consistent about const qualifiers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80264 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3c8455152e3d41b8e5f7b33c3ed99c7a8105f5a8 Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 17:52:56 2009 +0000 Global Aliases are not identifiable objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80263 91177308-0d34-0410-b5e6-96231b3b80d8 commit 54e98d921f7eabfd3baae5399e835ddc39a75e6c Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 17:51:25 2009 +0000 Handle TargetData with const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80262 91177308-0d34-0410-b5e6-96231b3b80d8 commit ec966442362eeff9b24c9eee2b11188ab4a5246b Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 17:29:49 2009 +0000 Strip trailing whitespace from blank lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80259 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7bec0f5f90c6d917beb4b1433c847aa132cdfacf Author: Gabor Greif <ggreif@gmail.com> Date: Thu Aug 27 17:07:35 2009 +0000 re-apply r80197, now that iterator.h is not mentioned any more git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80254 91177308-0d34-0410-b5e6-96231b3b80d8 commit aa152ae811d8e0ffd01c7a8b454d595cb1a1a31f Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Thu Aug 27 16:25:49 2009 +0000 Hopefully the final missing part :( scalar_to_vector is fully legal now git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80251 91177308-0d34-0410-b5e6-96231b3b80d8 commit 872393c20ee29eaae1746deed115f06192526f64 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Thu Aug 27 16:10:17 2009 +0000 Forgot about actual change :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80250 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0a21bce095161b98a3671b2aa0e63a020b03e120 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Thu Aug 27 16:04:47 2009 +0000 scalar_to_vector is fully legal now (implemented as subreg accesses) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80249 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2b6e274f8669337cb148c1df4e060a41af14cc1e Author: Devang Patel <dpatel@apple.com> Date: Thu Aug 27 15:32:38 2009 +0000 Remove an entry from ValueMap before removing elements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80247 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6e8275030925dbd3beeb873d0bf605f0c0c67f0b Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Thu Aug 27 14:51:42 2009 +0000 Ok, sometimes it's profitable to turn scalar_to_vector stuff into subreg access. Add a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80246 91177308-0d34-0410-b5e6-96231b3b80d8 commit baee7b2a5501a45a59554b5bafd87264a2edc442 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Thu Aug 27 14:38:44 2009 +0000 Transform float scalar_to_vector into subreg accesses. No idea whether this is profitable or not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80245 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9daa0677ac901b0f54bdba31dc3913b92df58e50 Author: Misha Brukman <brukman+llvm@gmail.com> Date: Thu Aug 27 14:14:21 2009 +0000 STRD and LDRD require ARMv5TE, not just ARMv5T. See http://llvm.org/PR4687 for more info and links. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80244 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4dd75744b70c1a3f686ce5a43952124fb0de7ad9 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Thu Aug 27 12:02:34 2009 +0000 Inverse logic to increase portability. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80240 91177308-0d34-0410-b5e6-96231b3b80d8 commit 07f1cdae7f327c15cdfc0d68c8500a275dba72b2 Author: Sanjiv Gupta <sanjiv.gupta@microchip.com> Date: Thu Aug 27 11:54:38 2009 +0000 To make mcc16 run correctly on mac. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80239 91177308-0d34-0410-b5e6-96231b3b80d8 commit 006e46ee524c49f00fdfa4d0b582c7ecd693c95b Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 08:17:51 2009 +0000 llvm-mc/Mach-O: Add MCCodeEmitter support, for encoding instructions. - No relocations yet, of course. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80235 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2f37963b50b496c99300850683ed41db4f9431b6 Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 08:12:55 2009 +0000 llvm-mc/X86: Implement single instruction encoding interface for MC. - Note, this is a gigantic hack, with the sole purpose of unblocking further work on the assembler (its also possible to test the mathcer more completely now). - Despite being a hack, its actually good enough to work over all of 403.gcc (although some encodings are probably incorrect). This is a testament to the beauty of X86's MachineInstr, no doubt! ;) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80234 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1f32816fdaf9ba3a7e6e5705f94be145fafde497 Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 07:58:57 2009 +0000 llvm-mc: Print encodings after the instruction, and only when we have an asm printer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80233 91177308-0d34-0410-b5e6-96231b3b80d8 commit 75513bd24edb8ea2142145b448df7a4cdaeaa335 Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 07:58:05 2009 +0000 X86: Mark EH_RETURN as code-gen-only. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80232 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0125384b4a902da228354e5a201cd4cf4f2f1a4a Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 07:57:12 2009 +0000 Add {MCInst,MCOperand}::{print,dump} git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80231 91177308-0d34-0410-b5e6-96231b3b80d8 commit 160f252aa8189beba57b0b025b0206a3910c4ae9 Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 07:56:39 2009 +0000 llvm-mc: Only show instruction encodings with --show-encoding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80230 91177308-0d34-0410-b5e6-96231b3b80d8 commit f449eb343e70f1e4e8f982939d53c083a1bc5ba3 Author: Gabor Greif <ggreif@gmail.com> Date: Thu Aug 27 06:59:20 2009 +0000 the buildbots revealed one more breakage. fix. (why didn't I see this?) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80227 91177308-0d34-0410-b5e6-96231b3b80d8 commit 765f012f22956a3085e1e84441af9d880bf65f35 Author: Gabor Greif <ggreif@gmail.com> Date: Thu Aug 27 06:41:46 2009 +0000 Clean up the minor mess I caused with removing iterator.h. I shall take care of 80-col violations and the FIXME later. (Thanks goodness that I live in another continent, so the monkeypox did not strike me :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80224 91177308-0d34-0410-b5e6-96231b3b80d8 commit bc42440879f2a302f2801e224828cfdccd5a92a7 Author: Chris Lattner <sabre@nondot.org> Date: Thu Aug 27 06:29:33 2009 +0000 Implement a new optimization in the inliner: if inlining multiple calls into a function and if the calls bring in arrays, try to merge them together to reduce stack size. For example, in the testcase we'd previously end up with 4 allocas, now we end up with 2 allocas. As described in the comments, this is not really the ideal solution to this problem, but it is surprisingly effective. For example, on 176.gcc, we end up eliminating 67 arrays at "gccas" time and another 24 at "llvm-ld" time. One piece of concern that I didn't look into: at -O0 -g with forced inlining this will almost certainly result in worse debug info. I think this is acceptable though given that this is a case of "debugging optimized code", and we don't want debug info to prevent the optimizer from doing things anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80215 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2d1272cbbc0ba9bffbc702e67c59a8d12ec93660 Author: Chris Lattner <sabre@nondot.org> Date: Thu Aug 27 06:20:45 2009 +0000 the inliner shouldn't crash on this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80214 91177308-0d34-0410-b5e6-96231b3b80d8 commit ea3bccb555f65187ecbb134d26aab8103ca167b2 Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 06:11:15 2009 +0000 For now, only run MC tests if X86 is configured. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80213 91177308-0d34-0410-b5e6-96231b3b80d8 commit 17d1a4db879f7af0fd20dd78f704ff9f82aabbe1 Author: Bill Wendling <isanbard@gmail.com> Date: Thu Aug 27 05:49:50 2009 +0000 This is passing for PPC on Mac OS X. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80210 91177308-0d34-0410-b5e6-96231b3b80d8 commit cf5d1d8ceb34c56f21bd3f41f5329407e8d090ce Author: Bill Wendling <isanbard@gmail.com> Date: Thu Aug 27 05:35:28 2009 +0000 Revert accidental commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80208 91177308-0d34-0410-b5e6-96231b3b80d8 commit f659a56d993743e0d51beb2c94fbe187637e5918 Author: Chris Lattner <sabre@nondot.org> Date: Thu Aug 27 04:43:05 2009 +0000 unbreak the build, yay for symlinks + makefiles. :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80205 91177308-0d34-0410-b5e6-96231b3b80d8 commit d1586b1a1d27d5efeb8e487bbeb7ed255159e53b Author: Chris Lattner <sabre@nondot.org> Date: Thu Aug 27 04:32:07 2009 +0000 reduce header #include'age git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80204 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1ba292d8cfe7b5bf705c5bb307f63f0c0bbe8979 Author: Chris Lattner <sabre@nondot.org> Date: Thu Aug 27 04:20:52 2009 +0000 enhance InlineFunction to be able to optionally return a the list of static allocas that it inlined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80203 91177308-0d34-0410-b5e6-96231b3b80d8 commit eb87590c5346b7c17032242e2232a6c1d217f964 Author: Chris Lattner <sabre@nondot.org> Date: Thu Aug 27 04:02:30 2009 +0000 smallvectorize the list of returns built by CloneAndPruneFunctionInto. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80202 91177308-0d34-0410-b5e6-96231b3b80d8 commit 612956220f38126feaacceb378cf105043739271 Author: Chris Lattner <sabre@nondot.org> Date: Thu Aug 27 03:56:43 2009 +0000 remove CloneTrace, which appears to be dead since 2004. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80201 91177308-0d34-0410-b5e6-96231b3b80d8 commit ae56c0de911bf5328ffda48e51ce37bcd7aa0d76 Author: Chris Lattner <sabre@nondot.org> Date: Thu Aug 27 03:51:50 2009 +0000 reduce inlining factor some stuff out to a static helper function, and other code cleanups. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80199 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5537c20c55869fac64e4f5738f8eab2080cc79c6 Author: Bill Wendling <isanbard@gmail.com> Date: Thu Aug 27 03:32:50 2009 +0000 Revert accidental commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80198 91177308-0d34-0410-b5e6-96231b3b80d8 commit 25cd944a98bcf3b1542c71d2654fe61e28562867 Author: Bill Wendling <isanbard@gmail.com> Date: Thu Aug 27 03:29:26 2009 +0000 --- Reverse-merging r80147 into '.': A include/llvm/ADT/iterator.cmake U autoconf/configure.ac --- Reverse-merging r80161 into '.': U cmake/config-ix.cmake --- Reverse-merging r80171 into '.': U Makefile --- Reverse-merging r80173 into '.': U configure U include/llvm/Config/config.h.in --- Reverse-merging r80180 into '.': A include/llvm/ADT/iterator.h.in Despite common miscomceptions, iterator.h is alive and well. It broke the build bots for several hours. And yet no one bothered to look at them. Gabor and Doug, please review your changes and make sure that they actually build before resubmitting them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80197 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0d0598f6281c0b1ae107b2fa2fabd69ec21263c4 Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 02:43:49 2009 +0000 Add some checks for MachineCFG consistency. Use AnalyzeBranch and do extra checking when it succeeds, as those are cases where CodeGen will be doing particularly interesting CFG modifications. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80196 91177308-0d34-0410-b5e6-96231b3b80d8 commit 92e5548870b7945deb93f7956ea816f67d34b73f Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 02:08:37 2009 +0000 Update CMake git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80195 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2f377df6bba8110c3bc0bf5185d33d1f46b54c6b Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 01:34:22 2009 +0000 llvm-mc: Tweak MCCodeEmitter skeleton. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80193 91177308-0d34-0410-b5e6-96231b3b80d8 commit cdde2975f55c43493f3318630985e7a1e8e14384 Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 01:25:57 2009 +0000 Initialize the PoisonMemory member before initializing members that call methods that read the PoisonMemory member. This fixes potential spurious (though probably otherwise harmless) poising of unused memory, and fixes the associated valgrind error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80192 91177308-0d34-0410-b5e6-96231b3b80d8 commit 363cd759d4186bdae7b49e89a0d434749d6198aa Author: Evan Cheng <evan.cheng@apple.com> Date: Thu Aug 27 01:23:50 2009 +0000 Fix PR4789. Teach eliminateFrameIndex how to handle VLDRQ and VSTRQ which cannot fold any immediate offset. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80191 91177308-0d34-0410-b5e6-96231b3b80d8 commit 511e71114c34c8ddae2b44b996502a5efe1adc3a Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 01:15:54 2009 +0000 Add missing declarations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80190 91177308-0d34-0410-b5e6-96231b3b80d8 commit 12266adfd9dc571aafb7ec7f8b69d85c7a6e352a Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 00:51:57 2009 +0000 Sketch TargetRegistry support for MCCodeEmitter abstract interface. - Of course, nothing actually can provide this interface yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80188 91177308-0d34-0410-b5e6-96231b3b80d8 commit adb77e4c37d183af9a2f29b6df8b0dfee562bbba Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Aug 27 00:38:04 2009 +0000 Try to make MSVC just a little happier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80187 91177308-0d34-0410-b5e6-96231b3b80d8 commit b59f15a1d2c40f978d93f43b006546f455a65f04 Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 00:31:47 2009 +0000 X86FastISel support for loading and storing values of type i1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80186 91177308-0d34-0410-b5e6-96231b3b80d8 commit 29b998f5248398e6cfe323a5ebd7419bb77975b4 Author: Dan Gohman <gohman@apple.com> Date: Thu Aug 27 00:14:12 2009 +0000 Expand i8 selects into control flow instead of 16-bit conditional moves. This avoids the need to promote the operands (or implicitly extend them, a partial register update condition), and can reduce i8 register pressure. This substantially speeds up code such as write_hex in lib/Support/raw_ostream.cpp. subclass-coalesce.ll is too trivial and no longer tests what it was originally intended to test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80184 91177308-0d34-0410-b5e6-96231b3b80d8 commit a7bddb52ed1bb68e8c654c522b885f941c540d04 Author: Gabor Greif <ggreif@gmail.com> Date: Wed Aug 26 23:35:33 2009 +0000 now that include/llvm/ADT/iterator.h.in is not attempted to be built, its prerequisite can go away too git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80180 91177308-0d34-0410-b5e6-96231b3b80d8 commit b5b99e6fa820047460b362d5d981766ac313b1ce Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 23:12:33 2009 +0000 Simplify. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80176 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2eff5fff4d600df3d29f74dd195bc564a48206b4 Author: Douglas Gregor <doug.gregor@gmail.com> Date: Wed Aug 26 22:59:05 2009 +0000 Regenerate configure git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80173 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3eace462948ecfec5ee53127c445e4d0d5f1ae89 Author: Gabor Greif <ggreif@gmail.com> Date: Wed Aug 26 22:55:19 2009 +0000 eliminate references to ADT/iterator.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80171 91177308-0d34-0410-b5e6-96231b3b80d8 commit d68b1af98ca9bb39ac51d046a37266ceb24e38b5 Author: Owen Anderson <resistor@mac.com> Date: Wed Aug 26 22:55:11 2009 +0000 Make this into a static method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80170 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2f01e9983a054713a49d2ac2124e8ca26d128574 Author: Bob Wilson <bob.wilson@apple.com> Date: Wed Aug 26 22:50:39 2009 +0000 Fix bad length argument to substr calls. Apparently I'm the first one to attempt more than 2 constraints on an instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80169 91177308-0d34-0410-b5e6-96231b3b80d8 commit 418706d9a8a304630ddecc3709598d823bee8188 Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 22:49:51 2009 +0000 llvm-mc/Mach-O: Unique sections properly, so we don't get duplicate text sections, etc. - The quick and dirty way, just clone the TargetLoweringObjectFile code. Eventually this should be shared... somehow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80168 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1ea86df7ddb44659fbf694934abb2177beed8637 Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 22:13:22 2009 +0000 llvm-mc/Mach-O: Don't put assembler temporary labels in the symbol table. - I moved section creation back into AsmParser. I think policy decisions like this should be pushed higher, not lower, when possible (in addition the assembler has flags which change this behavior, for example). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80162 91177308-0d34-0410-b5e6-96231b3b80d8 commit b003759e247f0edb3b691849598ba252f51ae624 Author: Douglas Gregor <doug.gregor@gmail.com> Date: Wed Aug 26 22:12:02 2009 +0000 De-bork CMake build git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80161 91177308-0d34-0410-b5e6-96231b3b80d8 commit e92cc8d5591cb7ded636c91cc98c741af62ec85f Author: Eric Christopher <echristo@apple.com> Date: Wed Aug 26 21:44:57 2009 +0000 Rework getPersonalityIndex slightly - 0 is now a valid and not-NULL personality function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80153 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2a1099a6809307eee7521b1f725ef89370f7ebd1 Author: Gabor Greif <ggreif@gmail.com> Date: Wed Aug 26 21:36:59 2009 +0000 nobody includes llvm/ADT/iterator.h any more, so get rid of this monstrosity. iterator.h.in is scheduled for deletion in my working copy, but I wait till I see that configure gets regenerated, as it depends on it. I'll commit then. There are still some AC_* tests in the configure.ac dealing with iterators, those can be zapped probably too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80147 91177308-0d34-0410-b5e6-96231b3b80d8 commit c87d5ae938fe0c3b0afc3aefef1dc6a9873516e4 Author: Eric Christopher <echristo@apple.com> Date: Wed Aug 26 21:30:49 2009 +0000 If we're emitting additional CIEs due to personality functions don't emit the default one. Explicitly check for the NULL CIE later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80146 91177308-0d34-0410-b5e6-96231b3b80d8 commit 84603633a7609ec55de5d8145048efbbf45e5c9c Author: Eric Christopher <echristo@apple.com> Date: Wed Aug 26 21:27:09 2009 +0000 Nuke trailing whitespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80145 91177308-0d34-0410-b5e6-96231b3b80d8 commit f8c4bb7da634d77a7f2cff601b8d3f53c143e9ad Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 21:22:22 2009 +0000 llvm-mc/Mach-O: Set .subsections_via_symbols flag properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80144 91177308-0d34-0410-b5e6-96231b3b80d8 commit 87f46499f001931c031002473a73793772852e51 Author: Bill Wendling <isanbard@gmail.com> Date: Wed Aug 26 21:00:34 2009 +0000 Don't submit test directory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80139 91177308-0d34-0410-b5e6-96231b3b80d8 commit 441e205eb82a0ebd70b807d8560c5a76188eabc5 Author: Reid Kleckner <reid@kleckner.net> Date: Wed Aug 26 20:58:25 2009 +0000 Allocate the module provider in the Kaleidoscope code on the heap, not the stack, so that it can be properly deleted. Also update the tutorial with the new code. This fixes PR4762, hopefully better than the last time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80138 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4952aa5163ff4e87910d461f06316cc793ca95b8 Author: Gabor Greif <ggreif@gmail.com> Date: Wed Aug 26 19:16:32 2009 +0000 Remove all the LLVM_COMPACTIFY_SENTINELS-related macro magic as discussed with Chris on IRC. Anybody wanting to debug sentinel dereferencing problems must revert this patch and perform the indicated modifications. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80128 91177308-0d34-0410-b5e6-96231b3b80d8 commit ffefef35790db7819c72ba7e53c73b8e5931e851 Author: Oscar Fuentes <ofv@wanadoo.es> Date: Wed Aug 26 18:37:05 2009 +0000 CMake: Removed outdated TODO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80124 91177308-0d34-0410-b5e6-96231b3b80d8 commit 66448030685cdc3c9bfd52449e4027258aaba480 Author: Venkatraman Govindaraju <venkatra@cs.wisc.edu> Date: Wed Aug 26 18:24:12 2009 +0000 Generate section for bss and enable weak symbols git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80121 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3a392c8714c745ffdc77da0a8589c7b0df03515f Author: Bob Wilson <bob.wilson@apple.com> Date: Wed Aug 26 18:11:50 2009 +0000 Convert some more Neon tests to FileCheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80120 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5e69950d5391bdf294b415bf39dd44f9f40556a1 Author: Dale Johannesen <dalej@apple.com> Date: Wed Aug 26 18:10:32 2009 +0000 Alter 79292 to produce output that actually assembles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80119 91177308-0d34-0410-b5e6-96231b3b80d8 commit 23f2034aaff80f52b309ee17bfa7a9fc801c9677 Author: Mike Stump <mrs@apple.com> Date: Wed Aug 26 18:02:19 2009 +0000 Allow unsigned long long DenseMapInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80118 91177308-0d34-0410-b5e6-96231b3b80d8 commit b1b88455b18224867a8d2fc6c3202b6ce12e0a1c Author: Bob Wilson <bob.wilson@apple.com> Date: Wed Aug 26 17:39:53 2009 +0000 Remove unneeded ARM-specific DAG nodes for VLD* and VST* Neon operations. The instructions can be selected directly from the intrinsics. We will need to add some ARM-specific nodes for VLD/VST of 3 and 4 128-bit vectors, but those are not yet implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80117 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0defefd8ce9f13cecba8c988897c3224a25e96f8 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Wed Aug 26 17:39:40 2009 +0000 Add extload expansion for f128 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80116 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3e72169c1b197ef8c5b4c663e2eee4551a3a7178 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Wed Aug 26 17:39:23 2009 +0000 Unbreak FP128 stuff in cbe git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80115 91177308-0d34-0410-b5e6-96231b3b80d8 commit 644cdc3c64cb485c6a21d1bfb126c107e5b40d64 Author: Oscar Fuentes <ofv@wanadoo.es> Date: Wed Aug 26 17:05:06 2009 +0000 Ignore -fPIC test on Windows. Suggested by Yonggang Luo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80111 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8427b6b0529e66663737b39ea51a1fbdbbbbd534 Author: Douglas Gregor <doug.gregor@gmail.com> Date: Wed Aug 26 16:33:57 2009 +0000 Unbreak CMake build git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80109 91177308-0d34-0410-b5e6-96231b3b80d8 commit 886f20275a78a1b03b83a8145a62f5e4cfbb1c99 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Wed Aug 26 16:26:09 2009 +0000 Expand scalar_to_vector - we don't have any isel logic for it now git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80107 91177308-0d34-0410-b5e6-96231b3b80d8 commit 75c687bcc528eb81dc693d63f7aff9185b29e56f Author: Dan Gohman <gohman@apple.com> Date: Wed Aug 26 16:06:11 2009 +0000 Add comments detailing a known bug, so that people writing other backends don't use it as an example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80105 91177308-0d34-0410-b5e6-96231b3b80d8 commit 32b17ffaa8593d25728c9ebad7e82a45c16f817c Author: Dan Gohman <gohman@apple.com> Date: Wed Aug 26 15:57:57 2009 +0000 -fast is now -O0. -fast-isel is no longer experimental. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80104 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4637d177299aed45c6be7ca24e003771f33fd5d6 Author: Dan Gohman <gohman@apple.com> Date: Wed Aug 26 15:56:38 2009 +0000 Move ProfileInfo::Edge's operator<< out of line. Among other benefits, this eliminates the ATTRIBUTE_USED, which wasn't being used in a manner acceptable to some GCC versions, according to the buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80103 91177308-0d34-0410-b5e6-96231b3b80d8 commit a064a395489f954b0eaafb351d15b456699dea8e Author: Andreas Neustifter <astifter@gmx.at> Date: Wed Aug 26 15:18:38 2009 +0000 Bugfix for r80100, forgot include. Sorry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80101 91177308-0d34-0410-b5e6-96231b3b80d8 commit 70eeb51888ed9e73d058a3b0c889c295219e2109 Author: Andreas Neustifter <astifter@gmx.at> Date: Wed Aug 26 15:13:44 2009 +0000 Implemented comments from Daniel Dunbar. (See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090817/084958.html) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80100 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9959b052347ceddec3576013485f2564b99b944e Author: Dan Gohman <gohman@apple.com> Date: Wed Aug 26 14:59:13 2009 +0000 Don't use INSERT_SUBREG to model anyext operations on x86-64, as it leads to partial-register definitions. To help avoid redundant zero-extensions, also teach the h-register matching patterns that use movzbl to match anyext as well as zext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80099 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9927f829a68b645ed5813b25e21a881d94fc80d8 Author: Dan Gohman <gohman@apple.com> Date: Wed Aug 26 14:53:06 2009 +0000 Create a ScalarEvolution-based AliasAnalysis implementation. This is a simple AliasAnalysis implementation which works by making ScalarEvolution queries. ScalarEvolution has a more complete understanding of arithmetic than BasicAA's collection of ad-hoc checks, so it handles some cases that BasicAA misses, for example p[i] and p[i+1] within the same iteration of a loop. This is currently experimental. It may be that the main use for this pass will be to help find cases where BasicAA can be profitably extended, or to help in the development of the overall AliasAnalysis infrastructure, however it's also possible that it could grow up to become a directly useful pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80098 91177308-0d34-0410-b5e6-96231b3b80d8 commit 596114dc06489e5bd79e3e8ffc60d43bbf3668e3 Author: Dan Gohman <gohman@apple.com> Date: Wed Aug 26 14:34:12 2009 +0000 Fix a missing newline, now that Value's operator<< doesn't add one of its own. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80096 91177308-0d34-0410-b5e6-96231b3b80d8 commit 84c793aef4170e0d5be4d2c6fcb26a9e56cad21b Author: Dan Gohman <gohman@apple.com> Date: Wed Aug 26 14:32:17 2009 +0000 Use SetVector instead of std::set so that alias relations are tested and printed in a deterministic order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80095 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8fa9da2b34655a15102a0845617a9951ee945ed6 Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 13:58:10 2009 +0000 llvm-mc/Mach-O: Add support for relocations. - I haven't really tried to find the "right" way to store the fixups or apply them, yet. This works, but isn't particularly elegant or fast. - Still no evaluation support, so we don't actually ever not turn a fixup into a relocation entry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80089 91177308-0d34-0410-b5e6-96231b3b80d8 commit c3c1992d46f418c45a8e0b5fdb3c452c90aa960e Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 13:57:54 2009 +0000 llvm-mc/Mach-O: Move symbol indices into the MCSymbolData structure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80088 91177308-0d34-0410-b5e6-96231b3b80d8 commit cefbda1f46cc612e074fdcc1d8aab712aba085e7 Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 13:57:44 2009 +0000 llvm-mc/Mach-O: Dump relocations and section data (optionally) in my Mach-O dumper. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80087 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4486ac16542e9dd843778c5f684e1cd9d7bb3945 Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 13:57:37 2009 +0000 llvm-mc: Add symbol entries for undefined symbols used in .fill and .org. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80086 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7c672df8b969b7514438228bed80cfad6e9c473e Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Wed Aug 26 13:44:29 2009 +0000 Add dummy inline asm handling for 'r' constraint. This fixes PR4778 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80085 91177308-0d34-0410-b5e6-96231b3b80d8 commit 39fd40ae8671ecff6a1857b5a0156e52284c4e5c Author: Andreas Neustifter <astifter@gmx.at> Date: Wed Aug 26 13:33:09 2009 +0000 Moved isDeclaration() check further down to allow for function counts for declarations if necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80084 91177308-0d34-0410-b5e6-96231b3b80d8 commit 92183c031a21857a580b38795272ce80863b9ebf Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 09:16:57 2009 +0000 llvm-mc: Change MCContext value table to take const MCSymbol*s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80079 91177308-0d34-0410-b5e6-96231b3b80d8 commit b9d13ac6e4228451c6fe54566064978597aabc1b Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 09:16:46 2009 +0000 llvm-mc: Make MCValue take const MCSymbol*s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80078 91177308-0d34-0410-b5e6-96231b3b80d8 commit cb73cfe2496d5e70d8cc4c89e7de29373b348353 Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 09:16:34 2009 +0000 llvm-mc: Make non-sensical max bytes to .align an error. Also, warn about overflow in alignment values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80077 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3e64a6cc0e75cf654fd23ac9ffa1a9a1d3d911e9 Author: Andreas Neustifter <astifter@gmx.at> Date: Wed Aug 26 09:05:21 2009 +0000 Changed std::cout to outs(), retaining formating. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80076 91177308-0d34-0410-b5e6-96231b3b80d8 commit 94060421ce73922e71c183fba0fda8bace7d0e2d Author: Devang Patel <dpatel@apple.com> Date: Wed Aug 26 05:01:18 2009 +0000 Revert 79977. It causes llvm-gcc bootstrap failures on some platforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80073 91177308-0d34-0410-b5e6-96231b3b80d8 commit 66d02907de42fa311fb2b512e820277bb1a61e7c Author: Chris Lattner <sabre@nondot.org> Date: Wed Aug 26 05:00:16 2009 +0000 some mips and some sparc compilers apparently predefine mips and sparc respectively. Just overrule them :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80072 91177308-0d34-0410-b5e6-96231b3b80d8 commit 202ced1e32f5a88a8c865e62ea10c88a712c3fab Author: Venkatraman Govindaraju <venkatra@cs.wisc.edu> Date: Wed Aug 26 04:50:17 2009 +0000 test commit git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80070 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3eb9a3f37ed8ee8e026d2dfebe6bae08df4e615d Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 04:28:45 2009 +0000 llvm-mc: Fix tests for python variations in int printing, sigh. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80069 91177308-0d34-0410-b5e6-96231b3b80d8 commit 53a9082d2e95f33980ef2b7f5104e0cc46d6342d Author: Chris Lattner <sabre@nondot.org> Date: Wed Aug 26 04:21:30 2009 +0000 fix some funky indentation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80068 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0f56d41709c27ec2f0637e19881fefd90e31c22b Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 04:13:32 2009 +0000 llvm-mc/Mach-O: Add section padding where needed (to align the next section). Also, simplify some of Mach-O writer code which can now use section addresses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80067 91177308-0d34-0410-b5e6-96231b3b80d8 commit b3730b1a3de7fe37a660bd30d3d0d55bcea22d1d Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 02:48:04 2009 +0000 llvm-mc/Mach-O: Set addresses for symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80065 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7fd6b0fff74a7c9fbc054b3303fee1a8f22002b2 Author: Dale Johannesen <dalej@apple.com> Date: Wed Aug 26 01:08:21 2009 +0000 Add an 'inline hint' attribute to represent source code hints that it would be a good idea to inline a function ("inline" keyword). No functional change yet; FEs do not emit this and inliner does not use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80063 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2e1a5d0b91503b8d5ada9fe0b19567daca2f1c6f Author: Devang Patel <dpatel@apple.com> Date: Wed Aug 26 00:39:50 2009 +0000 Add isClosure() predicate. This is used to add DW_AT_APPLE_block attribute. Patch by Caroline Tice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80061 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6d294da8f845a8d611529759d194315b76b44a6e Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 00:18:21 2009 +0000 llvm-mc: Improve indirect symbol support (add the indirect index table). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80059 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3b126fbc67c6279898f8ca0c31f233a3a56b31d9 Author: Dan Gohman <gohman@apple.com> Date: Wed Aug 26 00:13:22 2009 +0000 Remove unused variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80058 91177308-0d34-0410-b5e6-96231b3b80d8 commit bdd4dc67fb10d0f304bec21c924263f8444ae7a7 Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Aug 26 00:10:55 2009 +0000 llvm-mc: Add MCSection::isDefined() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80057 91177308-0d34-0410-b5e6-96231b3b80d8 commit 917614663633aa0ff1bdf7208862e8b7e25dd911 Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 23:27:45 2009 +0000 Fix the InsertAtEnd form of ShuffleVectorInst constructor to use the correct type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80050 91177308-0d34-0410-b5e6-96231b3b80d8 commit e6803b821738076b5b2299c1cd496be0d0042362 Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 23:17:54 2009 +0000 Eliminate the unused Context argument on one of the ICmpInst and FCmpInst constructors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80049 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4e46ac9407307942712236f8c91875ef323c182f Author: Gabor Greif <ggreif@gmail.com> Date: Tue Aug 25 23:02:21 2009 +0000 revert r78628 and r78803 as these are not needed any more git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80048 91177308-0d34-0410-b5e6-96231b3b80d8 commit 58d95377713fa32cbf129e19f4005f4863f9cdb3 Author: Scott Michel <scottm@aero.org> Date: Tue Aug 25 22:37:34 2009 +0000 Updated i128 sext support for CellSPU backend, contributed by Ken Werner (IBM) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80042 91177308-0d34-0410-b5e6-96231b3b80d8 commit 91bf99a35153b00098633f214207c308c52acdcd Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 22:29:08 2009 +0000 Use covariant return types for Instruction::clone, and eliminate the forms of ExtractElementInst and InsertElementInst that are equivalent to clone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80041 91177308-0d34-0410-b5e6-96231b3b80d8 commit 97be9d37d93c38bc82950e0373cd3a8d1d2aa024 Author: Owen Anderson <resistor@mac.com> Date: Tue Aug 25 22:27:22 2009 +0000 Get rid of this horrible "benign race" by exploiting ManagedStatic to initialize the array on its first access. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80040 91177308-0d34-0410-b5e6-96231b3b80d8 commit ba4fe8b91352f65caaf2a30f234b5006afd1cf2b Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 22:24:20 2009 +0000 This should use isIndenticalToWhenDefined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80039 91177308-0d34-0410-b5e6-96231b3b80d8 commit fc00c4a2407c1b30a19fef9ec0a1ae00f7f7472d Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 22:11:20 2009 +0000 Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined, and introduce a new Instruction::isIdenticalTo which tests for full identity, including the SubclassOptionalData flags. Also, fix the Instruction::clone implementations to preserve the SubclassOptionalData flags. Finally, teach several optimizations how to handle SubclassOptionalData correctly, given these changes. This fixes the counterintuitive behavior of isIdenticalTo not comparing the full value, and clone not returning an identical clone, as well as some subtle bugs that could be caused by these. Thanks to Nick Lewycky for reporting this, and for an initial patch! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80038 91177308-0d34-0410-b5e6-96231b3b80d8 commit e73ff31d813cdc36e334404992c42bfef7842c95 Author: Bill Wendling <isanbard@gmail.com> Date: Tue Aug 25 21:31:39 2009 +0000 Revert last patch. We need to put this into TargetLowering. There will be a lot of EH stuff going into there, so we can wait to add them all then. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80036 91177308-0d34-0410-b5e6-96231b3b80d8 commit 12d46f5ea460e149882e39dc25c649580a161141 Author: Gabor Greif <ggreif@gmail.com> Date: Tue Aug 25 21:25:22 2009 +0000 re-committing yesterday's r79938. This time there is no additional include of llvm/Config/config.h at all. Instead I use a hard-coded preprecessor symbol: LLVM_COMPACTIFY_SENTINELS (should this work on the self-hosting buildbot, then cleanups come next) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80035 91177308-0d34-0410-b5e6-96231b3b80d8 commit b81243240cbfc573324c9760a77e6b1463955bab Author: Daniel Dunbar <daniel@zuster.org> Date: Tue Aug 25 21:10:45 2009 +0000 llvm-mc: Add statistic for number of fragments emitted by the assembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80033 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4f61e5051fa25f4abb928573db6ea52585748b93 Author: Bill Wendling <isanbard@gmail.com> Date: Tue Aug 25 21:09:50 2009 +0000 Add the #include here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80032 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4b90952a9dd2b26ef6dd359cb8e4f7139e40f864 Author: Chris Lattner <sabre@nondot.org> Date: Tue Aug 25 21:01:56 2009 +0000 remove some dead lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80031 91177308-0d34-0410-b5e6-96231b3b80d8 commit 538dfe54dd1c732208b2dbb00057b0a58cdeb61e Author: Bill Wendling <isanbard@gmail.com> Date: Tue Aug 25 21:01:42 2009 +0000 Comment formatting. Removing of unused #include and type forwarding. OCD is fun! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80030 91177308-0d34-0410-b5e6-96231b3b80d8 commit f2db1075b5a1bf1ea8f2d2c618917651150b8a94 Author: Chris Lattner <sabre@nondot.org> Date: Tue Aug 25 20:57:38 2009 +0000 convert to filecheck style git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80029 91177308-0d34-0410-b5e6-96231b3b80d8 commit 864504a5810fdfd23e1774de0b935dcdafb91645 Author: Chris Lattner <sabre@nondot.org> Date: Tue Aug 25 20:49:04 2009 +0000 convert to filecheck git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80025 91177308-0d34-0410-b5e6-96231b3b80d8 commit e371d63e2a817eda5e3563eb574c99fa08df7e6d Author: Bill Wendling <isanbard@gmail.com> Date: Tue Aug 25 20:21:17 2009 +0000 Add a target asm info hook to specify that particular bits of data in the FDE should be forced to 32-bits (.long) even on 64-bit architectures. Darwin wants these bits to be 64-bits (.quad). However, other platforms may disagree. This is just the info right now and is part of a work-in-progress which needs this. We'll add the actual *use* of this soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80024 91177308-0d34-0410-b5e6-96231b3b80d8 commit b0b96906a0018edbadd9f4f3b17b48ec3c29838e Author: Daniel Dunbar <daniel@zuster.org> Date: Tue Aug 25 20:21:09 2009 +0000 EXIT STAGE LEFT: gccas, gccld git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80023 91177308-0d34-0410-b5e6-96231b3b80d8 commit 13808ef92db201ec027004b4fd8eb2db55c5aae4 Author: Sanjiv Gupta <sanjiv.gupta@microchip.com> Date: Tue Aug 25 19:39:05 2009 +0000 Start refactoring PIC16 TargetObjectFile code. Eventually, all the stuff from PIC16Section will move to MCSectionPIC16. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80021 91177308-0d34-0410-b5e6-96231b3b80d8 commit b1d423e0cccd3f78122a5e8c9e959c8569b23bb0 Author: Daniel Dunbar <daniel@zuster.org> Date: Tue Aug 25 18:45:03 2009 +0000 Switch abi-isel.ll to FileCheck; it's not much faster, but it now tests a lot more and is much nicer to the OS. - Dan, please check. If there are parts of the test you think I should strip out so it doesn't cause random failures let me know (there are still some PIC label numbers in it, for example). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80019 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1d99646fa9e8847b0ceb086e33a24ed707491684 Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 17:56:57 2009 +0000 Don't assume that two identical instructions that read from memory will always return the same value. This isn't currently necessary, since this code doesn't currently ever get called under circumstances where it would matter, but it may some day. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80017 91177308-0d34-0410-b5e6-96231b3b80d8 commit 82d30b73d3a37de0ec7960a4e099ef9e255d4f11 Author: Bob Wilson <bob.wilson@apple.com> Date: Tue Aug 25 17:52:39 2009 +0000 Remove some unused SDNode definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80015 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5bba145cbd5935b442e6a197eda3477f5d1372a5 Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 17:49:57 2009 +0000 Teach ScalarEvolution about GlobalAliases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80014 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1c17fd9fbdcfebe29c7ea59c2c7675e420aa49f5 Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 17:48:17 2009 +0000 Delete some unnecessary flushes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80013 91177308-0d34-0410-b5e6-96231b3b80d8 commit 814c2eaa0121afd0661d8a2b5f715fcb1174f0b5 Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 17:47:44 2009 +0000 Use X86II::MO_NO_FLAG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80012 91177308-0d34-0410-b5e6-96231b3b80d8 commit 316062a4d193609d98e80e64389fc2094ad8c515 Author: Bob Wilson <bob.wilson@apple.com> Date: Tue Aug 25 17:46:06 2009 +0000 Expose the instruction contraint string as an argument to the NLdSt class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80011 91177308-0d34-0410-b5e6-96231b3b80d8 commit 208278cfa708aa6e5fcca6d1b92ee780beb72a8c Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 17:42:10 2009 +0000 Special-case static allocas in IndVarSimplify's loop invariant sinking code, since they are special. If the loop preheader happens to be the entry block of a function, don't sink static allocas out of it. This fixes PR4775. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80010 91177308-0d34-0410-b5e6-96231b3b80d8 commit 36ed6c0368d77188063d1594e54c52df1438ae87 Author: Owen Anderson <resistor@mac.com> Date: Tue Aug 25 17:42:07 2009 +0000 Comment-ify. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80009 91177308-0d34-0410-b5e6-96231b3b80d8 commit 845a722eb435c2a9c0528b13a472e595340b6dd8 Author: Owen Anderson <resistor@mac.com> Date: Tue Aug 25 17:35:37 2009 +0000 Switch to SmallVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80007 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2845c6f885c8c7615610ab8494f7535a8f67334c Author: Owen Anderson <resistor@mac.com> Date: Tue Aug 25 17:26:32 2009 +0000 Pull out this predicate loop into a helper function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80006 91177308-0d34-0410-b5e6-96231b3b80d8 commit a9c16fe7d4d2b61191b362a5d073bdc95c123c0f Author: David Goodwin <david_goodwin@apple.com> Date: Tue Aug 25 17:03:05 2009 +0000 Fixup register kills after scheduling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80002 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9518d88d270c05fb576604fc813405de177e2e34 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Tue Aug 25 17:00:23 2009 +0000 Provide dynamic_stackalloc lowering for MSP430. This fixes PR4769 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80001 91177308-0d34-0410-b5e6-96231b3b80d8 commit b802d676875f2df286887be83419649770dd8580 Author: Edwin Török <edwintorok@gmail.com> Date: Tue Aug 25 16:53:15 2009 +0000 Remove target triple from this test, it fails on x86-64 with --enable-targets=host-only otherwise. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80000 91177308-0d34-0410-b5e6-96231b3b80d8 commit e577ff861e934b98cb950a0b0d32d0a9a1dce8b1 Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 16:00:35 2009 +0000 Allocate the basic types inside the LLVMContextImpl instance, rather than separately with new. Move the members above the TypeMap members to avoid destruction order issues. This fixes a leak of these objects, and eliminates an extra level of indirection in Type::getInt32Ty and friends. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79997 91177308-0d34-0410-b5e6-96231b3b80d8 commit 87489cff37dde33a9dbb37fbfbad46ce2f70c8af Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 15:54:01 2009 +0000 Update documentation for the -f change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79996 91177308-0d34-0410-b5e6-96231b3b80d8 commit a0e89b2e414df522132636eb256ecbcc2d01a4e8 Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 15:45:44 2009 +0000 Fix a few typos from the removal of -f. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79994 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2d65d35d9233277aee7c8a6d3643740e3ed29f0b Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 15:38:29 2009 +0000 Remove obsolete -f flags. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79992 91177308-0d34-0410-b5e6-96231b3b80d8 commit 176426d2102142aaa0bf19aca55f528ceb873329 Author: Dan Gohman <gohman@apple.com> Date: Tue Aug 25 15:34:52 2009 +0000 Make LLVM command-line tools overwrite their output files without -f. This is conventional command-line tool behavior. -f now just means "enable binary output on terminals". Add a -f option to llvm-extract and llvm-link, for consistency. Remove F_Force from raw_fd_ostream and enable overwriting and truncating by default. Introduce an F_Excl flag to permit users to enable a failure when the file already exists. This flag is currently unused. Update Makefiles and documentation accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79990 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8c949d7c548ed4ec883a2c8bd922607be2563f5a Author: Andreas Neustifter <astifter@gmx.at> Date: Tue Aug 25 12:53:27 2009 +0000 Read profile files as binary as proposed in http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-August/025020.html. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79983 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9112f5f6755a85f10036ff20741fc264622dc14a Author: Xerxes Ranby <xerxes@zafena.se> Date: Tue Aug 25 10:12:55 2009 +0000 Fix PR4772 ARM JIT.GlobalInFuction unittest by explicitly initialize MMI to 0 during JITEmitter constructor. Modified: lib/ExecutionEngine/JIT/JITEmitter.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79982 91177308-0d34-0410-b5e6-96231b3b80d8 commit a75796301ee17e60daea754e30a035a53891650d Author: Bill Wendling <isanbard@gmail.com> Date: Tue Aug 25 08:08:33 2009 +0000 - Rename EmitCommonInformationEntry to EmitCIE. - Rename EmitFunctionDescriptionEntry to EmitFDE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79981 91177308-0d34-0410-b5e6-96231b3b80d8 commit 57b83c78f56324e3a8ff636b311235f6f2350b4e Author: Devang Patel <dpatel@apple.com> Date: Tue Aug 25 05:24:07 2009 +0000 Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well. This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79977 91177308-0d34-0410-b5e6-96231b3b80d8 commit bcc93309ca3632b3cd2b45f265a534256be7589a Author: Bill Wendling <isanbard@gmail.com> Date: Tue Aug 25 02:32:05 2009 +0000 - Emit new line after each FDE. - Fix comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79971 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4767b24840250630c47fee8be2a6aef07f19d30a Author: Bill Wendling <isanbard@gmail.com> Date: Tue Aug 25 02:27:42 2009 +0000 Rename functions to something more descriptive. At the very least mention the CIE and FDE in their names. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79969 91177308-0d34-0410-b5e6-96231b3b80d8 commit 30d4d765dfc6d01bc4c1d6934582050106bcceba Author: Dale Johannesen <dalej@apple.com> Date: Tue Aug 25 01:13:58 2009 +0000 Allow multiple occurrences of -inline-threshold on the command line. This gives llvm-gcc developers a way to control inlining (documented as "not intended for end users"). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79966 91177308-0d34-0410-b5e6-96231b3b80d8 commit 06b990c5b3f32505188e52be1b70b38290f81b83 Author: Owen Anderson <resistor@mac.com> Date: Tue Aug 25 00:54:39 2009 +0000 Handle a corner case when extracing code regions where one of the immediate successor of an extracted block contains a PHI using a value defined in the extracted region. With this patch, the partial inliner now passes MultiSource/Applications. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79963 91177308-0d34-0410-b5e6-96231b3b80d8 commit f1f04ecf6e5af3aa7c4c59077486c9cb29df20ea Author: Dale Johannesen <dalej@apple.com> Date: Tue Aug 25 00:16:14 2009 +0000 Fix PR 4751, another difficulty with %a modifier on x86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79961 91177308-0d34-0410-b5e6-96231b3b80d8 commit 09220a24f7845a078fb41c61ee909eed6c94a255 Author: Bill Wendling <isanbard@gmail.com> Date: Tue Aug 25 00:05:04 2009 +0000 --- Reverse-merging r79938 into '.': U include/llvm/BasicBlock.h U include/llvm/ADT/ilist_node.h U include/llvm/ADT/ilist.h U include/llvm/CodeGen/SelectionDAG.h U include/llvm/CodeGen/MachineFunction.h U include/llvm/CodeGen/MachineBasicBlock.h U include/llvm/Function.h Revert r79938. It was causing self-hosting build failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79960 91177308-0d34-0410-b5e6-96231b3b80d8 commit f2942e63abf0b485e88c21a9fc96bfb13754ed41 Author: Oscar Fuentes <ofv@wanadoo.es> Date: Tue Aug 25 00:02:29 2009 +0000 CMake: updated list of source files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79959 91177308-0d34-0410-b5e6-96231b3b80d8 commit 399ece6621d316d7378e5fc13bd030e5572f03ce Author: Scott Michel <scottm@aero.org> Date: Mon Aug 24 23:57:35 2009 +0000 - Remove SelectSEXTi128 from SPUISelDAGToDAG.cpp, evidently, this is redundant code, according to Anton (I'm not totally convinced, but we can always resurrect patches if we need to do so.) - Start moving CellSPU's tests to prefer FileCheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79958 91177308-0d34-0410-b5e6-96231b3b80d8 commit 27dad5a41e0b0fa8fd5cba2e6f5dd70b82689e76 Author: Owen Anderson <resistor@mac.com> Date: Mon Aug 24 23:32:14 2009 +0000 When extracting SEME regions of code, the extractor needs to update the dominator tree for split return blocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79957 91177308-0d34-0410-b5e6-96231b3b80d8 commit 316e6fb92b997dfa4db655a371d5699cbcac0473 Author: Scott Michel <scottm@aero.org> Date: Mon Aug 24 22:49:22 2009 +0000 Prefer 'FileCheck' over 'grep'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79953 91177308-0d34-0410-b5e6-96231b3b80d8 commit 36173e27ebfe4da907c17f2b507a9df3415a3aad Author: Scott Michel <scottm@aero.org> Date: Mon Aug 24 22:28:53 2009 +0000 128-bit sign extension and vector shift cleanups, contributed by Ken Werner (IBM). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79949 91177308-0d34-0410-b5e6-96231b3b80d8 commit 73ab81726b384015ac9bfe7f734fc13b93297c4c Author: Scott Michel <scottm@aero.org> Date: Mon Aug 24 21:53:27 2009 +0000 Initialize ShufBytes, as gcc 4.4 can't detect that the entire array is initialized and a warning about a potentially unintialized variable is generated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79946 91177308-0d34-0410-b5e6-96231b3b80d8 commit af26e32df3f129ac906a45c4527b5ee3641cb22d Author: Andreas Neustifter <astifter@gmx.at> Date: Mon Aug 24 21:41:37 2009 +0000 Add llvm_start_edge_profiling to exported symbols for libprofile_rt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79944 91177308-0d34-0410-b5e6-96231b3b80d8 commit 92b39ace140de279245e80d0465528933787c7e4 Author: Andreas Neustifter <astifter@gmx.at> Date: Mon Aug 24 21:37:48 2009 +0000 This patch cleans up the ProfileInfo by *) introducing new data type and export function of edge info for whole function (preparation for next patch). *) renaming variables to make clear distinction between data and containers that contain this data. *) updated comments and whitespaces. *) made ProfileInfo::MissingValue a double (as it should be...). (Discussed at http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090817/084955.html.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79940 91177308-0d34-0410-b5e6-96231b3b80d8 commit c19dfb9d25347b815512bba5eb64052708e4c183 Author: Gabor Greif <ggreif@gmail.com> Date: Mon Aug 24 21:34:17 2009 +0000 Resubmit an earlier patch of mine: reduce the size of relevant "ghostly" sentinels by a pointer. This attempt now makes the compactification dependent on the configure variable LLVM_COMPACT_SENTINELS and should not cause any bootstrap failures for llvm-gcc any more. Please note that this is not yet the final version, and (as settled with Chris) I shall take out the autofoo/cmake portions in the next days. This will also lose the assertability on sentinel dereferencing and operator++, but that seems an acceptable price to pay for the simplified build logic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79938 91177308-0d34-0410-b5e6-96231b3b80d8 commit b2f99910fba8818270e41e75f4b127d82a2082a6 Author: Bob Wilson <bob.wilson@apple.com> Date: Mon Aug 24 21:17:17 2009 +0000 Fix a typo. Somehow I thought this had passed before, but I guess not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79937 91177308-0d34-0410-b5e6-96231b3b80d8 commit f5c686b114bf6ac6b3137f96bc59ffb2e8e20de6 Author: Gabor Greif <ggreif@gmail.com> Date: Mon Aug 24 21:00:10 2009 +0000 prune ignores: AutoGenerated.inc is no more git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79936 91177308-0d34-0410-b5e6-96231b3b80d8 commit cacea03dbaca34b44783243898ef2274bd71e72e Author: Bob Wilson <bob.wilson@apple.com> Date: Mon Aug 24 20:33:47 2009 +0000 Convert slow test to use FileCheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79935 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8551a303173101cf595dc35200eea7da37e769d4 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 24 20:08:27 2009 +0000 Convert two gratuitous abuses of poor helpless CPU cycles to FileCheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79933 91177308-0d34-0410-b5e6-96231b3b80d8 commit b9640223f05f0257603a0138c1ea8cb59c7f5acc Author: Dale Johannesen <dalej@apple.com> Date: Mon Aug 24 17:51:19 2009 +0000 Split test into 3. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79926 91177308-0d34-0410-b5e6-96231b3b80d8 commit a0151d0e9f948b39e55944b5cad64fb33732af25 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Aug 24 11:56:58 2009 +0000 llvm-mc/Mach-O: Preliminary support for indirect symbols. - The indirect table itself isn't being filled in yet. - This isn't factored properly and is rather FIXMEd, but at the moment I'm more focused on figuring out what it needs to do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79910 91177308-0d34-0410-b5e6-96231b3b80d8 commit b69f053e0d5af3463d1bbf2101e5c1431cca6fee Author: Duncan Sands <baldrick@free.fr> Date: Mon Aug 24 10:59:01 2009 +0000 Fix the build when using gcc-4.4 on linux. Header needed for stderr and fprintf. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79909 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -94,12 +94,6 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT LLVM_ENABLE_ASSERTIONS )
|
||||
set( LLVM_COMPACT_SENTINELS 1 )
|
||||
else( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT LLVM_ENABLE_ASSERTIONS )
|
||||
set( LLVM_COMPACT_SENTINELS 0 )
|
||||
endif( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT LLVM_ENABLE_ASSERTIONS )
|
||||
|
||||
if( LLVM_TARGETS_TO_BUILD STREQUAL "all" )
|
||||
set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} )
|
||||
endif()
|
||||
|
||||
@@ -66,3 +66,4 @@ Autoconf llvm/autoconf
|
||||
llvm/projects/sample/autoconf
|
||||
CellSPU backend llvm/lib/Target/CellSPU/README.txt
|
||||
Google Test llvm/utils/unittest/googletest
|
||||
OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex}
|
||||
|
||||
@@ -117,7 +117,6 @@ debug-opt-prof:
|
||||
dist-hook::
|
||||
$(Echo) Eliminating files constructed by configure
|
||||
$(Verb) $(RM) -f \
|
||||
$(TopDistDir)/include/llvm/ADT/iterator.h \
|
||||
$(TopDistDir)/include/llvm/Config/config.h \
|
||||
$(TopDistDir)/include/llvm/Support/DataTypes.h \
|
||||
$(TopDistDir)/include/llvm/Support/ThreadSupport.h
|
||||
@@ -136,8 +135,7 @@ FilesToConfig := \
|
||||
include/llvm/Config/config.h \
|
||||
include/llvm/Config/Targets.def \
|
||||
include/llvm/Config/AsmPrinters.def \
|
||||
include/llvm/Support/DataTypes.h \
|
||||
include/llvm/ADT/iterator.h
|
||||
include/llvm/Support/DataTypes.h
|
||||
FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
|
||||
|
||||
all-local:: $(FilesToConfigPATH)
|
||||
|
||||
@@ -1058,9 +1058,9 @@ $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
|
||||
$(LLVMToolDir)/llvm-ar
|
||||
$(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
|
||||
"(internalize)"
|
||||
$(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).o $(ObjectsBC)
|
||||
$(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
|
||||
$(Verb) $(RM) -f $@
|
||||
$(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).o
|
||||
$(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
|
||||
else
|
||||
$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
|
||||
$(LLVMToolDir)/llvm-ar
|
||||
|
||||
@@ -361,17 +361,6 @@ else
|
||||
AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]])
|
||||
fi
|
||||
|
||||
dnl LLVM_COMPACT_SENTINELS : can be used to shrink ilist's end iterators and disable certain checks on them:
|
||||
if test ${ENABLE_OPTIMIZED},${DISABLE_ASSERTIONS} = "ENABLE_OPTIMIZED=1,DISABLE_ASSERTIONS=1" ; then
|
||||
AC_SUBST(LLVM_COMPACT_SENTINELS,[1])
|
||||
else
|
||||
AC_SUBST(LLVM_COMPACT_SENTINELS,[0])
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED([LLVM_COMPACT_SENTINELS],$LLVM_COMPACT_SENTINELS,
|
||||
[Define to 1 for ilist sentinel compaction])
|
||||
|
||||
|
||||
dnl --enable-expensive-checks : check whether they want to turn on expensive debug checks:
|
||||
AC_ARG_ENABLE(expensive-checks,AS_HELP_STRING(
|
||||
--enable-expensive-checks,[Compile with expensive debug checks enabled (default is NO)]),, enableval="no")
|
||||
@@ -1325,7 +1314,6 @@ AC_CONFIG_FILES([include/llvm/Config/Targets.def])
|
||||
AC_CONFIG_FILES([include/llvm/Config/AsmPrinters.def])
|
||||
AC_CONFIG_FILES([include/llvm/Config/AsmParsers.def])
|
||||
AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h])
|
||||
AC_CONFIG_HEADERS([include/llvm/ADT/iterator.h])
|
||||
|
||||
dnl Configure the makefile's configuration data
|
||||
AC_CONFIG_FILES([Makefile.config])
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
AC_DEFUN([AC_CONFIG_MAKEFILE],
|
||||
[AC_CONFIG_COMMANDS($1,
|
||||
[${llvm_src}/autoconf/mkinstalldirs `dirname $1`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/$1 $1])
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/$1 $1])
|
||||
])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
##===- bindings/ocaml/bitwriter/Makefile -------------------*- Makefile -*-===##
|
||||
##===- bindings/ocaml/llvm/Makefile ------------------------*- Makefile -*-===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
|
||||
@@ -81,7 +81,11 @@ endif()
|
||||
include(CheckAtomic)
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
check_cxx_compiler_flag("-fPIC" SUPPORTS_FPIC_FLAG)
|
||||
# On windows all code is position-independent and mingw warns if -fPIC
|
||||
# is in the command-line.
|
||||
if( NOT WIN32 )
|
||||
check_cxx_compiler_flag("-fPIC" SUPPORTS_FPIC_FLAG)
|
||||
endif()
|
||||
|
||||
include(GetTargetTriple)
|
||||
get_target_triple(LLVM_HOSTTRIPLE)
|
||||
@@ -176,11 +180,6 @@ configure_file(
|
||||
${LLVM_BINARY_DIR}/include/llvm/Config/config.h
|
||||
)
|
||||
|
||||
configure_file(
|
||||
${LLVM_MAIN_INCLUDE_DIR}/llvm/ADT/iterator.cmake
|
||||
${LLVM_BINARY_DIR}/include/llvm/ADT/iterator.h
|
||||
)
|
||||
|
||||
configure_file(
|
||||
${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/DataTypes.h.cmake
|
||||
${LLVM_BINARY_DIR}/include/llvm/Support/DataTypes.h
|
||||
|
||||
@@ -29,7 +29,7 @@ set(MSVC_LIB_DEPS_LLVMInstrumentation LLVMCore LLVMScalarOpts LLVMSupport LLVMSy
|
||||
set(MSVC_LIB_DEPS_LLVMInterpreter LLVMCodeGen LLVMCore LLVMExecutionEngine LLVMSupport LLVMSystem LLVMTarget)
|
||||
set(MSVC_LIB_DEPS_LLVMJIT LLVMCodeGen LLVMCore LLVMExecutionEngine LLVMMC LLVMSupport LLVMSystem LLVMTarget)
|
||||
set(MSVC_LIB_DEPS_LLVMLinker LLVMArchive LLVMBitReader LLVMCore LLVMSupport LLVMSystem)
|
||||
set(MSVC_LIB_DEPS_LLVMMC LLVMSupport)
|
||||
set(MSVC_LIB_DEPS_LLVMMC LLVMSupport LLVMSystem)
|
||||
set(MSVC_LIB_DEPS_LLVMMSIL LLVMAnalysis LLVMCodeGen LLVMCore LLVMMSILInfo LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa)
|
||||
set(MSVC_LIB_DEPS_LLVMMSILInfo LLVMSupport)
|
||||
set(MSVC_LIB_DEPS_LLVMMSP430AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMSP430Info LLVMSupport LLVMSystem LLVMTarget)
|
||||
|
||||
98
libclamav/c++/llvm/configure
vendored
98
libclamav/c++/llvm/configure
vendored
@@ -834,7 +834,6 @@ CVSBUILD
|
||||
ENABLE_OPTIMIZED
|
||||
ENABLE_PROFILING
|
||||
DISABLE_ASSERTIONS
|
||||
LLVM_COMPACT_SENTINELS
|
||||
ENABLE_EXPENSIVE_CHECKS
|
||||
EXPENSIVE_CHECKS
|
||||
DEBUG_RUNTIME
|
||||
@@ -4846,21 +4845,6 @@ else
|
||||
|
||||
fi
|
||||
|
||||
if test ${ENABLE_OPTIMIZED},${DISABLE_ASSERTIONS} = "ENABLE_OPTIMIZED=1,DISABLE_ASSERTIONS=1" ; then
|
||||
LLVM_COMPACT_SENTINELS=1
|
||||
|
||||
else
|
||||
LLVM_COMPACT_SENTINELS=0
|
||||
|
||||
fi
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define LLVM_COMPACT_SENTINELS $LLVM_COMPACT_SENTINELS
|
||||
_ACEOF
|
||||
|
||||
|
||||
|
||||
# Check whether --enable-expensive-checks was given.
|
||||
if test "${enable_expensive_checks+set}" = set; then
|
||||
enableval=$enable_expensive_checks;
|
||||
@@ -10988,7 +10972,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 10991 "configure"
|
||||
#line 10975 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -13132,7 +13116,7 @@ ia64-*-hpux*)
|
||||
;;
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '#line 13135 "configure"' > conftest.$ac_ext
|
||||
echo '#line 13119 "configure"' > conftest.$ac_ext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
@@ -14850,11 +14834,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:14853: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:14837: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:14857: \$? = $ac_status" >&5
|
||||
echo "$as_me:14841: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -15118,11 +15102,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:15121: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:15105: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:15125: \$? = $ac_status" >&5
|
||||
echo "$as_me:15109: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -15222,11 +15206,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:15225: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:15209: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:15229: \$? = $ac_status" >&5
|
||||
echo "$as_me:15213: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -17674,7 +17658,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 17677 "configure"
|
||||
#line 17661 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -17774,7 +17758,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 17777 "configure"
|
||||
#line 17761 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -20142,11 +20126,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:20145: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:20129: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:20149: \$? = $ac_status" >&5
|
||||
echo "$as_me:20133: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -20246,11 +20230,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:20249: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:20233: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:20253: \$? = $ac_status" >&5
|
||||
echo "$as_me:20237: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -21816,11 +21800,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:21819: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:21803: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:21823: \$? = $ac_status" >&5
|
||||
echo "$as_me:21807: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -21920,11 +21904,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:21923: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:21907: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:21927: \$? = $ac_status" >&5
|
||||
echo "$as_me:21911: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -24155,11 +24139,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:24158: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:24142: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:24162: \$? = $ac_status" >&5
|
||||
echo "$as_me:24146: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -24423,11 +24407,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:24426: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:24410: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:24430: \$? = $ac_status" >&5
|
||||
echo "$as_me:24414: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -24527,11 +24511,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:24530: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:24514: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:24534: \$? = $ac_status" >&5
|
||||
echo "$as_me:24518: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -35316,8 +35300,6 @@ ac_config_files="$ac_config_files include/llvm/Config/AsmParsers.def"
|
||||
|
||||
ac_config_headers="$ac_config_headers include/llvm/Support/DataTypes.h"
|
||||
|
||||
ac_config_headers="$ac_config_headers include/llvm/ADT/iterator.h"
|
||||
|
||||
|
||||
ac_config_files="$ac_config_files Makefile.config"
|
||||
|
||||
@@ -35944,7 +35926,6 @@ do
|
||||
"include/llvm/Config/AsmPrinters.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmPrinters.def" ;;
|
||||
"include/llvm/Config/AsmParsers.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmParsers.def" ;;
|
||||
"include/llvm/Support/DataTypes.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Support/DataTypes.h" ;;
|
||||
"include/llvm/ADT/iterator.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/iterator.h" ;;
|
||||
"Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;;
|
||||
"llvm.spec") CONFIG_FILES="$CONFIG_FILES llvm.spec" ;;
|
||||
"docs/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES docs/doxygen.cfg" ;;
|
||||
@@ -36104,7 +36085,6 @@ CVSBUILD!$CVSBUILD$ac_delim
|
||||
ENABLE_OPTIMIZED!$ENABLE_OPTIMIZED$ac_delim
|
||||
ENABLE_PROFILING!$ENABLE_PROFILING$ac_delim
|
||||
DISABLE_ASSERTIONS!$DISABLE_ASSERTIONS$ac_delim
|
||||
LLVM_COMPACT_SENTINELS!$LLVM_COMPACT_SENTINELS$ac_delim
|
||||
ENABLE_EXPENSIVE_CHECKS!$ENABLE_EXPENSIVE_CHECKS$ac_delim
|
||||
EXPENSIVE_CHECKS!$EXPENSIVE_CHECKS$ac_delim
|
||||
DEBUG_RUNTIME!$DEBUG_RUNTIME$ac_delim
|
||||
@@ -36123,6 +36103,7 @@ BINUTILS_INCDIR!$BINUTILS_INCDIR$ac_delim
|
||||
ENABLE_LLVMC_DYNAMIC!$ENABLE_LLVMC_DYNAMIC$ac_delim
|
||||
ENABLE_LLVMC_DYNAMIC_PLUGINS!$ENABLE_LLVMC_DYNAMIC_PLUGINS$ac_delim
|
||||
CXX!$CXX$ac_delim
|
||||
CXXFLAGS!$CXXFLAGS$ac_delim
|
||||
_ACEOF
|
||||
|
||||
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
|
||||
@@ -36164,7 +36145,6 @@ _ACEOF
|
||||
ac_delim='%!_!# '
|
||||
for ac_last_try in false false false false false :; do
|
||||
cat >conf$$subs.sed <<_ACEOF
|
||||
CXXFLAGS!$CXXFLAGS$ac_delim
|
||||
ac_ct_CXX!$ac_ct_CXX$ac_delim
|
||||
NM!$NM$ac_delim
|
||||
ifGNUmake!$ifGNUmake$ac_delim
|
||||
@@ -36258,7 +36238,7 @@ LIBOBJS!$LIBOBJS$ac_delim
|
||||
LTLIBOBJS!$LTLIBOBJS$ac_delim
|
||||
_ACEOF
|
||||
|
||||
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 92; then
|
||||
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
|
||||
break
|
||||
elif $ac_last_try; then
|
||||
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
|
||||
@@ -36662,31 +36642,31 @@ echo "$as_me: executing $ac_file commands" >&6;}
|
||||
|
||||
case $ac_file$ac_mode in
|
||||
"Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile Makefile ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/Makefile Makefile ;;
|
||||
"Makefile.common":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile.common`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile.common Makefile.common ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/Makefile.common Makefile.common ;;
|
||||
"examples/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname examples/Makefile`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/examples/Makefile examples/Makefile ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/examples/Makefile examples/Makefile ;;
|
||||
"lib/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/Makefile`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/lib/Makefile lib/Makefile ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/lib/Makefile lib/Makefile ;;
|
||||
"runtime/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname runtime/Makefile`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/runtime/Makefile runtime/Makefile ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/runtime/Makefile runtime/Makefile ;;
|
||||
"test/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname test/Makefile`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/test/Makefile test/Makefile ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/test/Makefile test/Makefile ;;
|
||||
"test/Makefile.tests":C) ${llvm_src}/autoconf/mkinstalldirs `dirname test/Makefile.tests`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/test/Makefile.tests test/Makefile.tests ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/test/Makefile.tests test/Makefile.tests ;;
|
||||
"unittests/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname unittests/Makefile`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/unittests/Makefile unittests/Makefile ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/unittests/Makefile unittests/Makefile ;;
|
||||
"tools/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/Makefile`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/tools/Makefile tools/Makefile ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/tools/Makefile tools/Makefile ;;
|
||||
"utils/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname utils/Makefile`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/utils/Makefile utils/Makefile ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/utils/Makefile utils/Makefile ;;
|
||||
"projects/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname projects/Makefile`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/projects/Makefile projects/Makefile ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/projects/Makefile projects/Makefile ;;
|
||||
"bindings/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname bindings/Makefile`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/bindings/Makefile bindings/Makefile ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/bindings/Makefile bindings/Makefile ;;
|
||||
"bindings/ocaml/Makefile.ocaml":C) ${llvm_src}/autoconf/mkinstalldirs `dirname bindings/ocaml/Makefile.ocaml`
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/bindings/ocaml/Makefile.ocaml bindings/ocaml/Makefile.ocaml ;;
|
||||
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/bindings/ocaml/Makefile.ocaml bindings/ocaml/Makefile.ocaml ;;
|
||||
|
||||
esac
|
||||
done # for ac_tag
|
||||
|
||||
@@ -1616,9 +1616,9 @@ bool RegMapping_Fer::compatible_class(MachineFunction &mf,
|
||||
|
||||
<div class="doc_code">
|
||||
<pre>
|
||||
$ llc -f -regalloc=simple file.bc -o sp.s;
|
||||
$ llc -f -regalloc=local file.bc -o lc.s;
|
||||
$ llc -f -regalloc=linearscan file.bc -o ln.s;
|
||||
$ llc -regalloc=simple file.bc -o sp.s;
|
||||
$ llc -regalloc=local file.bc -o lc.s;
|
||||
$ llc -regalloc=linearscan file.bc -o ln.s;
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -49,8 +49,9 @@ B<clang>.
|
||||
|
||||
=item B<-f>
|
||||
|
||||
Overwrite output files. By default, B<llc> will refuse to overwrite
|
||||
an output file which already exists.
|
||||
Enable binary output on terminals. Normally, B<llvm-extract> will refuse to
|
||||
write raw bitcode output if the output stream is a terminal. With this option,
|
||||
B<llvm-extract> will write raw bitcode regardless of the output device.
|
||||
|
||||
=item B<-mtriple>=I<target triple>
|
||||
|
||||
|
||||
@@ -46,9 +46,9 @@ suffix is appended.
|
||||
|
||||
=item B<-f>
|
||||
|
||||
Force overwrite. Normally, B<llvm-as> will refuse to overwrite an
|
||||
output file that already exists. With this option, B<llvm-as>
|
||||
will overwrite the output file and replace it with new bitcode.
|
||||
Enable binary output on terminals. Normally, B<llvm-as> will refuse to
|
||||
write raw bitcode output if the output stream is a terminal. With this option,
|
||||
B<llvm-as> will write raw bitcode regardless of the output device.
|
||||
|
||||
=item B<--help>
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@ B<-o> option.
|
||||
|
||||
=item B<-f>
|
||||
|
||||
Force overwrite. Normally, B<llvm-dis> will refuse to overwrite
|
||||
an output file that already exists. With this option, B<llvm-dis>
|
||||
will overwrite the output file.
|
||||
Enable binary output on terminals. Normally, B<llvm-dis> will refuse to
|
||||
write raw bitcode output if the output stream is a terminal. With this option,
|
||||
B<llvm-dis> will write raw bitcode regardless of the output device.
|
||||
|
||||
=item B<--help>
|
||||
|
||||
|
||||
@@ -28,9 +28,9 @@ unless the B<-o> option is specified (see below).
|
||||
|
||||
=item B<-f>
|
||||
|
||||
Force overwrite. Normally, B<llvm-extract> will refuse to overwrite an
|
||||
output file that already exists. With this option, B<llvm-extract>
|
||||
will overwrite the output file and replace it with new bitcode.
|
||||
Enable binary output on terminals. Normally, B<llvm-extract> will refuse to
|
||||
write raw bitcode output if the output stream is a terminal. With this option,
|
||||
B<llvm-extract> will write raw bitcode regardless of the output device.
|
||||
|
||||
=item B<--func> I<function-name>
|
||||
|
||||
|
||||
@@ -33,8 +33,9 @@ the order in which they were specified on the command line.
|
||||
|
||||
=item B<-f>
|
||||
|
||||
Overwrite output files. By default, B<llvm-link> will not overwrite an output
|
||||
file if it already exists.
|
||||
Enable binary output on terminals. Normally, B<llvm-link> will refuse to
|
||||
write raw bitcode output if the output stream is a terminal. With this option,
|
||||
B<llvm-link> will write raw bitcode regardless of the output device.
|
||||
|
||||
=item B<-o> F<filename>
|
||||
|
||||
|
||||
@@ -39,9 +39,9 @@ writes its output to the standard output.
|
||||
|
||||
=item B<-f>
|
||||
|
||||
Force overwrite. Normally, B<opt> will refuse to overwrite an
|
||||
output file that already exists. With this option, B<opt> will
|
||||
overwrite the output file and replace it with new bitcode.
|
||||
Enable binary output on terminals. Normally, B<opt> will refuse to
|
||||
write raw bitcode output if the output stream is a terminal. With this option,
|
||||
B<opt> will write raw bitcode regardless of the output device.
|
||||
|
||||
=item B<-help>
|
||||
|
||||
|
||||
@@ -331,13 +331,13 @@ OPTIONS:
|
||||
<div class="doc_text">
|
||||
|
||||
<p>In addition to input and output filenames, we would like the compiler example
|
||||
to support three boolean flags: "<tt>-f</tt>" to force overwriting of the output
|
||||
file, "<tt>--quiet</tt>" to enable quiet mode, and "<tt>-q</tt>" for backwards
|
||||
compatibility with some of our users. We can support these by declaring options
|
||||
of boolean type like this:</p>
|
||||
to support three boolean flags: "<tt>-f</tt>" to force writing binary output to
|
||||
a terminal, "<tt>--quiet</tt>" to enable quiet mode, and "<tt>-q</tt>" for
|
||||
backwards compatibility with some of our users. We can support these by
|
||||
declaring options of boolean type like this:</p>
|
||||
|
||||
<div class="doc_code"><pre>
|
||||
<a href="#cl::opt">cl::opt</a><bool> Force ("<i>f</i>", <a href="#cl::desc">cl::desc</a>("<i>Overwrite output files</i>"));
|
||||
<a href="#cl::opt">cl::opt</a><bool> Force ("<i>f</i>", <a href="#cl::desc">cl::desc</a>("<i>Enable binary output on terminals</i>"));
|
||||
<a href="#cl::opt">cl::opt</a><bool> Quiet ("<i>quiet</i>", <a href="#cl::desc">cl::desc</a>("<i>Don't print informational messages</i>"));
|
||||
<a href="#cl::opt">cl::opt</a><bool> Quiet2("<i>q</i>", <a href="#cl::desc">cl::desc</a>("<i>Don't print informational messages</i>"), <a href="#cl::Hidden">cl::Hidden</a>);
|
||||
</pre></div>
|
||||
@@ -378,7 +378,7 @@ library calls to parse the string value into the specified data type.</p>
|
||||
USAGE: compiler [options] <input file>
|
||||
|
||||
OPTIONS:
|
||||
<b>-f - Overwrite output files</b>
|
||||
<b>-f - Enable binary output on terminals</b>
|
||||
-o - Override output filename
|
||||
<b>-quiet - Don't print informational messages</b>
|
||||
-help - display available options (--help-hidden for more)
|
||||
@@ -390,7 +390,7 @@ OPTIONS:
|
||||
USAGE: compiler [options] <input file>
|
||||
|
||||
OPTIONS:
|
||||
-f - Overwrite output files
|
||||
-f - Enable binary output on terminals
|
||||
-o - Override output filename
|
||||
<b>-q - Don't print informational messages</b>
|
||||
-quiet - Don't print informational messages
|
||||
@@ -530,7 +530,7 @@ OPTIONS:
|
||||
-O1 - Enable trivial optimizations
|
||||
-O2 - Enable default optimizations
|
||||
-O3 - Enable expensive optimizations</b>
|
||||
-f - Overwrite output files
|
||||
-f - Enable binary output on terminals
|
||||
-help - display available options (--help-hidden for more)
|
||||
-o <filename> - Specify output filename
|
||||
-quiet - Don't print informational messages
|
||||
@@ -614,7 +614,7 @@ OPTIONS:
|
||||
=none - disable debug information
|
||||
=quick - enable quick debug information
|
||||
=detailed - enable detailed debug information</b>
|
||||
-f - Overwrite output files
|
||||
-f - Enable binary output on terminals
|
||||
-help - display available options (--help-hidden for more)
|
||||
-o <filename> - Specify output filename
|
||||
-quiet - Don't print informational messages
|
||||
|
||||
@@ -183,12 +183,12 @@ to llvm-gcc (in addition to the options you already pass). Once your have
|
||||
foo.bc, one of the following commands should fail:</p>
|
||||
|
||||
<ol>
|
||||
<li><tt><b>llc</b> foo.bc -f</tt></li>
|
||||
<li><tt><b>llc</b> foo.bc -f -relocation-model=pic</tt></li>
|
||||
<li><tt><b>llc</b> foo.bc -f -relocation-model=static</tt></li>
|
||||
<li><tt><b>llc</b> foo.bc -f -enable-eh</tt></li>
|
||||
<li><tt><b>llc</b> foo.bc -f -relocation-model=pic -enable-eh</tt></li>
|
||||
<li><tt><b>llc</b> foo.bc -f -relocation-model=static -enable-eh</tt></li>
|
||||
<li><tt><b>llc</b> foo.bc</tt></li>
|
||||
<li><tt><b>llc</b> foo.bc -relocation-model=pic</tt></li>
|
||||
<li><tt><b>llc</b> foo.bc -relocation-model=static</tt></li>
|
||||
<li><tt><b>llc</b> foo.bc -enable-eh</tt></li>
|
||||
<li><tt><b>llc</b> foo.bc -relocation-model=pic -enable-eh</tt></li>
|
||||
<li><tt><b>llc</b> foo.bc -relocation-model=static -enable-eh</tt></li>
|
||||
</ol>
|
||||
|
||||
<p>If none of these crash, please follow the instructions for a
|
||||
@@ -320,7 +320,7 @@ the following:</p>
|
||||
|
||||
<div class="doc_code">
|
||||
<p><tt>
|
||||
<b>llc</b> test.bc -o test.s -f<br>
|
||||
<b>llc</b> test.bc -o test.s<br>
|
||||
<b>gcc</b> test.s safe.so -o test.llc<br>
|
||||
./test.llc [program options]
|
||||
</tt></p>
|
||||
|
||||
@@ -1042,6 +1042,11 @@ define void @f() optsize
|
||||
function into callers whenever possible, ignoring any active inlining size
|
||||
threshold for this caller.</dd>
|
||||
|
||||
<dt><tt>inlinehint</tt></dt>
|
||||
<dd>This attribute indicates that the source code contained a hint that inlining
|
||||
this function is desirable (such as the "inline" keyword in C/C++). It
|
||||
is just a hint; it imposes no requirements on the inliner.</dd>
|
||||
|
||||
<dt><tt>noinline</tt></dt>
|
||||
<dd>This attribute indicates that the inliner should never inline this
|
||||
function in any situation. This attribute may not be used together with
|
||||
|
||||
@@ -274,6 +274,12 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if !
|
||||
located at <code>getNode(<var>F</var>) + CallReturnPos</code>. The arguments
|
||||
start at <code>getNode(<var>F</var>) + CallArgPos</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Please keep in mind that the current andersen's pass has many known
|
||||
problems and bugs. It should be considered "research quality".
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-------------------------------------------------------------------------- -->
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
756
libclamav/c++/llvm/docs/re_format.7
Normal file
756
libclamav/c++/llvm/docs/re_format.7
Normal file
@@ -0,0 +1,756 @@
|
||||
.\" $OpenBSD: re_format.7,v 1.14 2007/05/31 19:19:30 jmc Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1997, Phillip F Knaack. All rights reserved.
|
||||
.\"
|
||||
.\" Copyright (c) 1992, 1993, 1994 Henry Spencer.
|
||||
.\" Copyright (c) 1992, 1993, 1994
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\"
|
||||
.\" This code is derived from software contributed to Berkeley by
|
||||
.\" Henry Spencer.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. Neither the name of the University nor the names of its contributors
|
||||
.\" may be used to endorse or promote products derived from this software
|
||||
.\" without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)re_format.7 8.3 (Berkeley) 3/20/94
|
||||
.\"
|
||||
.Dd $Mdocdate: May 31 2007 $
|
||||
.Dt RE_FORMAT 7
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm re_format
|
||||
.Nd POSIX regular expressions
|
||||
.Sh DESCRIPTION
|
||||
Regular expressions (REs),
|
||||
as defined in
|
||||
.St -p1003.1-2004 ,
|
||||
come in two forms:
|
||||
basic regular expressions
|
||||
(BREs)
|
||||
and extended regular expressions
|
||||
(EREs).
|
||||
Both forms of regular expressions are supported
|
||||
by the interfaces described in
|
||||
.Xr regex 3 .
|
||||
Applications dealing with regular expressions
|
||||
may use one or the other form
|
||||
(or indeed both).
|
||||
For example,
|
||||
.Xr ed 1
|
||||
uses BREs,
|
||||
whilst
|
||||
.Xr egrep 1
|
||||
talks EREs.
|
||||
Consult the manual page for the specific application to find out which
|
||||
it uses.
|
||||
.Pp
|
||||
POSIX leaves some aspects of RE syntax and semantics open;
|
||||
.Sq **
|
||||
marks decisions on these aspects that
|
||||
may not be fully portable to other POSIX implementations.
|
||||
.Pp
|
||||
This manual page first describes regular expressions in general,
|
||||
specifically extended regular expressions,
|
||||
and then discusses differences between them and basic regular expressions.
|
||||
.Sh EXTENDED REGULAR EXPRESSIONS
|
||||
An ERE is one** or more non-empty**
|
||||
.Em branches ,
|
||||
separated by
|
||||
.Sq \*(Ba .
|
||||
It matches anything that matches one of the branches.
|
||||
.Pp
|
||||
A branch is one** or more
|
||||
.Em pieces ,
|
||||
concatenated.
|
||||
It matches a match for the first, followed by a match for the second, etc.
|
||||
.Pp
|
||||
A piece is an
|
||||
.Em atom
|
||||
possibly followed by a single**
|
||||
.Sq * ,
|
||||
.Sq + ,
|
||||
.Sq ?\& ,
|
||||
or
|
||||
.Em bound .
|
||||
An atom followed by
|
||||
.Sq *
|
||||
matches a sequence of 0 or more matches of the atom.
|
||||
An atom followed by
|
||||
.Sq +
|
||||
matches a sequence of 1 or more matches of the atom.
|
||||
An atom followed by
|
||||
.Sq ?\&
|
||||
matches a sequence of 0 or 1 matches of the atom.
|
||||
.Pp
|
||||
A bound is
|
||||
.Sq {
|
||||
followed by an unsigned decimal integer,
|
||||
possibly followed by
|
||||
.Sq ,\&
|
||||
possibly followed by another unsigned decimal integer,
|
||||
always followed by
|
||||
.Sq } .
|
||||
The integers must lie between 0 and
|
||||
.Dv RE_DUP_MAX
|
||||
(255**) inclusive,
|
||||
and if there are two of them, the first may not exceed the second.
|
||||
An atom followed by a bound containing one integer
|
||||
.Ar i
|
||||
and no comma matches
|
||||
a sequence of exactly
|
||||
.Ar i
|
||||
matches of the atom.
|
||||
An atom followed by a bound
|
||||
containing one integer
|
||||
.Ar i
|
||||
and a comma matches
|
||||
a sequence of
|
||||
.Ar i
|
||||
or more matches of the atom.
|
||||
An atom followed by a bound
|
||||
containing two integers
|
||||
.Ar i
|
||||
and
|
||||
.Ar j
|
||||
matches a sequence of
|
||||
.Ar i
|
||||
through
|
||||
.Ar j
|
||||
(inclusive) matches of the atom.
|
||||
.Pp
|
||||
An atom is a regular expression enclosed in
|
||||
.Sq ()
|
||||
(matching a part of the regular expression),
|
||||
an empty set of
|
||||
.Sq ()
|
||||
(matching the null string)**,
|
||||
a
|
||||
.Em bracket expression
|
||||
(see below),
|
||||
.Sq .\&
|
||||
(matching any single character),
|
||||
.Sq ^
|
||||
(matching the null string at the beginning of a line),
|
||||
.Sq $
|
||||
(matching the null string at the end of a line),
|
||||
a
|
||||
.Sq \e
|
||||
followed by one of the characters
|
||||
.Sq ^.[$()|*+?{\e
|
||||
(matching that character taken as an ordinary character),
|
||||
a
|
||||
.Sq \e
|
||||
followed by any other character**
|
||||
(matching that character taken as an ordinary character,
|
||||
as if the
|
||||
.Sq \e
|
||||
had not been present**),
|
||||
or a single character with no other significance (matching that character).
|
||||
A
|
||||
.Sq {
|
||||
followed by a character other than a digit is an ordinary character,
|
||||
not the beginning of a bound**.
|
||||
It is illegal to end an RE with
|
||||
.Sq \e .
|
||||
.Pp
|
||||
A bracket expression is a list of characters enclosed in
|
||||
.Sq [] .
|
||||
It normally matches any single character from the list (but see below).
|
||||
If the list begins with
|
||||
.Sq ^ ,
|
||||
it matches any single character
|
||||
.Em not
|
||||
from the rest of the list
|
||||
(but see below).
|
||||
If two characters in the list are separated by
|
||||
.Sq - ,
|
||||
this is shorthand for the full
|
||||
.Em range
|
||||
of characters between those two (inclusive) in the
|
||||
collating sequence, e.g.\&
|
||||
.Sq [0-9]
|
||||
in ASCII matches any decimal digit.
|
||||
It is illegal** for two ranges to share an endpoint, e.g.\&
|
||||
.Sq a-c-e .
|
||||
Ranges are very collating-sequence-dependent,
|
||||
and portable programs should avoid relying on them.
|
||||
.Pp
|
||||
To include a literal
|
||||
.Sq ]\&
|
||||
in the list, make it the first character
|
||||
(following a possible
|
||||
.Sq ^ ) .
|
||||
To include a literal
|
||||
.Sq - ,
|
||||
make it the first or last character,
|
||||
or the second endpoint of a range.
|
||||
To use a literal
|
||||
.Sq -
|
||||
as the first endpoint of a range,
|
||||
enclose it in
|
||||
.Sq [.
|
||||
and
|
||||
.Sq .]
|
||||
to make it a collating element (see below).
|
||||
With the exception of these and some combinations using
|
||||
.Sq [
|
||||
(see next paragraphs),
|
||||
all other special characters, including
|
||||
.Sq \e ,
|
||||
lose their special significance within a bracket expression.
|
||||
.Pp
|
||||
Within a bracket expression, a collating element
|
||||
(a character,
|
||||
a multi-character sequence that collates as if it were a single character,
|
||||
or a collating-sequence name for either)
|
||||
enclosed in
|
||||
.Sq [.
|
||||
and
|
||||
.Sq .]
|
||||
stands for the sequence of characters of that collating element.
|
||||
The sequence is a single element of the bracket expression's list.
|
||||
A bracket expression containing a multi-character collating element
|
||||
can thus match more than one character,
|
||||
e.g. if the collating sequence includes a
|
||||
.Sq ch
|
||||
collating element,
|
||||
then the RE
|
||||
.Sq [[.ch.]]*c
|
||||
matches the first five characters of
|
||||
.Sq chchcc .
|
||||
.Pp
|
||||
Within a bracket expression, a collating element enclosed in
|
||||
.Sq [=
|
||||
and
|
||||
.Sq =]
|
||||
is an equivalence class, standing for the sequences of characters
|
||||
of all collating elements equivalent to that one, including itself.
|
||||
(If there are no other equivalent collating elements,
|
||||
the treatment is as if the enclosing delimiters were
|
||||
.Sq [.
|
||||
and
|
||||
.Sq .] . )
|
||||
For example, if
|
||||
.Sq x
|
||||
and
|
||||
.Sq y
|
||||
are the members of an equivalence class,
|
||||
then
|
||||
.Sq [[=x=]] ,
|
||||
.Sq [[=y=]] ,
|
||||
and
|
||||
.Sq [xy]
|
||||
are all synonymous.
|
||||
An equivalence class may not** be an endpoint of a range.
|
||||
.Pp
|
||||
Within a bracket expression, the name of a
|
||||
.Em character class
|
||||
enclosed
|
||||
in
|
||||
.Sq [:
|
||||
and
|
||||
.Sq :]
|
||||
stands for the list of all characters belonging to that class.
|
||||
Standard character class names are:
|
||||
.Bd -literal -offset indent
|
||||
alnum digit punct
|
||||
alpha graph space
|
||||
blank lower upper
|
||||
cntrl print xdigit
|
||||
.Ed
|
||||
.Pp
|
||||
These stand for the character classes defined in
|
||||
.Xr ctype 3 .
|
||||
A locale may provide others.
|
||||
A character class may not be used as an endpoint of a range.
|
||||
.Pp
|
||||
There are two special cases** of bracket expressions:
|
||||
the bracket expressions
|
||||
.Sq [[:<:]]
|
||||
and
|
||||
.Sq [[:>:]]
|
||||
match the null string at the beginning and end of a word, respectively.
|
||||
A word is defined as a sequence of
|
||||
characters starting and ending with a word character
|
||||
which is neither preceded nor followed by
|
||||
word characters.
|
||||
A word character is an
|
||||
.Em alnum
|
||||
character (as defined by
|
||||
.Xr ctype 3 )
|
||||
or an underscore.
|
||||
This is an extension,
|
||||
compatible with but not specified by POSIX,
|
||||
and should be used with
|
||||
caution in software intended to be portable to other systems.
|
||||
.Pp
|
||||
In the event that an RE could match more than one substring of a given
|
||||
string,
|
||||
the RE matches the one starting earliest in the string.
|
||||
If the RE could match more than one substring starting at that point,
|
||||
it matches the longest.
|
||||
Subexpressions also match the longest possible substrings, subject to
|
||||
the constraint that the whole match be as long as possible,
|
||||
with subexpressions starting earlier in the RE taking priority over
|
||||
ones starting later.
|
||||
Note that higher-level subexpressions thus take priority over
|
||||
their lower-level component subexpressions.
|
||||
.Pp
|
||||
Match lengths are measured in characters, not collating elements.
|
||||
A null string is considered longer than no match at all.
|
||||
For example,
|
||||
.Sq bb*
|
||||
matches the three middle characters of
|
||||
.Sq abbbc ;
|
||||
.Sq (wee|week)(knights|nights)
|
||||
matches all ten characters of
|
||||
.Sq weeknights ;
|
||||
when
|
||||
.Sq (.*).*
|
||||
is matched against
|
||||
.Sq abc ,
|
||||
the parenthesized subexpression matches all three characters;
|
||||
and when
|
||||
.Sq (a*)*
|
||||
is matched against
|
||||
.Sq bc ,
|
||||
both the whole RE and the parenthesized subexpression match the null string.
|
||||
.Pp
|
||||
If case-independent matching is specified,
|
||||
the effect is much as if all case distinctions had vanished from the
|
||||
alphabet.
|
||||
When an alphabetic that exists in multiple cases appears as an
|
||||
ordinary character outside a bracket expression, it is effectively
|
||||
transformed into a bracket expression containing both cases,
|
||||
e.g.\&
|
||||
.Sq x
|
||||
becomes
|
||||
.Sq [xX] .
|
||||
When it appears inside a bracket expression,
|
||||
all case counterparts of it are added to the bracket expression,
|
||||
so that, for example,
|
||||
.Sq [x]
|
||||
becomes
|
||||
.Sq [xX]
|
||||
and
|
||||
.Sq [^x]
|
||||
becomes
|
||||
.Sq [^xX] .
|
||||
.Pp
|
||||
No particular limit is imposed on the length of REs**.
|
||||
Programs intended to be portable should not employ REs longer
|
||||
than 256 bytes,
|
||||
as an implementation can refuse to accept such REs and remain
|
||||
POSIX-compliant.
|
||||
.Pp
|
||||
The following is a list of extended regular expressions:
|
||||
.Bl -tag -width Ds
|
||||
.It Ar c
|
||||
Any character
|
||||
.Ar c
|
||||
not listed below matches itself.
|
||||
.It \e Ns Ar c
|
||||
Any backslash-escaped character
|
||||
.Ar c
|
||||
matches itself.
|
||||
.It \&.
|
||||
Matches any single character that is not a newline
|
||||
.Pq Sq \en .
|
||||
.It Bq Ar char-class
|
||||
Matches any single character in
|
||||
.Ar char-class .
|
||||
To include a
|
||||
.Ql \&]
|
||||
in
|
||||
.Ar char-class ,
|
||||
it must be the first character.
|
||||
A range of characters may be specified by separating the end characters
|
||||
of the range with a
|
||||
.Ql - ;
|
||||
e.g.\&
|
||||
.Ar a-z
|
||||
specifies the lower case characters.
|
||||
The following literal expressions can also be used in
|
||||
.Ar char-class
|
||||
to specify sets of characters:
|
||||
.Bd -unfilled -offset indent
|
||||
[:alnum:] [:cntrl:] [:lower:] [:space:]
|
||||
[:alpha:] [:digit:] [:print:] [:upper:]
|
||||
[:blank:] [:graph:] [:punct:] [:xdigit:]
|
||||
.Ed
|
||||
.Pp
|
||||
If
|
||||
.Ql -
|
||||
appears as the first or last character of
|
||||
.Ar char-class ,
|
||||
then it matches itself.
|
||||
All other characters in
|
||||
.Ar char-class
|
||||
match themselves.
|
||||
.Pp
|
||||
Patterns in
|
||||
.Ar char-class
|
||||
of the form
|
||||
.Eo [.
|
||||
.Ar col-elm
|
||||
.Ec .]\&
|
||||
or
|
||||
.Eo [=
|
||||
.Ar col-elm
|
||||
.Ec =]\& ,
|
||||
where
|
||||
.Ar col-elm
|
||||
is a collating element, are interpreted according to
|
||||
.Xr setlocale 3
|
||||
.Pq not currently supported .
|
||||
.It Bq ^ Ns Ar char-class
|
||||
Matches any single character, other than newline, not in
|
||||
.Ar char-class .
|
||||
.Ar char-class
|
||||
is defined as above.
|
||||
.It ^
|
||||
If
|
||||
.Sq ^
|
||||
is the first character of a regular expression, then it
|
||||
anchors the regular expression to the beginning of a line.
|
||||
Otherwise, it matches itself.
|
||||
.It $
|
||||
If
|
||||
.Sq $
|
||||
is the last character of a regular expression,
|
||||
it anchors the regular expression to the end of a line.
|
||||
Otherwise, it matches itself.
|
||||
.It [[:<:]]
|
||||
Anchors the single character regular expression or subexpression
|
||||
immediately following it to the beginning of a word.
|
||||
.It [[:>:]]
|
||||
Anchors the single character regular expression or subexpression
|
||||
immediately following it to the end of a word.
|
||||
.It Pq Ar re
|
||||
Defines a subexpression
|
||||
.Ar re .
|
||||
Any set of characters enclosed in parentheses
|
||||
matches whatever the set of characters without parentheses matches
|
||||
(that is a long-winded way of saying the constructs
|
||||
.Sq (re)
|
||||
and
|
||||
.Sq re
|
||||
match identically).
|
||||
.It *
|
||||
Matches the single character regular expression or subexpression
|
||||
immediately preceding it zero or more times.
|
||||
If
|
||||
.Sq *
|
||||
is the first character of a regular expression or subexpression,
|
||||
then it matches itself.
|
||||
The
|
||||
.Sq *
|
||||
operator sometimes yields unexpected results.
|
||||
For example, the regular expression
|
||||
.Ar b*
|
||||
matches the beginning of the string
|
||||
.Qq abbb
|
||||
(as opposed to the substring
|
||||
.Qq bbb ) ,
|
||||
since a null match is the only leftmost match.
|
||||
.It +
|
||||
Matches the singular character regular expression
|
||||
or subexpression immediately preceding it
|
||||
one or more times.
|
||||
.It ?
|
||||
Matches the singular character regular expression
|
||||
or subexpression immediately preceding it
|
||||
0 or 1 times.
|
||||
.Sm off
|
||||
.It Xo
|
||||
.Pf { Ar n , m No }\ \&
|
||||
.Pf { Ar n , No }\ \&
|
||||
.Pf { Ar n No }
|
||||
.Xc
|
||||
.Sm on
|
||||
Matches the single character regular expression or subexpression
|
||||
immediately preceding it at least
|
||||
.Ar n
|
||||
and at most
|
||||
.Ar m
|
||||
times.
|
||||
If
|
||||
.Ar m
|
||||
is omitted, then it matches at least
|
||||
.Ar n
|
||||
times.
|
||||
If the comma is also omitted, then it matches exactly
|
||||
.Ar n
|
||||
times.
|
||||
.It \*(Ba
|
||||
Used to separate patterns.
|
||||
For example,
|
||||
the pattern
|
||||
.Sq cat\*(Badog
|
||||
matches either
|
||||
.Sq cat
|
||||
or
|
||||
.Sq dog .
|
||||
.El
|
||||
.Sh BASIC REGULAR EXPRESSIONS
|
||||
Basic regular expressions differ in several respects:
|
||||
.Bl -bullet -offset 3n
|
||||
.It
|
||||
.Sq \*(Ba ,
|
||||
.Sq + ,
|
||||
and
|
||||
.Sq ?\&
|
||||
are ordinary characters and there is no equivalent
|
||||
for their functionality.
|
||||
.It
|
||||
The delimiters for bounds are
|
||||
.Sq \e{
|
||||
and
|
||||
.Sq \e} ,
|
||||
with
|
||||
.Sq {
|
||||
and
|
||||
.Sq }
|
||||
by themselves ordinary characters.
|
||||
.It
|
||||
The parentheses for nested subexpressions are
|
||||
.Sq \e(
|
||||
and
|
||||
.Sq \e) ,
|
||||
with
|
||||
.Sq (
|
||||
and
|
||||
.Sq )\&
|
||||
by themselves ordinary characters.
|
||||
.It
|
||||
.Sq ^
|
||||
is an ordinary character except at the beginning of the
|
||||
RE or** the beginning of a parenthesized subexpression.
|
||||
.It
|
||||
.Sq $
|
||||
is an ordinary character except at the end of the
|
||||
RE or** the end of a parenthesized subexpression.
|
||||
.It
|
||||
.Sq *
|
||||
is an ordinary character if it appears at the beginning of the
|
||||
RE or the beginning of a parenthesized subexpression
|
||||
(after a possible leading
|
||||
.Sq ^ ) .
|
||||
.It
|
||||
Finally, there is one new type of atom, a
|
||||
.Em back-reference :
|
||||
.Sq \e
|
||||
followed by a non-zero decimal digit
|
||||
.Ar d
|
||||
matches the same sequence of characters matched by the
|
||||
.Ar d Ns th
|
||||
parenthesized subexpression
|
||||
(numbering subexpressions by the positions of their opening parentheses,
|
||||
left to right),
|
||||
so that, for example,
|
||||
.Sq \e([bc]\e)\e1
|
||||
matches
|
||||
.Sq bb\&
|
||||
or
|
||||
.Sq cc
|
||||
but not
|
||||
.Sq bc .
|
||||
.El
|
||||
.Pp
|
||||
The following is a list of basic regular expressions:
|
||||
.Bl -tag -width Ds
|
||||
.It Ar c
|
||||
Any character
|
||||
.Ar c
|
||||
not listed below matches itself.
|
||||
.It \e Ns Ar c
|
||||
Any backslash-escaped character
|
||||
.Ar c ,
|
||||
except for
|
||||
.Sq { ,
|
||||
.Sq } ,
|
||||
.Sq \&( ,
|
||||
and
|
||||
.Sq \&) ,
|
||||
matches itself.
|
||||
.It \&.
|
||||
Matches any single character that is not a newline
|
||||
.Pq Sq \en .
|
||||
.It Bq Ar char-class
|
||||
Matches any single character in
|
||||
.Ar char-class .
|
||||
To include a
|
||||
.Ql \&]
|
||||
in
|
||||
.Ar char-class ,
|
||||
it must be the first character.
|
||||
A range of characters may be specified by separating the end characters
|
||||
of the range with a
|
||||
.Ql - ;
|
||||
e.g.\&
|
||||
.Ar a-z
|
||||
specifies the lower case characters.
|
||||
The following literal expressions can also be used in
|
||||
.Ar char-class
|
||||
to specify sets of characters:
|
||||
.Bd -unfilled -offset indent
|
||||
[:alnum:] [:cntrl:] [:lower:] [:space:]
|
||||
[:alpha:] [:digit:] [:print:] [:upper:]
|
||||
[:blank:] [:graph:] [:punct:] [:xdigit:]
|
||||
.Ed
|
||||
.Pp
|
||||
If
|
||||
.Ql -
|
||||
appears as the first or last character of
|
||||
.Ar char-class ,
|
||||
then it matches itself.
|
||||
All other characters in
|
||||
.Ar char-class
|
||||
match themselves.
|
||||
.Pp
|
||||
Patterns in
|
||||
.Ar char-class
|
||||
of the form
|
||||
.Eo [.
|
||||
.Ar col-elm
|
||||
.Ec .]\&
|
||||
or
|
||||
.Eo [=
|
||||
.Ar col-elm
|
||||
.Ec =]\& ,
|
||||
where
|
||||
.Ar col-elm
|
||||
is a collating element, are interpreted according to
|
||||
.Xr setlocale 3
|
||||
.Pq not currently supported .
|
||||
.It Bq ^ Ns Ar char-class
|
||||
Matches any single character, other than newline, not in
|
||||
.Ar char-class .
|
||||
.Ar char-class
|
||||
is defined as above.
|
||||
.It ^
|
||||
If
|
||||
.Sq ^
|
||||
is the first character of a regular expression, then it
|
||||
anchors the regular expression to the beginning of a line.
|
||||
Otherwise, it matches itself.
|
||||
.It $
|
||||
If
|
||||
.Sq $
|
||||
is the last character of a regular expression,
|
||||
it anchors the regular expression to the end of a line.
|
||||
Otherwise, it matches itself.
|
||||
.It [[:<:]]
|
||||
Anchors the single character regular expression or subexpression
|
||||
immediately following it to the beginning of a word.
|
||||
.It [[:>:]]
|
||||
Anchors the single character regular expression or subexpression
|
||||
immediately following it to the end of a word.
|
||||
.It \e( Ns Ar re Ns \e)
|
||||
Defines a subexpression
|
||||
.Ar re .
|
||||
Subexpressions may be nested.
|
||||
A subsequent backreference of the form
|
||||
.Pf \e Ns Ar n ,
|
||||
where
|
||||
.Ar n
|
||||
is a number in the range [1,9], expands to the text matched by the
|
||||
.Ar n Ns th
|
||||
subexpression.
|
||||
For example, the regular expression
|
||||
.Ar \e(.*\e)\e1
|
||||
matches any string consisting of identical adjacent substrings.
|
||||
Subexpressions are ordered relative to their left delimiter.
|
||||
.It *
|
||||
Matches the single character regular expression or subexpression
|
||||
immediately preceding it zero or more times.
|
||||
If
|
||||
.Sq *
|
||||
is the first character of a regular expression or subexpression,
|
||||
then it matches itself.
|
||||
The
|
||||
.Sq *
|
||||
operator sometimes yields unexpected results.
|
||||
For example, the regular expression
|
||||
.Ar b*
|
||||
matches the beginning of the string
|
||||
.Qq abbb
|
||||
(as opposed to the substring
|
||||
.Qq bbb ) ,
|
||||
since a null match is the only leftmost match.
|
||||
.Sm off
|
||||
.It Xo
|
||||
.Pf \e{ Ar n , m No \e}\ \&
|
||||
.Pf \e{ Ar n , No \e}\ \&
|
||||
.Pf \e{ Ar n No \e}
|
||||
.Xc
|
||||
.Sm on
|
||||
Matches the single character regular expression or subexpression
|
||||
immediately preceding it at least
|
||||
.Ar n
|
||||
and at most
|
||||
.Ar m
|
||||
times.
|
||||
If
|
||||
.Ar m
|
||||
is omitted, then it matches at least
|
||||
.Ar n
|
||||
times.
|
||||
If the comma is also omitted, then it matches exactly
|
||||
.Ar n
|
||||
times.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr ctype 3 ,
|
||||
.Xr regex 3
|
||||
.Sh STANDARDS
|
||||
.St -p1003.1-2004 :
|
||||
Base Definitions, Chapter 9 (Regular Expressions).
|
||||
.Sh BUGS
|
||||
Having two kinds of REs is a botch.
|
||||
.Pp
|
||||
The current POSIX spec says that
|
||||
.Sq )\&
|
||||
is an ordinary character in the absence of an unmatched
|
||||
.Sq ( ;
|
||||
this was an unintentional result of a wording error,
|
||||
and change is likely.
|
||||
Avoid relying on it.
|
||||
.Pp
|
||||
Back-references are a dreadful botch,
|
||||
posing major problems for efficient implementations.
|
||||
They are also somewhat vaguely defined
|
||||
(does
|
||||
.Sq a\e(\e(b\e)*\e2\e)*d
|
||||
match
|
||||
.Sq abbbd ? ) .
|
||||
Avoid using them.
|
||||
.Pp
|
||||
POSIX's specification of case-independent matching is vague.
|
||||
The
|
||||
.Dq one case implies all cases
|
||||
definition given above
|
||||
is the current consensus among implementors as to the right interpretation.
|
||||
.Pp
|
||||
The syntax for word boundaries is incredibly ugly.
|
||||
@@ -171,26 +171,28 @@ add a set of optimizations to run. The code looks like this:</p>
|
||||
|
||||
<div class="doc_code">
|
||||
<pre>
|
||||
ExistingModuleProvider OurModuleProvider(TheModule);
|
||||
FunctionPassManager OurFPM(&OurModuleProvider);
|
||||
|
||||
// Set up the optimizer pipeline. Start with registering info about how the
|
||||
// target lays out data structures.
|
||||
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
|
||||
// Do simple "peephole" optimizations and bit-twiddling optzns.
|
||||
OurFPM.add(createInstructionCombiningPass());
|
||||
// Reassociate expressions.
|
||||
OurFPM.add(createReassociatePass());
|
||||
// Eliminate Common SubExpressions.
|
||||
OurFPM.add(createGVNPass());
|
||||
// Simplify the control flow graph (deleting unreachable blocks, etc).
|
||||
OurFPM.add(createCFGSimplificationPass());
|
||||
ExistingModuleProvider *OurModuleProvider =
|
||||
new ExistingModuleProvider(TheModule);
|
||||
|
||||
// Set the global so the code gen can use this.
|
||||
TheFPM = &OurFPM;
|
||||
FunctionPassManager OurFPM(OurModuleProvider);
|
||||
|
||||
// Run the main "interpreter loop" now.
|
||||
MainLoop();
|
||||
// Set up the optimizer pipeline. Start with registering info about how the
|
||||
// target lays out data structures.
|
||||
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
|
||||
// Do simple "peephole" optimizations and bit-twiddling optzns.
|
||||
OurFPM.add(createInstructionCombiningPass());
|
||||
// Reassociate expressions.
|
||||
OurFPM.add(createReassociatePass());
|
||||
// Eliminate Common SubExpressions.
|
||||
OurFPM.add(createGVNPass());
|
||||
// Simplify the control flow graph (deleting unreachable blocks, etc).
|
||||
OurFPM.add(createCFGSimplificationPass());
|
||||
|
||||
// Set the global so the code gen can use this.
|
||||
TheFPM = &OurFPM;
|
||||
|
||||
// Run the main "interpreter loop" now.
|
||||
MainLoop();
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
@@ -298,8 +300,8 @@ by adding a global variable and a call in <tt>main</tt>:</p>
|
||||
...
|
||||
int main() {
|
||||
..
|
||||
<b>// Create the JIT.
|
||||
TheExecutionEngine = EngineBuilder(TheModule).create();</b>
|
||||
<b>// Create the JIT. This takes ownership of the module and module provider.
|
||||
TheExecutionEngine = EngineBuilder(OurModuleProvider).create();</b>
|
||||
..
|
||||
}
|
||||
</pre>
|
||||
@@ -1076,38 +1078,38 @@ int main() {
|
||||
|
||||
// Make the module, which holds all the code.
|
||||
TheModule = new Module("my cool jit", getGlobalContext());
|
||||
|
||||
// Create the JIT.
|
||||
TheExecutionEngine = EngineBuilder(TheModule).create();
|
||||
|
||||
{
|
||||
ExistingModuleProvider OurModuleProvider(TheModule);
|
||||
FunctionPassManager OurFPM(&OurModuleProvider);
|
||||
|
||||
// Set up the optimizer pipeline. Start with registering info about how the
|
||||
// target lays out data structures.
|
||||
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
|
||||
// Do simple "peephole" optimizations and bit-twiddling optzns.
|
||||
OurFPM.add(createInstructionCombiningPass());
|
||||
// Reassociate expressions.
|
||||
OurFPM.add(createReassociatePass());
|
||||
// Eliminate Common SubExpressions.
|
||||
OurFPM.add(createGVNPass());
|
||||
// Simplify the control flow graph (deleting unreachable blocks, etc).
|
||||
OurFPM.add(createCFGSimplificationPass());
|
||||
ExistingModuleProvider *OurModuleProvider =
|
||||
new ExistingModuleProvider(TheModule);
|
||||
|
||||
// Set the global so the code gen can use this.
|
||||
TheFPM = &OurFPM;
|
||||
// Create the JIT. This takes ownership of the module and module provider.
|
||||
TheExecutionEngine = EngineBuilder(OurModuleProvider).create();
|
||||
|
||||
FunctionPassManager OurFPM(OurModuleProvider);
|
||||
|
||||
// Set up the optimizer pipeline. Start with registering info about how the
|
||||
// target lays out data structures.
|
||||
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
|
||||
// Do simple "peephole" optimizations and bit-twiddling optzns.
|
||||
OurFPM.add(createInstructionCombiningPass());
|
||||
// Reassociate expressions.
|
||||
OurFPM.add(createReassociatePass());
|
||||
// Eliminate Common SubExpressions.
|
||||
OurFPM.add(createGVNPass());
|
||||
// Simplify the control flow graph (deleting unreachable blocks, etc).
|
||||
OurFPM.add(createCFGSimplificationPass());
|
||||
|
||||
// Set the global so the code gen can use this.
|
||||
TheFPM = &OurFPM;
|
||||
|
||||
// Run the main "interpreter loop" now.
|
||||
MainLoop();
|
||||
|
||||
TheFPM = 0;
|
||||
|
||||
// Print out all of the generated code.
|
||||
TheModule->dump();
|
||||
|
||||
// Run the main "interpreter loop" now.
|
||||
MainLoop();
|
||||
|
||||
TheFPM = 0;
|
||||
|
||||
// Print out all of the generated code.
|
||||
TheModule->dump();
|
||||
} // Free module provider (and thus the module) and pass manager.
|
||||
|
||||
return 0;
|
||||
}
|
||||
</pre>
|
||||
|
||||
@@ -1710,37 +1710,38 @@ int main() {
|
||||
|
||||
// Make the module, which holds all the code.
|
||||
TheModule = new Module("my cool jit", getGlobalContext());
|
||||
|
||||
// Create the JIT.
|
||||
TheExecutionEngine = EngineBuilder(TheModule).create();
|
||||
|
||||
{
|
||||
ExistingModuleProvider OurModuleProvider(TheModule);
|
||||
FunctionPassManager OurFPM(&OurModuleProvider);
|
||||
|
||||
// Set up the optimizer pipeline. Start with registering info about how the
|
||||
// target lays out data structures.
|
||||
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
|
||||
// Do simple "peephole" optimizations and bit-twiddling optzns.
|
||||
OurFPM.add(createInstructionCombiningPass());
|
||||
// Reassociate expressions.
|
||||
OurFPM.add(createReassociatePass());
|
||||
// Eliminate Common SubExpressions.
|
||||
OurFPM.add(createGVNPass());
|
||||
// Simplify the control flow graph (deleting unreachable blocks, etc).
|
||||
OurFPM.add(createCFGSimplificationPass());
|
||||
// Set the global so the code gen can use this.
|
||||
TheFPM = &OurFPM;
|
||||
ExistingModuleProvider *OurModuleProvider =
|
||||
new ExistingModuleProvider(TheModule);
|
||||
|
||||
// Run the main "interpreter loop" now.
|
||||
MainLoop();
|
||||
|
||||
TheFPM = 0;
|
||||
// Create the JIT. This takes ownership of the module and module provider.
|
||||
TheExecutionEngine = EngineBuilder(OurModuleProvider).create();
|
||||
|
||||
FunctionPassManager OurFPM(OurModuleProvider);
|
||||
|
||||
// Set up the optimizer pipeline. Start with registering info about how the
|
||||
// target lays out data structures.
|
||||
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
|
||||
// Do simple "peephole" optimizations and bit-twiddling optzns.
|
||||
OurFPM.add(createInstructionCombiningPass());
|
||||
// Reassociate expressions.
|
||||
OurFPM.add(createReassociatePass());
|
||||
// Eliminate Common SubExpressions.
|
||||
OurFPM.add(createGVNPass());
|
||||
// Simplify the control flow graph (deleting unreachable blocks, etc).
|
||||
OurFPM.add(createCFGSimplificationPass());
|
||||
|
||||
// Set the global so the code gen can use this.
|
||||
TheFPM = &OurFPM;
|
||||
|
||||
// Run the main "interpreter loop" now.
|
||||
MainLoop();
|
||||
|
||||
TheFPM = 0;
|
||||
|
||||
// Print out all of the generated code.
|
||||
TheModule->dump();
|
||||
|
||||
// Print out all of the generated code.
|
||||
TheModule->dump();
|
||||
} // Free module provider (and thus the module) and pass manager.
|
||||
|
||||
return 0;
|
||||
}
|
||||
</pre>
|
||||
|
||||
@@ -1749,37 +1749,38 @@ int main() {
|
||||
|
||||
// Make the module, which holds all the code.
|
||||
TheModule = new Module("my cool jit", getGlobalContext());
|
||||
|
||||
// Create the JIT.
|
||||
TheExecutionEngine = EngineBuilder(TheModule).create();
|
||||
|
||||
{
|
||||
ExistingModuleProvider OurModuleProvider(TheModule);
|
||||
FunctionPassManager OurFPM(&OurModuleProvider);
|
||||
|
||||
// Set up the optimizer pipeline. Start with registering info about how the
|
||||
// target lays out data structures.
|
||||
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
|
||||
// Do simple "peephole" optimizations and bit-twiddling optzns.
|
||||
OurFPM.add(createInstructionCombiningPass());
|
||||
// Reassociate expressions.
|
||||
OurFPM.add(createReassociatePass());
|
||||
// Eliminate Common SubExpressions.
|
||||
OurFPM.add(createGVNPass());
|
||||
// Simplify the control flow graph (deleting unreachable blocks, etc).
|
||||
OurFPM.add(createCFGSimplificationPass());
|
||||
// Set the global so the code gen can use this.
|
||||
TheFPM = &OurFPM;
|
||||
ExistingModuleProvider *OurModuleProvider =
|
||||
new ExistingModuleProvider(TheModule);
|
||||
|
||||
// Create the JIT. This takes ownership of the module and module provider.
|
||||
TheExecutionEngine = EngineBuilder(OurModuleProvider).create();
|
||||
|
||||
FunctionPassManager OurFPM(OurModuleProvider);
|
||||
|
||||
// Set up the optimizer pipeline. Start with registering info about how the
|
||||
// target lays out data structures.
|
||||
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
|
||||
// Do simple "peephole" optimizations and bit-twiddling optzns.
|
||||
OurFPM.add(createInstructionCombiningPass());
|
||||
// Reassociate expressions.
|
||||
OurFPM.add(createReassociatePass());
|
||||
// Eliminate Common SubExpressions.
|
||||
OurFPM.add(createGVNPass());
|
||||
// Simplify the control flow graph (deleting unreachable blocks, etc).
|
||||
OurFPM.add(createCFGSimplificationPass());
|
||||
|
||||
// Set the global so the code gen can use this.
|
||||
TheFPM = &OurFPM;
|
||||
|
||||
// Run the main "interpreter loop" now.
|
||||
MainLoop();
|
||||
|
||||
TheFPM = 0;
|
||||
|
||||
// Print out all of the generated code.
|
||||
TheModule->dump();
|
||||
|
||||
// Run the main "interpreter loop" now.
|
||||
MainLoop();
|
||||
|
||||
TheFPM = 0;
|
||||
|
||||
// Print out all of the generated code.
|
||||
TheModule->dump();
|
||||
} // Free module provider (and thus the module) and pass manager.
|
||||
|
||||
return 0;
|
||||
}
|
||||
</pre>
|
||||
|
||||
@@ -2101,41 +2101,38 @@ int main() {
|
||||
|
||||
// Make the module, which holds all the code.
|
||||
TheModule = new Module("my cool jit", getGlobalContext());
|
||||
|
||||
// Create the JIT.
|
||||
TheExecutionEngine = EngineBuilder(TheModule).create();
|
||||
|
||||
{
|
||||
ExistingModuleProvider OurModuleProvider(TheModule);
|
||||
FunctionPassManager OurFPM(&OurModuleProvider);
|
||||
|
||||
// Set up the optimizer pipeline. Start with registering info about how the
|
||||
// target lays out data structures.
|
||||
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
|
||||
// Promote allocas to registers.
|
||||
OurFPM.add(createPromoteMemoryToRegisterPass());
|
||||
// Do simple "peephole" optimizations and bit-twiddling optzns.
|
||||
OurFPM.add(createInstructionCombiningPass());
|
||||
// Reassociate expressions.
|
||||
OurFPM.add(createReassociatePass());
|
||||
// Eliminate Common SubExpressions.
|
||||
OurFPM.add(createGVNPass());
|
||||
// Simplify the control flow graph (deleting unreachable blocks, etc).
|
||||
OurFPM.add(createCFGSimplificationPass());
|
||||
ExistingModuleProvider *OurModuleProvider =
|
||||
new ExistingModuleProvider(TheModule);
|
||||
|
||||
// Set the global so the code gen can use this.
|
||||
TheFPM = &OurFPM;
|
||||
// Create the JIT. This takes ownership of the module and module provider.
|
||||
TheExecutionEngine = EngineBuilder(OurModuleProvider).create();
|
||||
|
||||
FunctionPassManager OurFPM(OurModuleProvider);
|
||||
|
||||
// Set up the optimizer pipeline. Start with registering info about how the
|
||||
// target lays out data structures.
|
||||
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
|
||||
// Do simple "peephole" optimizations and bit-twiddling optzns.
|
||||
OurFPM.add(createInstructionCombiningPass());
|
||||
// Reassociate expressions.
|
||||
OurFPM.add(createReassociatePass());
|
||||
// Eliminate Common SubExpressions.
|
||||
OurFPM.add(createGVNPass());
|
||||
// Simplify the control flow graph (deleting unreachable blocks, etc).
|
||||
OurFPM.add(createCFGSimplificationPass());
|
||||
|
||||
// Set the global so the code gen can use this.
|
||||
TheFPM = &OurFPM;
|
||||
|
||||
// Run the main "interpreter loop" now.
|
||||
MainLoop();
|
||||
|
||||
TheFPM = 0;
|
||||
|
||||
// Print out all of the generated code.
|
||||
TheModule->dump();
|
||||
|
||||
// Run the main "interpreter loop" now.
|
||||
MainLoop();
|
||||
|
||||
TheFPM = 0;
|
||||
|
||||
// Print out all of the generated code.
|
||||
TheModule->dump();
|
||||
|
||||
} // Free module provider (and thus the module) and pass manager.
|
||||
|
||||
return 0;
|
||||
}
|
||||
</pre>
|
||||
|
||||
@@ -110,7 +110,6 @@ int main(int argc, char **argv) {
|
||||
if (OutputFilename != "-") {
|
||||
std::string ErrInfo;
|
||||
out = new raw_fd_ostream(OutputFilename.c_str(), ErrInfo,
|
||||
raw_fd_ostream::F_Force|
|
||||
raw_fd_ostream::F_Binary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1108,42 +1108,40 @@ int main() {
|
||||
// Make the module, which holds all the code.
|
||||
TheModule = new Module("my cool jit", Context);
|
||||
|
||||
{
|
||||
ExistingModuleProvider OurModuleProvider(TheModule);
|
||||
ExistingModuleProvider *OurModuleProvider =
|
||||
new ExistingModuleProvider(TheModule);
|
||||
|
||||
// Create the JIT.
|
||||
TheExecutionEngine = EngineBuilder(&OurModuleProvider).create();
|
||||
// Create the JIT. This takes ownership of the module and module provider.
|
||||
TheExecutionEngine = EngineBuilder(OurModuleProvider).create();
|
||||
|
||||
FunctionPassManager OurFPM(&OurModuleProvider);
|
||||
|
||||
// Set up the optimizer pipeline. Start with registering info about how the
|
||||
// target lays out data structures.
|
||||
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
|
||||
// Promote allocas to registers.
|
||||
OurFPM.add(createPromoteMemoryToRegisterPass());
|
||||
// Do simple "peephole" optimizations and bit-twiddling optzns.
|
||||
OurFPM.add(createInstructionCombiningPass());
|
||||
// Reassociate expressions.
|
||||
OurFPM.add(createReassociatePass());
|
||||
// Eliminate Common SubExpressions.
|
||||
OurFPM.add(createGVNPass());
|
||||
// Simplify the control flow graph (deleting unreachable blocks, etc).
|
||||
OurFPM.add(createCFGSimplificationPass());
|
||||
FunctionPassManager OurFPM(OurModuleProvider);
|
||||
|
||||
OurFPM.doInitialization();
|
||||
// Set up the optimizer pipeline. Start with registering info about how the
|
||||
// target lays out data structures.
|
||||
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
|
||||
// Promote allocas to registers.
|
||||
OurFPM.add(createPromoteMemoryToRegisterPass());
|
||||
// Do simple "peephole" optimizations and bit-twiddling optzns.
|
||||
OurFPM.add(createInstructionCombiningPass());
|
||||
// Reassociate expressions.
|
||||
OurFPM.add(createReassociatePass());
|
||||
// Eliminate Common SubExpressions.
|
||||
OurFPM.add(createGVNPass());
|
||||
// Simplify the control flow graph (deleting unreachable blocks, etc).
|
||||
OurFPM.add(createCFGSimplificationPass());
|
||||
|
||||
// Set the global so the code gen can use this.
|
||||
TheFPM = &OurFPM;
|
||||
OurFPM.doInitialization();
|
||||
|
||||
// Set the global so the code gen can use this.
|
||||
TheFPM = &OurFPM;
|
||||
|
||||
// Run the main "interpreter loop" now.
|
||||
MainLoop();
|
||||
|
||||
TheFPM = 0;
|
||||
|
||||
// Print out all of the generated code.
|
||||
TheModule->dump();
|
||||
|
||||
// Run the main "interpreter loop" now.
|
||||
MainLoop();
|
||||
|
||||
TheFPM = 0;
|
||||
|
||||
// Print out all of the generated code.
|
||||
TheModule->dump();
|
||||
|
||||
} // Free module provider (and thus the module) and pass manager.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,8 @@ typedef enum {
|
||||
LLVMNoCaptureAttribute = 1<<21,
|
||||
LLVMNoRedZoneAttribute = 1<<22,
|
||||
LLVMNoImplicitFloatAttribute = 1<<23,
|
||||
LLVMNakedAttribute = 1<<24
|
||||
LLVMNakedAttribute = 1<<24,
|
||||
LLVMInlineHintAttribute = 1<<25
|
||||
} LLVMAttribute;
|
||||
|
||||
typedef enum {
|
||||
@@ -207,8 +208,8 @@ void LLVMDisposeMessage(char *Message);
|
||||
/*===-- Modules -----------------------------------------------------------===*/
|
||||
|
||||
/* Create and destroy contexts. */
|
||||
LLVMContextRef LLVMContextCreate();
|
||||
LLVMContextRef LLVMGetGlobalContext();
|
||||
LLVMContextRef LLVMContextCreate(void);
|
||||
LLVMContextRef LLVMGetGlobalContext(void);
|
||||
void LLVMContextDispose(LLVMContextRef C);
|
||||
|
||||
/* Create and destroy modules. */
|
||||
|
||||
@@ -93,6 +93,8 @@ public:
|
||||
void resize(size_t Size) { grow(Size); }
|
||||
|
||||
void clear() {
|
||||
if (NumEntries == 0 && NumTombstones == 0) return;
|
||||
|
||||
// If the capacity of the array is huge, and the # elements used is small,
|
||||
// shrink the array.
|
||||
if (NumEntries * 4 < NumBuckets && NumBuckets > 64) {
|
||||
|
||||
@@ -84,6 +84,20 @@ template<> struct DenseMapInfo<unsigned long> {
|
||||
}
|
||||
};
|
||||
|
||||
// Provide DenseMapInfo for unsigned long longs.
|
||||
template<> struct DenseMapInfo<unsigned long long> {
|
||||
static inline unsigned long long getEmptyKey() { return ~0LL; }
|
||||
static inline unsigned long long getTombstoneKey() { return ~0LL - 1LL; }
|
||||
static unsigned getHashValue(const unsigned long long& Val) {
|
||||
return (unsigned)(Val * 37LL);
|
||||
}
|
||||
static bool isPod() { return true; }
|
||||
static bool isEqual(const unsigned long long& LHS,
|
||||
const unsigned long long& RHS) {
|
||||
return LHS == RHS;
|
||||
}
|
||||
};
|
||||
|
||||
// Provide DenseMapInfo for all pairs whose members have info.
|
||||
template<typename T, typename U>
|
||||
struct DenseMapInfo<std::pair<T, U> > {
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#define LLVM_ADT_DEPTHFIRSTITERATOR_H
|
||||
|
||||
#include "llvm/ADT/GraphTraits.h"
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include "llvm/ADT/SmallPtrSet.h"
|
||||
#include "llvm/ADT/PointerIntPair.h"
|
||||
#include <set>
|
||||
@@ -63,9 +62,11 @@ public:
|
||||
template<class GraphT,
|
||||
class SetType = llvm::SmallPtrSet<typename GraphTraits<GraphT>::NodeType*, 8>,
|
||||
bool ExtStorage = false, class GT = GraphTraits<GraphT> >
|
||||
class df_iterator : public forward_iterator<typename GT::NodeType, ptrdiff_t>,
|
||||
class df_iterator : public std::iterator<std::forward_iterator_tag,
|
||||
typename GT::NodeType, ptrdiff_t>,
|
||||
public df_iterator_storage<SetType, ExtStorage> {
|
||||
typedef forward_iterator<typename GT::NodeType, ptrdiff_t> super;
|
||||
typedef std::iterator<std::forward_iterator_tag,
|
||||
typename GT::NodeType, ptrdiff_t> super;
|
||||
|
||||
typedef typename GT::NodeType NodeType;
|
||||
typedef typename GT::ChildIteratorType ChildItTy;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#ifndef LLVM_ADT_EQUIVALENCECLASSES_H
|
||||
#define LLVM_ADT_EQUIVALENCECLASSES_H
|
||||
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include <set>
|
||||
|
||||
@@ -234,8 +233,9 @@ public:
|
||||
return L1;
|
||||
}
|
||||
|
||||
class member_iterator : public forward_iterator<ElemTy, ptrdiff_t> {
|
||||
typedef forward_iterator<const ElemTy, ptrdiff_t> super;
|
||||
class member_iterator : public std::iterator<std::forward_iterator_tag,
|
||||
ElemTy, ptrdiff_t> {
|
||||
typedef std::iterator<std::forward_iterator_tag, ElemTy, ptrdiff_t> super;
|
||||
const ECValue *Node;
|
||||
friend class EquivalenceClasses;
|
||||
public:
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
|
||||
reference operator*() const {
|
||||
assert(Node != 0 && "Dereferencing end()!");
|
||||
return Node->getData();
|
||||
return const_cast<reference>(Node->getData()); // FIXME
|
||||
}
|
||||
reference operator->() const { return operator*(); }
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#define LLVM_ADT_POSTORDERITERATOR_H
|
||||
|
||||
#include "llvm/ADT/GraphTraits.h"
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include "llvm/ADT/SmallPtrSet.h"
|
||||
#include <set>
|
||||
#include <stack>
|
||||
@@ -43,9 +42,11 @@ template<class GraphT,
|
||||
class SetType = llvm::SmallPtrSet<typename GraphTraits<GraphT>::NodeType*, 8>,
|
||||
bool ExtStorage = false,
|
||||
class GT = GraphTraits<GraphT> >
|
||||
class po_iterator : public forward_iterator<typename GT::NodeType, ptrdiff_t>,
|
||||
class po_iterator : public std::iterator<std::forward_iterator_tag,
|
||||
typename GT::NodeType, ptrdiff_t>,
|
||||
public po_iterator_storage<SetType, ExtStorage> {
|
||||
typedef forward_iterator<typename GT::NodeType, ptrdiff_t> super;
|
||||
typedef std::iterator<std::forward_iterator_tag,
|
||||
typename GT::NodeType, ptrdiff_t> super;
|
||||
typedef typename GT::NodeType NodeType;
|
||||
typedef typename GT::ChildIteratorType ChildItTy;
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#define LLVM_ADT_SCCITERATOR_H
|
||||
|
||||
#include "llvm/ADT/GraphTraits.h"
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
@@ -35,11 +34,13 @@ namespace llvm {
|
||||
///
|
||||
template<class GraphT, class GT = GraphTraits<GraphT> >
|
||||
class scc_iterator
|
||||
: public forward_iterator<std::vector<typename GT::NodeType>, ptrdiff_t> {
|
||||
: public std::iterator<std::forward_iterator_tag,
|
||||
std::vector<typename GT::NodeType>, ptrdiff_t> {
|
||||
typedef typename GT::NodeType NodeType;
|
||||
typedef typename GT::ChildIteratorType ChildItTy;
|
||||
typedef std::vector<NodeType*> SccTy;
|
||||
typedef forward_iterator<SccTy, ptrdiff_t> super;
|
||||
typedef std::iterator<std::forward_iterator_tag,
|
||||
std::vector<typename GT::NodeType>, ptrdiff_t> super;
|
||||
typedef typename super::reference reference;
|
||||
typedef typename super::pointer pointer;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
#include <cstddef> // for std::size_t
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
#include <utility> // for std::pair
|
||||
#include "llvm/ADT/iterator.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#ifndef LLVM_ADT_SMALLVECTOR_H
|
||||
#define LLVM_ADT_SMALLVECTOR_H
|
||||
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include "llvm/Support/type_traits.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include <string>
|
||||
|
||||
// Some system headers or GCC predefined macros conflict with identifiers in
|
||||
// this file. Undefine them here.
|
||||
#undef mips
|
||||
#undef sparc
|
||||
|
||||
namespace llvm {
|
||||
class StringRef;
|
||||
class Twine;
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
#ifndef LLVM_ADT_ILIST_H
|
||||
#define LLVM_ADT_ILIST_H
|
||||
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@@ -140,11 +140,12 @@ struct ilist_traits<const Ty> : public ilist_traits<Ty> {};
|
||||
//
|
||||
template<typename NodeTy>
|
||||
class ilist_iterator
|
||||
: public bidirectional_iterator<NodeTy, ptrdiff_t> {
|
||||
: public std::iterator<std::bidirectional_iterator_tag, NodeTy, ptrdiff_t> {
|
||||
|
||||
public:
|
||||
typedef ilist_traits<NodeTy> Traits;
|
||||
typedef bidirectional_iterator<NodeTy, ptrdiff_t> super;
|
||||
typedef std::iterator<std::bidirectional_iterator_tag,
|
||||
NodeTy, ptrdiff_t> super;
|
||||
|
||||
typedef typename super::value_type value_type;
|
||||
typedef typename super::difference_type difference_type;
|
||||
@@ -189,12 +190,10 @@ public:
|
||||
|
||||
// Accessors...
|
||||
operator pointer() const {
|
||||
assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
|
||||
return NodePtr;
|
||||
}
|
||||
|
||||
reference operator*() const {
|
||||
assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
|
||||
return *NodePtr;
|
||||
}
|
||||
pointer operator->() const { return &operator*(); }
|
||||
@@ -215,7 +214,6 @@ public:
|
||||
}
|
||||
ilist_iterator &operator++() { // preincrement - Advance
|
||||
NodePtr = Traits::getNext(NodePtr);
|
||||
assert(NodePtr && "++'d off the end of an ilist!");
|
||||
return *this;
|
||||
}
|
||||
ilist_iterator operator--(int) { // postdecrement operators...
|
||||
|
||||
@@ -18,28 +18,37 @@
|
||||
namespace llvm {
|
||||
|
||||
template<typename NodeTy>
|
||||
struct ilist_nextprev_traits;
|
||||
struct ilist_traits;
|
||||
|
||||
/// ilist_half_node - Base class that provides prev services for sentinels.
|
||||
///
|
||||
template<typename NodeTy>
|
||||
class ilist_half_node {
|
||||
friend struct ilist_traits<NodeTy>;
|
||||
NodeTy *Prev;
|
||||
protected:
|
||||
NodeTy *getPrev() { return Prev; }
|
||||
const NodeTy *getPrev() const { return Prev; }
|
||||
void setPrev(NodeTy *P) { Prev = P; }
|
||||
ilist_half_node() : Prev(0) {}
|
||||
};
|
||||
|
||||
template<typename NodeTy>
|
||||
struct ilist_traits;
|
||||
struct ilist_nextprev_traits;
|
||||
|
||||
/// ilist_node - Base class that provides next/prev services for nodes
|
||||
/// that use ilist_nextprev_traits or ilist_default_traits.
|
||||
///
|
||||
template<typename NodeTy>
|
||||
class ilist_node {
|
||||
private:
|
||||
class ilist_node : ilist_half_node<NodeTy> {
|
||||
friend struct ilist_nextprev_traits<NodeTy>;
|
||||
friend struct ilist_traits<NodeTy>;
|
||||
NodeTy *Prev, *Next;
|
||||
NodeTy *getPrev() { return Prev; }
|
||||
NodeTy *Next;
|
||||
NodeTy *getNext() { return Next; }
|
||||
const NodeTy *getPrev() const { return Prev; }
|
||||
const NodeTy *getNext() const { return Next; }
|
||||
void setPrev(NodeTy *N) { Prev = N; }
|
||||
void setNext(NodeTy *N) { Next = N; }
|
||||
protected:
|
||||
ilist_node() : Prev(0), Next(0) {}
|
||||
ilist_node() : Next(0) {}
|
||||
};
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
//===-- llvm/ADT/iterator - Portable wrapper around <iterator> --*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file was developed by the LLVM research group and is distributed under
|
||||
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file provides a wrapper around the mysterious <iterator> header file.
|
||||
// In GCC 2.95.3, the file defines a bidirectional_iterator class (and other
|
||||
// friends), instead of the standard iterator class. In GCC 3.1, the
|
||||
// bidirectional_iterator class got moved out and the new, standards compliant,
|
||||
// iterator<> class was added. Because there is nothing that we can do to get
|
||||
// correct behavior on both compilers, we have this header with #ifdef's. Gross
|
||||
// huh?
|
||||
//
|
||||
// By #includ'ing this file, you get the contents of <iterator> plus the
|
||||
// following classes in the global namespace:
|
||||
//
|
||||
// 1. bidirectional_iterator
|
||||
// 2. forward_iterator
|
||||
//
|
||||
// The #if directives' expressions are filled in by Autoconf.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_ADT_ITERATOR
|
||||
#define LLVM_ADT_ITERATOR
|
||||
|
||||
#include <iterator>
|
||||
|
||||
#undef HAVE_BI_ITERATOR
|
||||
#undef HAVE_STD_ITERATOR
|
||||
#undef HAVE_FWD_ITERATOR
|
||||
|
||||
// defined by Kevin
|
||||
#define HAVE_STD_ITERATOR 1
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define HAVE_BI_ITERATOR 0
|
||||
# define HAVE_STD_ITERATOR 1
|
||||
# define HAVE_FWD_ITERATOR 0
|
||||
#endif
|
||||
|
||||
#if !HAVE_BI_ITERATOR
|
||||
# if HAVE_STD_ITERATOR
|
||||
/// If the bidirectional iterator is not defined, we attempt to define it in
|
||||
/// terms of the C++ standard iterator. Otherwise, we import it with a "using"
|
||||
/// statement.
|
||||
///
|
||||
template<class Ty, class PtrDiffTy>
|
||||
struct bidirectional_iterator
|
||||
: public std::iterator<std::bidirectional_iterator_tag, Ty, PtrDiffTy> {
|
||||
};
|
||||
# else
|
||||
# error "Need to have standard iterator to define bidirectional iterator!"
|
||||
# endif
|
||||
#else
|
||||
using std::bidirectional_iterator;
|
||||
#endif
|
||||
|
||||
#if !HAVE_FWD_ITERATOR
|
||||
# if HAVE_STD_ITERATOR
|
||||
/// If the forward iterator is not defined, attempt to define it in terms of
|
||||
/// the C++ standard iterator. Otherwise, we import it with a "using" statement.
|
||||
///
|
||||
template<class Ty, class PtrDiffTy>
|
||||
struct forward_iterator
|
||||
: public std::iterator<std::forward_iterator_tag, Ty, PtrDiffTy> {
|
||||
};
|
||||
# else
|
||||
# error "Need to have standard iterator to define forward iterator!"
|
||||
# endif
|
||||
#else
|
||||
using std::forward_iterator;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,76 +0,0 @@
|
||||
//==-- llvm/ADT/iterator.h - Portable wrapper around <iterator> --*- C++ -*-==//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file provides a wrapper around the mysterious <iterator> header file.
|
||||
// In GCC 2.95.3, the file defines a bidirectional_iterator class (and other
|
||||
// friends), instead of the standard iterator class. In GCC 3.1, the
|
||||
// bidirectional_iterator class got moved out and the new, standards compliant,
|
||||
// iterator<> class was added. Because there is nothing that we can do to get
|
||||
// correct behavior on both compilers, we have this header with #ifdef's. Gross
|
||||
// huh?
|
||||
//
|
||||
// By #includ'ing this file, you get the contents of <iterator> plus the
|
||||
// following classes in the global namespace:
|
||||
//
|
||||
// 1. bidirectional_iterator
|
||||
// 2. forward_iterator
|
||||
//
|
||||
// The #if directives' expressions are filled in by Autoconf.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_ADT_ITERATOR_H
|
||||
#define LLVM_ADT_ITERATOR_H
|
||||
|
||||
#include <iterator>
|
||||
|
||||
#undef HAVE_BI_ITERATOR
|
||||
#undef HAVE_STD_ITERATOR
|
||||
#undef HAVE_FWD_ITERATOR
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define HAVE_BI_ITERATOR 0
|
||||
# define HAVE_STD_ITERATOR 1
|
||||
# define HAVE_FWD_ITERATOR 0
|
||||
#endif
|
||||
|
||||
#if !HAVE_BI_ITERATOR
|
||||
# if HAVE_STD_ITERATOR
|
||||
/// If the bidirectional iterator is not defined, we attempt to define it in
|
||||
/// terms of the C++ standard iterator. Otherwise, we import it with a "using"
|
||||
/// statement.
|
||||
///
|
||||
template<class Ty, class PtrDiffTy>
|
||||
struct bidirectional_iterator
|
||||
: public std::iterator<std::bidirectional_iterator_tag, Ty, PtrDiffTy> {
|
||||
};
|
||||
# else
|
||||
# error "Need to have standard iterator to define bidirectional iterator!"
|
||||
# endif
|
||||
#else
|
||||
using std::bidirectional_iterator;
|
||||
#endif
|
||||
|
||||
#if !HAVE_FWD_ITERATOR
|
||||
# if HAVE_STD_ITERATOR
|
||||
/// If the forward iterator is not defined, attempt to define it in terms of
|
||||
/// the C++ standard iterator. Otherwise, we import it with a "using" statement.
|
||||
///
|
||||
template<class Ty, class PtrDiffTy>
|
||||
struct forward_iterator
|
||||
: public std::iterator<std::forward_iterator_tag, Ty, PtrDiffTy> {
|
||||
};
|
||||
# else
|
||||
# error "Need to have standard iterator to define forward iterator!"
|
||||
# endif
|
||||
#else
|
||||
using std::forward_iterator;
|
||||
#endif
|
||||
|
||||
#endif // LLVM_ADT_ITERATOR_H
|
||||
@@ -347,7 +347,7 @@ bool isNoAliasCall(const Value *V);
|
||||
|
||||
/// isIdentifiedObject - Return true if this pointer refers to a distinct and
|
||||
/// identifiable object. This returns true for:
|
||||
/// Global Variables and Functions
|
||||
/// Global Variables and Functions (but not Global Aliases)
|
||||
/// Allocas and Mallocs
|
||||
/// ByVal and NoAlias Arguments
|
||||
/// NoAlias returns
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "llvm/Support/CallSite.h"
|
||||
#include "llvm/Support/ValueHandle.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include "llvm/ADT/ilist.h"
|
||||
#include "llvm/ADT/ilist_node.h"
|
||||
#include <vector>
|
||||
@@ -159,7 +158,8 @@ public:
|
||||
void dump() const;
|
||||
|
||||
/// Define an iterator for alias sets... this is just a forward iterator.
|
||||
class iterator : public forward_iterator<PointerRec, ptrdiff_t> {
|
||||
class iterator : public std::iterator<std::forward_iterator_tag,
|
||||
PointerRec, ptrdiff_t> {
|
||||
PointerRec *CurNode;
|
||||
public:
|
||||
explicit iterator(PointerRec *CN = 0) : CurNode(CN) {}
|
||||
|
||||
@@ -77,7 +77,7 @@ protected:
|
||||
public:
|
||||
static char ID; // Class identification, replacement for typeinfo
|
||||
//===---------------------------------------------------------------------
|
||||
// Accessors...
|
||||
// Accessors.
|
||||
//
|
||||
typedef FunctionMapTy::iterator iterator;
|
||||
typedef FunctionMapTy::const_iterator const_iterator;
|
||||
@@ -107,6 +107,7 @@ public:
|
||||
/// Returns the CallGraphNode which is used to represent undetermined calls
|
||||
/// into the callgraph. Override this if you want behavioral inheritance.
|
||||
virtual CallGraphNode* getExternalCallingNode() const { return 0; }
|
||||
virtual CallGraphNode* getCallsExternalNode() const { return 0; }
|
||||
|
||||
/// Return the root/main method in the module, or some other root node, such
|
||||
/// as the externalcallingnode. Overload these if you behavioral
|
||||
@@ -130,19 +131,13 @@ public:
|
||||
return removeFunctionFromModule((*this)[F]);
|
||||
}
|
||||
|
||||
/// changeFunction - This method changes the function associated with this
|
||||
/// CallGraphNode, for use by transformations that need to change the
|
||||
/// prototype of a Function (thus they must create a new Function and move the
|
||||
/// old code over).
|
||||
void changeFunction(Function *OldF, Function *NewF);
|
||||
|
||||
/// getOrInsertFunction - This method is identical to calling operator[], but
|
||||
/// it will insert a new CallGraphNode for the specified function if one does
|
||||
/// not already exist.
|
||||
CallGraphNode *getOrInsertFunction(const Function *F);
|
||||
|
||||
//===---------------------------------------------------------------------
|
||||
// Pass infrastructure interface glue code...
|
||||
// Pass infrastructure interface glue code.
|
||||
//
|
||||
protected:
|
||||
CallGraph() {}
|
||||
@@ -156,7 +151,7 @@ public:
|
||||
void initialize(Module &M);
|
||||
|
||||
void print(raw_ostream &o, Module *) const;
|
||||
|
||||
void dump() const;
|
||||
protected:
|
||||
// destroy - Release memory for the call graph
|
||||
virtual void destroy();
|
||||
@@ -169,19 +164,31 @@ class CallGraphNode {
|
||||
Function *F;
|
||||
typedef std::pair<CallSite,CallGraphNode*> CallRecord;
|
||||
std::vector<CallRecord> CalledFunctions;
|
||||
|
||||
/// NumReferences - This is the number of times that this CallGraphNode occurs
|
||||
/// in the CalledFunctions array of this or other CallGraphNodes.
|
||||
unsigned NumReferences;
|
||||
|
||||
CallGraphNode(const CallGraphNode &); // Do not implement
|
||||
CallGraphNode(const CallGraphNode &); // DO NOT IMPLEMENT
|
||||
void operator=(const CallGraphNode &); // DO NOT IMPLEMENT
|
||||
|
||||
void DropRef() { --NumReferences; }
|
||||
void AddRef() { ++NumReferences; }
|
||||
public:
|
||||
typedef std::vector<CallRecord> CalledFunctionsVector;
|
||||
|
||||
|
||||
// CallGraphNode ctor - Create a node for the specified function.
|
||||
inline CallGraphNode(Function *f) : F(f), NumReferences(0) {}
|
||||
|
||||
//===---------------------------------------------------------------------
|
||||
// Accessor methods...
|
||||
// Accessor methods.
|
||||
//
|
||||
|
||||
typedef std::vector<CallRecord>::iterator iterator;
|
||||
typedef std::vector<CallRecord>::const_iterator const_iterator;
|
||||
|
||||
// getFunction - Return the function that this call graph node represents...
|
||||
// getFunction - Return the function that this call graph node represents.
|
||||
Function *getFunction() const { return F; }
|
||||
|
||||
inline iterator begin() { return CalledFunctions.begin(); }
|
||||
@@ -191,9 +198,14 @@ public:
|
||||
inline bool empty() const { return CalledFunctions.empty(); }
|
||||
inline unsigned size() const { return (unsigned)CalledFunctions.size(); }
|
||||
|
||||
// Subscripting operator - Return the i'th called function...
|
||||
/// getNumReferences - Return the number of other CallGraphNodes in this
|
||||
/// CallGraph that reference this node in their callee list.
|
||||
unsigned getNumReferences() const { return NumReferences; }
|
||||
|
||||
// Subscripting operator - Return the i'th called function.
|
||||
//
|
||||
CallGraphNode *operator[](unsigned i) const {
|
||||
assert(i < CalledFunctions.size() && "Invalid index");
|
||||
return CalledFunctions[i].second;
|
||||
}
|
||||
|
||||
@@ -210,13 +222,26 @@ public:
|
||||
/// removeAllCalledFunctions - As the name implies, this removes all edges
|
||||
/// from this CallGraphNode to any functions it calls.
|
||||
void removeAllCalledFunctions() {
|
||||
CalledFunctions.clear();
|
||||
while (!CalledFunctions.empty()) {
|
||||
CalledFunctions.back().second->DropRef();
|
||||
CalledFunctions.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
/// stealCalledFunctionsFrom - Move all the callee information from N to this
|
||||
/// node.
|
||||
void stealCalledFunctionsFrom(CallGraphNode *N) {
|
||||
assert(CalledFunctions.empty() &&
|
||||
"Cannot steal callsite information if I already have some");
|
||||
std::swap(CalledFunctions, N->CalledFunctions);
|
||||
}
|
||||
|
||||
|
||||
/// addCalledFunction - Add a function to the list of functions called by this
|
||||
/// one.
|
||||
void addCalledFunction(CallSite CS, CallGraphNode *M) {
|
||||
CalledFunctions.push_back(std::make_pair(CS, M));
|
||||
M->AddRef();
|
||||
}
|
||||
|
||||
/// removeCallEdgeFor - This method removes the edge in the node for the
|
||||
@@ -224,6 +249,10 @@ public:
|
||||
/// should be used sparingly.
|
||||
void removeCallEdgeFor(CallSite CS);
|
||||
|
||||
// FIXME: REMOVE THIS WHEN HACK IS REMOVED FROM CGSCCPASSMGR.
|
||||
void removeCallEdgeFor(Instruction *CS);
|
||||
|
||||
|
||||
/// removeAnyCallEdgeTo - This method removes all call edges from this node
|
||||
/// to the specified callee function. This takes more time to execute than
|
||||
/// removeCallEdgeTo, so it should not be used unless necessary.
|
||||
@@ -236,12 +265,7 @@ public:
|
||||
/// replaceCallSite - Make the edge in the node for Old CallSite be for
|
||||
/// New CallSite instead. Note that this method takes linear time, so it
|
||||
/// should be used sparingly.
|
||||
void replaceCallSite(CallSite Old, CallSite New);
|
||||
|
||||
friend class CallGraph;
|
||||
|
||||
// CallGraphNode ctor - Create a node for the specified function.
|
||||
inline CallGraphNode(Function *f) : F(f) {}
|
||||
void replaceCallSite(CallSite Old, CallSite New, CallGraphNode *NewCallee);
|
||||
};
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
#define LLVM_ANALYSIS_CONSTANTSSCANNER_H
|
||||
|
||||
#include "llvm/Support/InstIterator.h"
|
||||
#include "llvm/ADT/iterator.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
class Constant;
|
||||
|
||||
class constant_iterator : public forward_iterator<const Constant, ptrdiff_t> {
|
||||
class constant_iterator : public std::iterator<std::forward_iterator_tag,
|
||||
const Constant, ptrdiff_t> {
|
||||
const_inst_iterator InstI; // Method instruction iterator
|
||||
unsigned OpIdx; // Operand index
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#ifndef LLVM_ANALYSIS_DEBUGINFO_H
|
||||
#define LLVM_ANALYSIS_DEBUGINFO_H
|
||||
|
||||
#include "llvm/Metadata.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
@@ -44,12 +45,12 @@ namespace llvm {
|
||||
|
||||
class DIDescriptor {
|
||||
protected:
|
||||
GlobalVariable *DbgGV;
|
||||
MDNode *DbgNode;
|
||||
|
||||
/// DIDescriptor constructor. If the specified GV is non-null, this checks
|
||||
/// DIDescriptor constructor. If the specified node is non-null, check
|
||||
/// to make sure that the tag in the descriptor matches 'RequiredTag'. If
|
||||
/// not, the debug info is corrupt and we ignore it.
|
||||
DIDescriptor(GlobalVariable *GV, unsigned RequiredTag);
|
||||
DIDescriptor(MDNode *N, unsigned RequiredTag);
|
||||
|
||||
const std::string &getStringField(unsigned Elt, std::string &Result) const;
|
||||
unsigned getUnsignedField(unsigned Elt) const {
|
||||
@@ -60,18 +61,18 @@ namespace llvm {
|
||||
|
||||
template <typename DescTy>
|
||||
DescTy getFieldAs(unsigned Elt) const {
|
||||
return DescTy(getDescriptorField(Elt).getGV());
|
||||
return DescTy(getDescriptorField(Elt).getNode());
|
||||
}
|
||||
|
||||
GlobalVariable *getGlobalVariableField(unsigned Elt) const;
|
||||
|
||||
public:
|
||||
explicit DIDescriptor() : DbgGV(0) {}
|
||||
explicit DIDescriptor(GlobalVariable *GV) : DbgGV(GV) {}
|
||||
explicit DIDescriptor() : DbgNode(0) {}
|
||||
explicit DIDescriptor(MDNode *N) : DbgNode(N) {}
|
||||
|
||||
bool isNull() const { return DbgGV == 0; }
|
||||
bool isNull() const { return DbgNode == 0; }
|
||||
|
||||
GlobalVariable *getGV() const { return DbgGV; }
|
||||
MDNode *getNode() const { return DbgNode; }
|
||||
|
||||
unsigned getVersion() const {
|
||||
return getUnsignedField(0) & LLVMDebugVersionMask;
|
||||
@@ -81,8 +82,8 @@ namespace llvm {
|
||||
return getUnsignedField(0) & ~LLVMDebugVersionMask;
|
||||
}
|
||||
|
||||
/// ValidDebugInfo - Return true if V represents valid debug info value.
|
||||
static bool ValidDebugInfo(Value *V, CodeGenOpt::Level OptLevel);
|
||||
/// ValidDebugInfo - Return true if N represents valid debug info value.
|
||||
static bool ValidDebugInfo(MDNode *N, CodeGenOpt::Level OptLevel);
|
||||
|
||||
/// dump - print descriptor.
|
||||
void dump() const;
|
||||
@@ -91,8 +92,8 @@ namespace llvm {
|
||||
/// DISubrange - This is used to represent ranges, for array bounds.
|
||||
class DISubrange : public DIDescriptor {
|
||||
public:
|
||||
explicit DISubrange(GlobalVariable *GV = 0)
|
||||
: DIDescriptor(GV, dwarf::DW_TAG_subrange_type) {}
|
||||
explicit DISubrange(MDNode *N = 0)
|
||||
: DIDescriptor(N, dwarf::DW_TAG_subrange_type) {}
|
||||
|
||||
int64_t getLo() const { return (int64_t)getUInt64Field(1); }
|
||||
int64_t getHi() const { return (int64_t)getUInt64Field(2); }
|
||||
@@ -101,7 +102,8 @@ namespace llvm {
|
||||
/// DIArray - This descriptor holds an array of descriptors.
|
||||
class DIArray : public DIDescriptor {
|
||||
public:
|
||||
explicit DIArray(GlobalVariable *GV = 0) : DIDescriptor(GV) {}
|
||||
explicit DIArray(MDNode *N = 0)
|
||||
: DIDescriptor(N) {}
|
||||
|
||||
unsigned getNumElements() const;
|
||||
DIDescriptor getElement(unsigned Idx) const {
|
||||
@@ -112,8 +114,8 @@ namespace llvm {
|
||||
/// DICompileUnit - A wrapper for a compile unit.
|
||||
class DICompileUnit : public DIDescriptor {
|
||||
public:
|
||||
explicit DICompileUnit(GlobalVariable *GV = 0)
|
||||
: DIDescriptor(GV, dwarf::DW_TAG_compile_unit) {}
|
||||
explicit DICompileUnit(MDNode *N = 0)
|
||||
: DIDescriptor(N, dwarf::DW_TAG_compile_unit) {}
|
||||
|
||||
unsigned getLanguage() const { return getUnsignedField(2); }
|
||||
const std::string &getFilename(std::string &F) const {
|
||||
@@ -154,8 +156,8 @@ namespace llvm {
|
||||
/// type/precision or a file/line pair for location info.
|
||||
class DIEnumerator : public DIDescriptor {
|
||||
public:
|
||||
explicit DIEnumerator(GlobalVariable *GV = 0)
|
||||
: DIDescriptor(GV, dwarf::DW_TAG_enumerator) {}
|
||||
explicit DIEnumerator(MDNode *N = 0)
|
||||
: DIDescriptor(N, dwarf::DW_TAG_enumerator) {}
|
||||
|
||||
const std::string &getName(std::string &F) const {
|
||||
return getStringField(1, F);
|
||||
@@ -169,16 +171,18 @@ namespace llvm {
|
||||
class DIType : public DIDescriptor {
|
||||
public:
|
||||
enum {
|
||||
FlagPrivate = 1 << 0,
|
||||
FlagProtected = 1 << 1,
|
||||
FlagFwdDecl = 1 << 2
|
||||
FlagPrivate = 1 << 0,
|
||||
FlagProtected = 1 << 1,
|
||||
FlagFwdDecl = 1 << 2,
|
||||
FlagAppleBlock = 1 << 3
|
||||
};
|
||||
|
||||
protected:
|
||||
DIType(GlobalVariable *GV, unsigned Tag) : DIDescriptor(GV, Tag) {}
|
||||
DIType(MDNode *N, unsigned Tag)
|
||||
: DIDescriptor(N, Tag) {}
|
||||
// This ctor is used when the Tag has already been validated by a derived
|
||||
// ctor.
|
||||
DIType(GlobalVariable *GV, bool, bool) : DIDescriptor(GV) {}
|
||||
DIType(MDNode *N, bool, bool) : DIDescriptor(N) {}
|
||||
|
||||
public:
|
||||
/// isDerivedType - Return true if the specified tag is legal for
|
||||
@@ -198,7 +202,7 @@ namespace llvm {
|
||||
/// Verify - Verify that a type descriptor is well formed.
|
||||
bool Verify() const;
|
||||
public:
|
||||
explicit DIType(GlobalVariable *GV);
|
||||
explicit DIType(MDNode *N);
|
||||
explicit DIType() {}
|
||||
virtual ~DIType() {}
|
||||
|
||||
@@ -214,14 +218,18 @@ namespace llvm {
|
||||
// carry this is just plain insane.
|
||||
uint64_t getOffsetInBits() const { return getUInt64Field(7); }
|
||||
unsigned getFlags() const { return getUnsignedField(8); }
|
||||
bool isPrivate() const { return
|
||||
(getFlags() & FlagPrivate) != 0;
|
||||
bool isPrivate() const {
|
||||
return (getFlags() & FlagPrivate) != 0;
|
||||
}
|
||||
bool isProtected() const {
|
||||
bool isProtected() const {
|
||||
return (getFlags() & FlagProtected) != 0;
|
||||
}
|
||||
bool isForwardDecl() const {
|
||||
return (getFlags() & FlagFwdDecl) != 0;
|
||||
bool isForwardDecl() const {
|
||||
return (getFlags() & FlagFwdDecl) != 0;
|
||||
}
|
||||
// isAppleBlock - Return true if this is the Apple Blocks extension.
|
||||
bool isAppleBlockExtension() const {
|
||||
return (getFlags() & FlagAppleBlock) != 0;
|
||||
}
|
||||
|
||||
/// dump - print type.
|
||||
@@ -231,8 +239,8 @@ namespace llvm {
|
||||
/// DIBasicType - A basic type, like 'int' or 'float'.
|
||||
class DIBasicType : public DIType {
|
||||
public:
|
||||
explicit DIBasicType(GlobalVariable *GV)
|
||||
: DIType(GV, dwarf::DW_TAG_base_type) {}
|
||||
explicit DIBasicType(MDNode *N = 0)
|
||||
: DIType(N, dwarf::DW_TAG_base_type) {}
|
||||
|
||||
unsigned getEncoding() const { return getUnsignedField(9); }
|
||||
|
||||
@@ -244,13 +252,13 @@ namespace llvm {
|
||||
/// a typedef, a pointer or reference, etc.
|
||||
class DIDerivedType : public DIType {
|
||||
protected:
|
||||
explicit DIDerivedType(GlobalVariable *GV, bool, bool)
|
||||
: DIType(GV, true, true) {}
|
||||
explicit DIDerivedType(MDNode *N, bool, bool)
|
||||
: DIType(N, true, true) {}
|
||||
public:
|
||||
explicit DIDerivedType(GlobalVariable *GV)
|
||||
: DIType(GV, true, true) {
|
||||
if (GV && !isDerivedType(getTag()))
|
||||
DbgGV = 0;
|
||||
explicit DIDerivedType(MDNode *N = 0)
|
||||
: DIType(N, true, true) {
|
||||
if (DbgNode && !isDerivedType(getTag()))
|
||||
DbgNode = 0;
|
||||
}
|
||||
|
||||
DIType getTypeDerivedFrom() const { return getFieldAs<DIType>(9); }
|
||||
@@ -272,10 +280,10 @@ namespace llvm {
|
||||
/// FIXME: Why is this a DIDerivedType??
|
||||
class DICompositeType : public DIDerivedType {
|
||||
public:
|
||||
explicit DICompositeType(GlobalVariable *GV)
|
||||
: DIDerivedType(GV, true, true) {
|
||||
if (GV && !isCompositeType(getTag()))
|
||||
DbgGV = 0;
|
||||
explicit DICompositeType(MDNode *N = 0)
|
||||
: DIDerivedType(N, true, true) {
|
||||
if (N && !isCompositeType(getTag()))
|
||||
DbgNode = 0;
|
||||
}
|
||||
|
||||
DIArray getTypeArray() const { return getFieldAs<DIArray>(10); }
|
||||
@@ -291,8 +299,8 @@ namespace llvm {
|
||||
/// DIGlobal - This is a common class for global variables and subprograms.
|
||||
class DIGlobal : public DIDescriptor {
|
||||
protected:
|
||||
explicit DIGlobal(GlobalVariable *GV, unsigned RequiredTag)
|
||||
: DIDescriptor(GV, RequiredTag) {}
|
||||
explicit DIGlobal(MDNode *N, unsigned RequiredTag)
|
||||
: DIDescriptor(N, RequiredTag) {}
|
||||
|
||||
/// isSubprogram - Return true if the specified tag is legal for
|
||||
/// DISubprogram.
|
||||
@@ -335,8 +343,8 @@ namespace llvm {
|
||||
/// DISubprogram - This is a wrapper for a subprogram (e.g. a function).
|
||||
class DISubprogram : public DIGlobal {
|
||||
public:
|
||||
explicit DISubprogram(GlobalVariable *GV = 0)
|
||||
: DIGlobal(GV, dwarf::DW_TAG_subprogram) {}
|
||||
explicit DISubprogram(MDNode *N = 0)
|
||||
: DIGlobal(N, dwarf::DW_TAG_subprogram) {}
|
||||
|
||||
DICompositeType getType() const { return getFieldAs<DICompositeType>(8); }
|
||||
|
||||
@@ -346,7 +354,7 @@ namespace llvm {
|
||||
DICompositeType DCT(getFieldAs<DICompositeType>(8));
|
||||
if (!DCT.isNull()) {
|
||||
DIArray A = DCT.getTypeArray();
|
||||
DIType T(A.getElement(0).getGV());
|
||||
DIType T(A.getElement(0).getNode());
|
||||
return T.getName(F);
|
||||
}
|
||||
DIType T(getFieldAs<DIType>(8));
|
||||
@@ -367,8 +375,8 @@ namespace llvm {
|
||||
/// DIGlobalVariable - This is a wrapper for a global variable.
|
||||
class DIGlobalVariable : public DIGlobal {
|
||||
public:
|
||||
explicit DIGlobalVariable(GlobalVariable *GV = 0)
|
||||
: DIGlobal(GV, dwarf::DW_TAG_variable) {}
|
||||
explicit DIGlobalVariable(MDNode *N = 0)
|
||||
: DIGlobal(N, dwarf::DW_TAG_variable) {}
|
||||
|
||||
GlobalVariable *getGlobal() const { return getGlobalVariableField(11); }
|
||||
|
||||
@@ -383,10 +391,10 @@ namespace llvm {
|
||||
/// global etc).
|
||||
class DIVariable : public DIDescriptor {
|
||||
public:
|
||||
explicit DIVariable(GlobalVariable *GV = 0)
|
||||
: DIDescriptor(GV) {
|
||||
if (GV && !isVariable(getTag()))
|
||||
DbgGV = 0;
|
||||
explicit DIVariable(MDNode *N = 0)
|
||||
: DIDescriptor(N) {
|
||||
if (DbgNode && !isVariable(getTag()))
|
||||
DbgNode = 0;
|
||||
}
|
||||
|
||||
DIDescriptor getContext() const { return getDescriptorField(1); }
|
||||
@@ -410,8 +418,8 @@ namespace llvm {
|
||||
/// DIBlock - This is a wrapper for a block (e.g. a function, scope, etc).
|
||||
class DIBlock : public DIDescriptor {
|
||||
public:
|
||||
explicit DIBlock(GlobalVariable *GV = 0)
|
||||
: DIDescriptor(GV, dwarf::DW_TAG_lexical_block) {}
|
||||
explicit DIBlock(MDNode *N = 0)
|
||||
: DIDescriptor(N, dwarf::DW_TAG_lexical_block) {}
|
||||
|
||||
DIDescriptor getContext() const { return getDescriptorField(1); }
|
||||
};
|
||||
@@ -538,10 +546,6 @@ namespace llvm {
|
||||
|
||||
private:
|
||||
Constant *GetTagConstant(unsigned TAG);
|
||||
Constant *GetStringConstant(const std::string &String);
|
||||
|
||||
/// getCastToEmpty - Return the descriptor as a Constant* with type '{}*'.
|
||||
Constant *getCastToEmpty(DIDescriptor D);
|
||||
};
|
||||
|
||||
/// Finds the stoppoint coressponding to this instruction, that is the
|
||||
@@ -603,7 +607,6 @@ namespace llvm {
|
||||
|
||||
/// isInlinedFnEnd - Return true if REI is ending an inlined function.
|
||||
bool isInlinedFnEnd(DbgRegionEndInst &REI, const Function *CurrentFn);
|
||||
|
||||
/// DebugInfoFinder - This object collects DebugInfo from a module.
|
||||
class DebugInfoFinder {
|
||||
|
||||
@@ -647,7 +650,7 @@ namespace llvm {
|
||||
bool addType(DIType DT);
|
||||
|
||||
public:
|
||||
typedef SmallVector<GlobalVariable *, 8>::iterator iterator;
|
||||
typedef SmallVector<MDNode *, 8>::iterator iterator;
|
||||
iterator compile_unit_begin() { return CUs.begin(); }
|
||||
iterator compile_unit_end() { return CUs.end(); }
|
||||
iterator subprogram_begin() { return SPs.begin(); }
|
||||
@@ -663,12 +666,11 @@ namespace llvm {
|
||||
unsigned type_count() { return TYs.size(); }
|
||||
|
||||
private:
|
||||
SmallVector<GlobalVariable *, 8> CUs; // Compile Units
|
||||
SmallVector<GlobalVariable *, 8> SPs; // Subprograms
|
||||
SmallVector<GlobalVariable *, 8> GVs; // Global Variables
|
||||
SmallVector<GlobalVariable *, 8> TYs; // Types
|
||||
SmallPtrSet<GlobalVariable *, 64> NodesSeen;
|
||||
|
||||
SmallVector<MDNode *, 8> CUs; // Compile Units
|
||||
SmallVector<MDNode *, 8> SPs; // Subprograms
|
||||
SmallVector<MDNode *, 8> GVs; // Global Variables;
|
||||
SmallVector<MDNode *, 8> TYs; // Types
|
||||
SmallPtrSet<MDNode *, 64> NodesSeen;
|
||||
};
|
||||
} // end namespace llvm
|
||||
|
||||
|
||||
@@ -82,12 +82,12 @@ public:
|
||||
typedef typename std::vector<DomTreeNodeBase<NodeT> *>::iterator iterator;
|
||||
typedef typename std::vector<DomTreeNodeBase<NodeT> *>::const_iterator
|
||||
const_iterator;
|
||||
|
||||
|
||||
iterator begin() { return Children.begin(); }
|
||||
iterator end() { return Children.end(); }
|
||||
const_iterator begin() const { return Children.begin(); }
|
||||
const_iterator end() const { return Children.end(); }
|
||||
|
||||
|
||||
NodeT *getBlock() const { return TheBB; }
|
||||
DomTreeNodeBase<NodeT> *getIDom() const { return IDom; }
|
||||
const std::vector<DomTreeNodeBase<NodeT>*> &getChildren() const {
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
|
||||
DomTreeNodeBase(NodeT *BB, DomTreeNodeBase<NodeT> *iDom)
|
||||
: TheBB(BB), IDom(iDom), DFSNumIn(-1), DFSNumOut(-1) { }
|
||||
|
||||
|
||||
DomTreeNodeBase<NodeT> *addChild(DomTreeNodeBase<NodeT> *C) {
|
||||
Children.push_back(C);
|
||||
return C;
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
void clearAllChildren() {
|
||||
Children.clear();
|
||||
}
|
||||
|
||||
|
||||
bool compare(DomTreeNodeBase<NodeT> *Other) {
|
||||
if (getNumChildren() != Other->getNumChildren())
|
||||
return true;
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
IDom->Children.push_back(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// getDFSNumIn/getDFSNumOut - These are an internal implementation detail, do
|
||||
/// not call them.
|
||||
unsigned getDFSNumIn() const { return DFSNumIn; }
|
||||
@@ -167,9 +167,9 @@ static raw_ostream &operator<<(raw_ostream &o,
|
||||
WriteAsOperand(o, Node->getBlock(), false);
|
||||
else
|
||||
o << " <<exit node>>";
|
||||
|
||||
|
||||
o << " {" << Node->getDFSNumIn() << "," << Node->getDFSNumOut() << "}";
|
||||
|
||||
|
||||
return o << "\n";
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ protected:
|
||||
Vertex.clear();
|
||||
RootNode = 0;
|
||||
}
|
||||
|
||||
|
||||
// NewBB is split and now it has one successor. Update dominator tree to
|
||||
// reflect this change.
|
||||
template<class N, class GraphT>
|
||||
@@ -320,7 +320,7 @@ public:
|
||||
|
||||
DomTreeNodeBase<NodeT>* MyNd = I->second;
|
||||
DomTreeNodeBase<NodeT>* OtherNd = OI->second;
|
||||
|
||||
|
||||
if (MyNd->compare(OtherNd))
|
||||
return true;
|
||||
}
|
||||
@@ -352,7 +352,7 @@ public:
|
||||
/// Note that this is not a constant time operation!
|
||||
///
|
||||
bool properlyDominates(const DomTreeNodeBase<NodeT> *A,
|
||||
DomTreeNodeBase<NodeT> *B) const {
|
||||
const DomTreeNodeBase<NodeT> *B) const {
|
||||
if (A == 0 || B == 0) return false;
|
||||
return dominatedBySlowTreeWalk(A, B);
|
||||
}
|
||||
@@ -378,12 +378,12 @@ public:
|
||||
&& "This is not implemented for post dominators");
|
||||
return dominates(&A->getParent()->front(), A);
|
||||
}
|
||||
|
||||
|
||||
/// dominates - Returns true iff A dominates B. Note that this is not a
|
||||
/// constant time operation!
|
||||
///
|
||||
inline bool dominates(const DomTreeNodeBase<NodeT> *A,
|
||||
DomTreeNodeBase<NodeT> *B) {
|
||||
const DomTreeNodeBase<NodeT> *B) {
|
||||
if (B == A)
|
||||
return true; // A node trivially dominates itself.
|
||||
|
||||
@@ -407,10 +407,10 @@ public:
|
||||
inline bool dominates(NodeT *A, NodeT *B) {
|
||||
if (A == B)
|
||||
return true;
|
||||
|
||||
|
||||
return dominates(getNode(A), getNode(B));
|
||||
}
|
||||
|
||||
|
||||
NodeT *getRoot() const {
|
||||
assert(this->Roots.size() == 1 && "Should always have entry node!");
|
||||
return this->Roots[0];
|
||||
@@ -522,7 +522,7 @@ public:
|
||||
assert(getNode(BB) && "Removing node that isn't in dominator tree.");
|
||||
DomTreeNodes.erase(BB);
|
||||
}
|
||||
|
||||
|
||||
/// splitBlock - BB is split and now it has one successor. Update dominator
|
||||
/// tree to reflect this change.
|
||||
void splitBlock(NodeT* NewBB) {
|
||||
@@ -546,7 +546,7 @@ public:
|
||||
|
||||
PrintDomTree<NodeT>(getRootNode(), o, 1);
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
template<class GraphT>
|
||||
friend void Compress(DominatorTreeBase<typename GraphT::NodeType>& DT,
|
||||
@@ -561,16 +561,16 @@ protected:
|
||||
friend void Link(DominatorTreeBase<typename GraphT::NodeType>& DT,
|
||||
unsigned DFSNumV, typename GraphT::NodeType* W,
|
||||
typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &WInfo);
|
||||
|
||||
|
||||
template<class GraphT>
|
||||
friend unsigned DFSPass(DominatorTreeBase<typename GraphT::NodeType>& DT,
|
||||
typename GraphT::NodeType* V,
|
||||
unsigned N);
|
||||
|
||||
|
||||
template<class FuncT, class N>
|
||||
friend void Calculate(DominatorTreeBase<typename GraphTraits<N>::NodeType>& DT,
|
||||
FuncT& F);
|
||||
|
||||
|
||||
/// updateDFSNumbers - Assign In and Out numbers to the nodes while walking
|
||||
/// dominator tree in dfs order.
|
||||
void updateDFSNumbers() {
|
||||
@@ -598,17 +598,17 @@ protected:
|
||||
// Otherwise, recursively visit this child.
|
||||
DomTreeNodeBase<NodeT> *Child = *ChildIt;
|
||||
++WorkStack.back().second;
|
||||
|
||||
|
||||
WorkStack.push_back(std::make_pair(Child, Child->begin()));
|
||||
Child->DFSNumIn = DFSNum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SlowQueries = 0;
|
||||
DFSInfoValid = true;
|
||||
}
|
||||
|
||||
|
||||
DomTreeNodeBase<NodeT> *getNodeForBlock(NodeT *BB) {
|
||||
typename DomTreeNodeMapType::iterator I = this->DomTreeNodes.find(BB);
|
||||
if (I != this->DomTreeNodes.end() && I->second)
|
||||
@@ -626,31 +626,31 @@ protected:
|
||||
DomTreeNodeBase<NodeT> *C = new DomTreeNodeBase<NodeT>(BB, IDomNode);
|
||||
return this->DomTreeNodes[BB] = IDomNode->addChild(C);
|
||||
}
|
||||
|
||||
|
||||
inline NodeT *getIDom(NodeT *BB) const {
|
||||
typename DenseMap<NodeT*, NodeT*>::const_iterator I = IDoms.find(BB);
|
||||
return I != IDoms.end() ? I->second : 0;
|
||||
}
|
||||
|
||||
|
||||
inline void addRoot(NodeT* BB) {
|
||||
this->Roots.push_back(BB);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
/// recalculate - compute a dominator tree for the given function
|
||||
template<class FT>
|
||||
void recalculate(FT& F) {
|
||||
if (!this->IsPostDominators) {
|
||||
reset();
|
||||
|
||||
|
||||
// Initialize roots
|
||||
this->Roots.push_back(&F.front());
|
||||
this->IDoms[&F.front()] = 0;
|
||||
this->DomTreeNodes[&F.front()] = 0;
|
||||
this->Vertex.push_back(0);
|
||||
|
||||
|
||||
Calculate<FT, NodeT*>(*this, F);
|
||||
|
||||
|
||||
updateDFSNumbers();
|
||||
} else {
|
||||
reset(); // Reset from the last time we were run...
|
||||
@@ -667,7 +667,7 @@ public:
|
||||
}
|
||||
|
||||
this->Vertex.push_back(0);
|
||||
|
||||
|
||||
Calculate<FT, Inverse<NodeT*> >(*this, F);
|
||||
}
|
||||
}
|
||||
@@ -683,18 +683,18 @@ class DominatorTree : public FunctionPass {
|
||||
public:
|
||||
static char ID; // Pass ID, replacement for typeid
|
||||
DominatorTreeBase<BasicBlock>* DT;
|
||||
|
||||
|
||||
DominatorTree() : FunctionPass(&ID) {
|
||||
DT = new DominatorTreeBase<BasicBlock>(false);
|
||||
}
|
||||
|
||||
|
||||
~DominatorTree() {
|
||||
DT->releaseMemory();
|
||||
delete DT;
|
||||
}
|
||||
|
||||
|
||||
DominatorTreeBase<BasicBlock>& getBase() { return *DT; }
|
||||
|
||||
|
||||
/// getRoots - Return the root blocks of the current CFG. This may include
|
||||
/// multiple blocks if we are computing post dominators. For forward
|
||||
/// dominators, this will always be a single block (the entry node).
|
||||
@@ -702,11 +702,11 @@ public:
|
||||
inline const std::vector<BasicBlock*> &getRoots() const {
|
||||
return DT->getRoots();
|
||||
}
|
||||
|
||||
|
||||
inline BasicBlock *getRoot() const {
|
||||
return DT->getRoot();
|
||||
}
|
||||
|
||||
|
||||
inline DomTreeNode *getRootNode() const {
|
||||
return DT->getRootNode();
|
||||
}
|
||||
@@ -716,10 +716,10 @@ public:
|
||||
inline bool compare(DominatorTree &Other) const {
|
||||
DomTreeNode *R = getRootNode();
|
||||
DomTreeNode *OtherR = Other.getRootNode();
|
||||
|
||||
|
||||
if (!R || !OtherR || R->getBlock() != OtherR->getBlock())
|
||||
return true;
|
||||
|
||||
|
||||
if (DT->compare(Other.getBase()))
|
||||
return true;
|
||||
|
||||
@@ -727,19 +727,19 @@ public:
|
||||
}
|
||||
|
||||
virtual bool runOnFunction(Function &F);
|
||||
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.setPreservesAll();
|
||||
}
|
||||
|
||||
|
||||
inline bool dominates(DomTreeNode* A, DomTreeNode* B) const {
|
||||
return DT->dominates(A, B);
|
||||
}
|
||||
|
||||
|
||||
inline bool dominates(BasicBlock* A, BasicBlock* B) const {
|
||||
return DT->dominates(A, B);
|
||||
}
|
||||
|
||||
|
||||
// dominates - Return true if A dominates B. This performs the
|
||||
// special checks necessary if A and B are in the same basic block.
|
||||
bool dominates(Instruction *A, Instruction *B) const {
|
||||
@@ -763,72 +763,73 @@ public:
|
||||
// return &*I == B;
|
||||
//}
|
||||
}
|
||||
|
||||
inline bool properlyDominates(const DomTreeNode* A, DomTreeNode* B) const {
|
||||
|
||||
inline bool properlyDominates(const DomTreeNode* A,
|
||||
const DomTreeNode* B) const {
|
||||
return DT->properlyDominates(A, B);
|
||||
}
|
||||
|
||||
|
||||
inline bool properlyDominates(BasicBlock* A, BasicBlock* B) const {
|
||||
return DT->properlyDominates(A, B);
|
||||
}
|
||||
|
||||
|
||||
/// findNearestCommonDominator - Find nearest common dominator basic block
|
||||
/// for basic block A and B. If there is no such block then return NULL.
|
||||
inline BasicBlock *findNearestCommonDominator(BasicBlock *A, BasicBlock *B) {
|
||||
return DT->findNearestCommonDominator(A, B);
|
||||
}
|
||||
|
||||
|
||||
inline DomTreeNode *operator[](BasicBlock *BB) const {
|
||||
return DT->getNode(BB);
|
||||
}
|
||||
|
||||
|
||||
/// getNode - return the (Post)DominatorTree node for the specified basic
|
||||
/// block. This is the same as using operator[] on this class.
|
||||
///
|
||||
inline DomTreeNode *getNode(BasicBlock *BB) const {
|
||||
return DT->getNode(BB);
|
||||
}
|
||||
|
||||
|
||||
/// addNewBlock - Add a new node to the dominator tree information. This
|
||||
/// creates a new node as a child of DomBB dominator node,linking it into
|
||||
/// the children list of the immediate dominator.
|
||||
inline DomTreeNode *addNewBlock(BasicBlock *BB, BasicBlock *DomBB) {
|
||||
return DT->addNewBlock(BB, DomBB);
|
||||
}
|
||||
|
||||
|
||||
/// changeImmediateDominator - This method is used to update the dominator
|
||||
/// tree information when a node's immediate dominator changes.
|
||||
///
|
||||
inline void changeImmediateDominator(BasicBlock *N, BasicBlock* NewIDom) {
|
||||
DT->changeImmediateDominator(N, NewIDom);
|
||||
}
|
||||
|
||||
|
||||
inline void changeImmediateDominator(DomTreeNode *N, DomTreeNode* NewIDom) {
|
||||
DT->changeImmediateDominator(N, NewIDom);
|
||||
}
|
||||
|
||||
|
||||
/// eraseNode - Removes a node from the dominator tree. Block must not
|
||||
/// domiante any other blocks. Removes node from its immediate dominator's
|
||||
/// children list. Deletes dominator node associated with basic block BB.
|
||||
inline void eraseNode(BasicBlock *BB) {
|
||||
DT->eraseNode(BB);
|
||||
}
|
||||
|
||||
|
||||
/// splitBlock - BB is split and now it has one successor. Update dominator
|
||||
/// tree to reflect this change.
|
||||
inline void splitBlock(BasicBlock* NewBB) {
|
||||
DT->splitBlock(NewBB);
|
||||
}
|
||||
|
||||
|
||||
bool isReachableFromEntry(BasicBlock* A) {
|
||||
return DT->isReachableFromEntry(A);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
virtual void releaseMemory() {
|
||||
DT->releaseMemory();
|
||||
}
|
||||
|
||||
|
||||
virtual void print(raw_ostream &OS, const Module* M= 0) const;
|
||||
};
|
||||
|
||||
@@ -839,7 +840,7 @@ public:
|
||||
template <> struct GraphTraits<DomTreeNode *> {
|
||||
typedef DomTreeNode NodeType;
|
||||
typedef NodeType::iterator ChildIteratorType;
|
||||
|
||||
|
||||
static NodeType *getEntryNode(NodeType *N) {
|
||||
return N;
|
||||
}
|
||||
@@ -871,7 +872,7 @@ protected:
|
||||
DomSetMapType Frontiers;
|
||||
std::vector<BasicBlock*> Roots;
|
||||
const bool IsPostDominators;
|
||||
|
||||
|
||||
public:
|
||||
DominanceFrontierBase(void *ID, bool isPostDom)
|
||||
: FunctionPass(ID), IsPostDominators(isPostDom) {}
|
||||
@@ -881,7 +882,7 @@ public:
|
||||
/// dominators, this will always be a single block (the entry node).
|
||||
///
|
||||
inline const std::vector<BasicBlock*> &getRoots() const { return Roots; }
|
||||
|
||||
|
||||
/// isPostDominator - Returns true if analysis based of postdoms
|
||||
///
|
||||
bool isPostDominator() const { return IsPostDominators; }
|
||||
|
||||
@@ -233,7 +233,8 @@ private:
|
||||
};
|
||||
|
||||
typedef IntervalIterator<BasicBlock, Function> function_interval_iterator;
|
||||
typedef IntervalIterator<Interval, IntervalPartition> interval_part_interval_iterator;
|
||||
typedef IntervalIterator<Interval, IntervalPartition>
|
||||
interval_part_interval_iterator;
|
||||
|
||||
|
||||
inline function_interval_iterator intervals_begin(Function *F,
|
||||
|
||||
@@ -213,7 +213,6 @@ public:
|
||||
}
|
||||
|
||||
/// getExitEdges - Return all pairs of (_inside_block_,_outside_block_).
|
||||
/// (Modelled after getExitingBlocks().)
|
||||
typedef std::pair<const BlockT*,const BlockT*> Edge;
|
||||
void getExitEdges(SmallVectorImpl<Edge> &ExitEdges) const {
|
||||
// Sort the blocks vector so that we can use binary search to do quick
|
||||
@@ -782,11 +781,8 @@ public:
|
||||
// loop can be found for them.
|
||||
//
|
||||
for (typename std::vector<BlockT*>::iterator I = L->Blocks.begin(),
|
||||
E = L->Blocks.end(); I != E; ++I) {
|
||||
typename std::map<BlockT*, LoopT *>::iterator BBMI = BBMap.find(*I);
|
||||
if (BBMI == BBMap.end()) // Not in map yet...
|
||||
BBMap.insert(BBMI, std::make_pair(*I, L)); // Must be at this level
|
||||
}
|
||||
E = L->Blocks.end(); I != E; ++I)
|
||||
BBMap.insert(std::make_pair(*I, L));
|
||||
|
||||
// Now that we have a list of all of the child loops of this loop, check to
|
||||
// see if any of them should actually be nested inside of each other. We
|
||||
|
||||
@@ -72,6 +72,13 @@ namespace llvm {
|
||||
///
|
||||
FunctionPass *createLibCallAliasAnalysisPass(LibCallInfo *LCI);
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
//
|
||||
// createScalarEvolutionAliasAnalysisPass - This pass implements a simple
|
||||
// alias analysis using ScalarEvolution queries.
|
||||
//
|
||||
FunctionPass *createScalarEvolutionAliasAnalysisPass();
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
//
|
||||
// createAndersensPass - This pass implements Andersen's interprocedural alias
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
namespace llvm {
|
||||
class Function;
|
||||
class Pass;
|
||||
class raw_ostream;
|
||||
|
||||
/// ProfileInfo Class - This class holds and maintains profiling
|
||||
/// information for some unit of code.
|
||||
@@ -36,20 +37,21 @@ namespace llvm {
|
||||
public:
|
||||
// Types for handling profiling information.
|
||||
typedef std::pair<const BasicBlock*, const BasicBlock*> Edge;
|
||||
typedef std::map<Edge, double> EdgeCounts;
|
||||
typedef std::pair<Edge, double> EdgeWeight;
|
||||
typedef std::map<Edge, double> EdgeWeights;
|
||||
typedef std::map<const BasicBlock*, double> BlockCounts;
|
||||
|
||||
protected:
|
||||
// EdgeCounts - Count the number of times a transition between two blocks is
|
||||
// executed. As a special case, we also hold an edge from the null
|
||||
// BasicBlock to the entry block to indicate how many times the function was
|
||||
// entered.
|
||||
std::map<const Function*, EdgeCounts> EdgeInformation;
|
||||
// EdgeInformation - Count the number of times a transition between two
|
||||
// blocks is executed. As a special case, we also hold an edge from the
|
||||
// null BasicBlock to the entry block to indicate how many times the
|
||||
// function was entered.
|
||||
std::map<const Function*, EdgeWeights> EdgeInformation;
|
||||
|
||||
// BlockCounts - Count the number of times a block is executed.
|
||||
// BlockInformation - Count the number of times a block is executed.
|
||||
std::map<const Function*, BlockCounts> BlockInformation;
|
||||
|
||||
// FunctionCounts - Count the number of times a function is executed.
|
||||
// FunctionInformation - Count the number of times a function is executed.
|
||||
std::map<const Function*, double> FunctionInformation;
|
||||
public:
|
||||
static char ID; // Class identification, replacement for typeinfo
|
||||
@@ -57,7 +59,7 @@ namespace llvm {
|
||||
|
||||
// MissingValue - The value that is returned for execution counts in case
|
||||
// no value is available.
|
||||
static const int MissingValue = -1;
|
||||
static const double MissingValue;
|
||||
|
||||
// getFunction() - Returns the Function for an Edge, checking for validity.
|
||||
static const Function* getFunction(Edge e) {
|
||||
@@ -66,7 +68,7 @@ namespace llvm {
|
||||
}
|
||||
|
||||
// getEdge() - Creates an Edge from two BasicBlocks.
|
||||
static Edge getEdge(const BasicBlock* Src, const BasicBlock* Dest) {
|
||||
static Edge getEdge(const BasicBlock *Src, const BasicBlock *Dest) {
|
||||
return std::make_pair(Src, Dest);
|
||||
}
|
||||
|
||||
@@ -78,16 +80,20 @@ namespace llvm {
|
||||
double getExecutionCount(const BasicBlock *BB);
|
||||
|
||||
double getEdgeWeight(Edge e) const {
|
||||
std::map<const Function*, EdgeCounts>::const_iterator J =
|
||||
std::map<const Function*, EdgeWeights>::const_iterator J =
|
||||
EdgeInformation.find(getFunction(e));
|
||||
if (J == EdgeInformation.end()) return MissingValue;
|
||||
|
||||
EdgeCounts::const_iterator I = J->second.find(e);
|
||||
EdgeWeights::const_iterator I = J->second.find(e);
|
||||
if (I == J->second.end()) return MissingValue;
|
||||
|
||||
return I->second;
|
||||
}
|
||||
|
||||
EdgeWeights &getEdgeWeights (const Function *F) {
|
||||
return EdgeInformation[F];
|
||||
}
|
||||
|
||||
//===------------------------------------------------------------------===//
|
||||
/// Analysis Update Methods
|
||||
///
|
||||
@@ -98,6 +104,9 @@ namespace llvm {
|
||||
/// profiling information for the module from the specified filename, making
|
||||
/// it available to the optimizers.
|
||||
Pass *createProfileLoaderPass(const std::string &Filename);
|
||||
|
||||
raw_ostream& operator<<(raw_ostream &O, ProfileInfo::Edge E);
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,14 +30,14 @@ namespace llvm {
|
||||
/// bit sets. This code only analyzes bits in Mask, in order to short-circuit
|
||||
/// processing.
|
||||
void ComputeMaskedBits(Value *V, const APInt &Mask, APInt &KnownZero,
|
||||
APInt &KnownOne, TargetData *TD = 0,
|
||||
APInt &KnownOne, const TargetData *TD = 0,
|
||||
unsigned Depth = 0);
|
||||
|
||||
/// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. We use
|
||||
/// this predicate to simplify operations downstream. Mask is known to be
|
||||
/// zero for bits that V cannot have.
|
||||
bool MaskedValueIsZero(Value *V, const APInt &Mask,
|
||||
TargetData *TD = 0, unsigned Depth = 0);
|
||||
const TargetData *TD = 0, unsigned Depth = 0);
|
||||
|
||||
|
||||
/// ComputeNumSignBits - Return the number of times the sign bit of the
|
||||
@@ -48,7 +48,7 @@ namespace llvm {
|
||||
///
|
||||
/// 'Op' must have a scalar integer type.
|
||||
///
|
||||
unsigned ComputeNumSignBits(Value *Op, TargetData *TD = 0,
|
||||
unsigned ComputeNumSignBits(Value *Op, const TargetData *TD = 0,
|
||||
unsigned Depth = 0);
|
||||
|
||||
/// CannotBeNegativeZero - Return true if we can prove that the specified FP
|
||||
|
||||
@@ -57,7 +57,8 @@ const Attributes NoCapture = 1<<21; ///< Function creates no aliases of pointer
|
||||
const Attributes NoRedZone = 1<<22; /// disable redzone
|
||||
const Attributes NoImplicitFloat = 1<<23; /// disable implicit floating point
|
||||
/// instructions.
|
||||
const Attributes Naked = 1<<24; ///< Naked function
|
||||
const Attributes Naked = 1<<24; ///< Naked function
|
||||
const Attributes InlineHint = 1<<25; ///< source said inlining was desirable
|
||||
|
||||
/// @brief Attributes that only apply to function parameters.
|
||||
const Attributes ParameterOnly = ByVal | Nest | StructRet | NoCapture;
|
||||
@@ -66,7 +67,7 @@ const Attributes ParameterOnly = ByVal | Nest | StructRet | NoCapture;
|
||||
/// be used on return values or function parameters.
|
||||
const Attributes FunctionOnly = NoReturn | NoUnwind | ReadNone | ReadOnly |
|
||||
NoInline | AlwaysInline | OptimizeForSize | StackProtect | StackProtectReq |
|
||||
NoRedZone | NoImplicitFloat | Naked;
|
||||
NoRedZone | NoImplicitFloat | Naked | InlineHint;
|
||||
|
||||
/// @brief Parameter attributes that do not apply to vararg call arguments.
|
||||
const Attributes VarArgsIncompatible = StructRet;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#define LLVM_AUTOUPGRADE_H
|
||||
|
||||
namespace llvm {
|
||||
class Module;
|
||||
class Function;
|
||||
class CallInst;
|
||||
|
||||
@@ -34,6 +35,9 @@ namespace llvm {
|
||||
/// so that it can update all calls to the old function.
|
||||
void UpgradeCallsToIntrinsic(Function* F);
|
||||
|
||||
/// This function checks debug info intrinsics. If an intrinsic is invalid
|
||||
/// then this function simply removes the intrinsic.
|
||||
void CheckDebugInfoIntrinsics(Module *M);
|
||||
} // End llvm namespace
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,7 +47,7 @@ template<> struct ilist_traits<Instruction>
|
||||
Instruction *ensureHead(Instruction*) const { return createSentinel(); }
|
||||
static void noteHead(Instruction*, Instruction*) {}
|
||||
private:
|
||||
mutable ilist_node<Instruction> Sentinel;
|
||||
mutable ilist_half_node<Instruction> Sentinel;
|
||||
};
|
||||
|
||||
/// This represents a single basic block in LLVM. A basic block is simply a
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include "llvm/Bitcode/BitCodes.h"
|
||||
#include <climits>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@@ -46,7 +46,10 @@ struct CallGraphSCCPass : public Pass {
|
||||
/// non-recursive (or only self-recursive) functions will have an SCC size of
|
||||
/// 1, where recursive portions of the call graph will have SCC size > 1.
|
||||
///
|
||||
virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC) = 0;
|
||||
/// SCC passes that add or delete functions to the SCC are required to update
|
||||
/// the SCC list, otherwise stale pointers may be dereferenced.
|
||||
///
|
||||
virtual bool runOnSCC(std::vector<CallGraphNode *> &SCC) = 0;
|
||||
|
||||
/// doFinalization - This method is called after the SCC's of the program has
|
||||
/// been processed, allowing the pass to do final cleanup as necessary.
|
||||
|
||||
@@ -268,7 +268,8 @@ namespace llvm {
|
||||
void EOL() const;
|
||||
void EOL(const std::string &Comment) const;
|
||||
void EOL(const char* Comment) const;
|
||||
|
||||
void EOL(const char *Comment, unsigned Encoding) const;
|
||||
|
||||
/// EmitULEB128Bytes - Emit an assembler byte data directive to compose an
|
||||
/// unsigned leb128 value.
|
||||
void EmitULEB128Bytes(unsigned Value) const;
|
||||
|
||||
@@ -33,7 +33,7 @@ class MachineFunction;
|
||||
class MachineInstr;
|
||||
class Value;
|
||||
class Module;
|
||||
class GlobalVariable;
|
||||
class MDNode;
|
||||
class MCAsmInfo;
|
||||
class raw_ostream;
|
||||
class Instruction;
|
||||
@@ -88,17 +88,17 @@ public:
|
||||
unsigned RecordSourceLine(unsigned Line, unsigned Col, DICompileUnit CU);
|
||||
|
||||
/// RecordRegionStart - Indicate the start of a region.
|
||||
unsigned RecordRegionStart(GlobalVariable *V);
|
||||
unsigned RecordRegionStart(MDNode *N);
|
||||
|
||||
/// RecordRegionEnd - Indicate the end of a region.
|
||||
unsigned RecordRegionEnd(GlobalVariable *V);
|
||||
unsigned RecordRegionEnd(MDNode *N);
|
||||
|
||||
/// getRecordSourceLineCount - Count source lines.
|
||||
unsigned getRecordSourceLineCount();
|
||||
|
||||
/// RecordVariable - Indicate the declaration of a local variable.
|
||||
///
|
||||
void RecordVariable(GlobalVariable *GV, unsigned FrameIndex);
|
||||
void RecordVariable(MDNode *N, unsigned FrameIndex);
|
||||
|
||||
/// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should
|
||||
/// be emitted.
|
||||
|
||||
@@ -26,7 +26,7 @@ class raw_ostream;
|
||||
template <>
|
||||
struct ilist_traits<MachineInstr> : public ilist_default_traits<MachineInstr> {
|
||||
private:
|
||||
mutable ilist_node<MachineInstr> Sentinel;
|
||||
mutable ilist_half_node<MachineInstr> Sentinel;
|
||||
|
||||
// this is only set by the MachineBasicBlock owning the LiveList
|
||||
friend class MachineBasicBlock;
|
||||
|
||||
@@ -38,7 +38,7 @@ class TargetRegisterClass;
|
||||
template <>
|
||||
struct ilist_traits<MachineBasicBlock>
|
||||
: public ilist_default_traits<MachineBasicBlock> {
|
||||
mutable ilist_node<MachineBasicBlock> Sentinel;
|
||||
mutable ilist_half_node<MachineBasicBlock> Sentinel;
|
||||
public:
|
||||
MachineBasicBlock *createSentinel() const {
|
||||
return static_cast<MachineBasicBlock*>(&Sentinel);
|
||||
@@ -327,7 +327,7 @@ public:
|
||||
/// getOrCreateDebugLocID - Look up the DebugLocTuple index with the given
|
||||
/// source file, line, and column. If none currently exists, create a new
|
||||
/// DebugLocTuple, and insert it into the DebugIdMap.
|
||||
unsigned getOrCreateDebugLocID(GlobalVariable *CompileUnit,
|
||||
unsigned getOrCreateDebugLocID(MDNode *CompileUnit,
|
||||
unsigned Line, unsigned Col);
|
||||
|
||||
/// getDebugLocTuple - Get the DebugLocTuple for a given DebugLoc object.
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#include "llvm/Target/TargetRegisterInfo.h"
|
||||
#include "llvm/ADT/BitVector.h"
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include <vector>
|
||||
|
||||
namespace llvm {
|
||||
@@ -256,7 +255,7 @@ public:
|
||||
/// returns end().
|
||||
template<bool ReturnUses, bool ReturnDefs>
|
||||
class defusechain_iterator
|
||||
: public forward_iterator<MachineInstr, ptrdiff_t> {
|
||||
: public std::iterator<std::forward_iterator_tag, MachineInstr, ptrdiff_t> {
|
||||
MachineOperand *Op;
|
||||
explicit defusechain_iterator(MachineOperand *op) : Op(op) {
|
||||
// If the first node isn't one we're interested in, advance to one that
|
||||
@@ -269,8 +268,10 @@ public:
|
||||
}
|
||||
friend class MachineRegisterInfo;
|
||||
public:
|
||||
typedef forward_iterator<MachineInstr, ptrdiff_t>::reference reference;
|
||||
typedef forward_iterator<MachineInstr, ptrdiff_t>::pointer pointer;
|
||||
typedef std::iterator<std::forward_iterator_tag,
|
||||
MachineInstr, ptrdiff_t>::reference reference;
|
||||
typedef std::iterator<std::forward_iterator_tag,
|
||||
MachineInstr, ptrdiff_t>::pointer pointer;
|
||||
|
||||
defusechain_iterator(const defusechain_iterator &I) : Op(I.Op) {}
|
||||
defusechain_iterator() : Op(0) {}
|
||||
|
||||
@@ -434,8 +434,8 @@ namespace llvm {
|
||||
|
||||
class ScheduleDAG {
|
||||
public:
|
||||
MachineBasicBlock *BB; // The block in which to insert instructions.
|
||||
MachineBasicBlock::iterator InsertPos;// The position to insert instructions.
|
||||
MachineBasicBlock *BB; // The block in which to insert instructions
|
||||
MachineBasicBlock::iterator InsertPos;// The position to insert instructions
|
||||
const TargetMachine &TM; // Target processor
|
||||
const TargetInstrInfo *TII; // Target instruction information
|
||||
const TargetRegisterInfo *TRI; // Target processor register info
|
||||
@@ -506,8 +506,8 @@ namespace llvm {
|
||||
///
|
||||
virtual void Schedule() = 0;
|
||||
|
||||
/// ForceUnitLatencies - Return true if all scheduling edges should be given a
|
||||
/// latency value of one. The default is to return false; schedulers may
|
||||
/// ForceUnitLatencies - Return true if all scheduling edges should be given
|
||||
/// a latency value of one. The default is to return false; schedulers may
|
||||
/// override this as needed.
|
||||
virtual bool ForceUnitLatencies() const { return false; }
|
||||
|
||||
@@ -535,7 +535,8 @@ namespace llvm {
|
||||
void EmitLiveInCopies(MachineBasicBlock *MBB);
|
||||
};
|
||||
|
||||
class SUnitIterator : public forward_iterator<SUnit, ptrdiff_t> {
|
||||
class SUnitIterator : public std::iterator<std::forward_iterator_tag,
|
||||
SUnit, ptrdiff_t> {
|
||||
SUnit *Node;
|
||||
unsigned Operand;
|
||||
|
||||
@@ -547,7 +548,7 @@ namespace llvm {
|
||||
bool operator!=(const SUnitIterator& x) const { return !operator==(x); }
|
||||
|
||||
const SUnitIterator &operator=(const SUnitIterator &I) {
|
||||
assert(I.Node == Node && "Cannot assign iterators to two different nodes!");
|
||||
assert(I.Node==Node && "Cannot assign iterators to two different nodes!");
|
||||
Operand = I.Operand;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class FunctionLoweringInfo;
|
||||
|
||||
template<> struct ilist_traits<SDNode> : public ilist_default_traits<SDNode> {
|
||||
private:
|
||||
mutable ilist_node<SDNode> Sentinel;
|
||||
mutable ilist_half_node<SDNode> Sentinel;
|
||||
public:
|
||||
SDNode *createSentinel() const {
|
||||
return static_cast<SDNode*>(&Sentinel);
|
||||
@@ -322,7 +322,7 @@ public:
|
||||
SDValue getValueType(EVT);
|
||||
SDValue getRegister(unsigned Reg, EVT VT);
|
||||
SDValue getDbgStopPoint(DebugLoc DL, SDValue Root,
|
||||
unsigned Line, unsigned Col, Value *CU);
|
||||
unsigned Line, unsigned Col, MDNode *CU);
|
||||
SDValue getLabel(unsigned Opcode, DebugLoc dl, SDValue Root,
|
||||
unsigned LabelID);
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/ADT/FoldingSet.h"
|
||||
#include "llvm/ADT/GraphTraits.h"
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include "llvm/ADT/ilist_node.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
@@ -292,7 +291,7 @@ namespace ISD {
|
||||
EXTRACT_SUBVECTOR,
|
||||
|
||||
/// VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as
|
||||
/// VEC1/VEC2. A VECTOR_SHUFFLE node also contains an array of constant int
|
||||
/// VEC1/VEC2. A VECTOR_SHUFFLE node also contains an array of constant int
|
||||
/// values that indicate which value (or undef) each result element will
|
||||
/// get. These constant ints are accessible through the
|
||||
/// ShuffleVectorSDNode class. This is quite similar to the Altivec
|
||||
@@ -1129,14 +1128,16 @@ public:
|
||||
/// use_iterator - This class provides iterator support for SDUse
|
||||
/// operands that use a specific SDNode.
|
||||
class use_iterator
|
||||
: public forward_iterator<SDUse, ptrdiff_t> {
|
||||
: public std::iterator<std::forward_iterator_tag, SDUse, ptrdiff_t> {
|
||||
SDUse *Op;
|
||||
explicit use_iterator(SDUse *op) : Op(op) {
|
||||
}
|
||||
friend class SDNode;
|
||||
public:
|
||||
typedef forward_iterator<SDUse, ptrdiff_t>::reference reference;
|
||||
typedef forward_iterator<SDUse, ptrdiff_t>::pointer pointer;
|
||||
typedef std::iterator<std::forward_iterator_tag,
|
||||
SDUse, ptrdiff_t>::reference reference;
|
||||
typedef std::iterator<std::forward_iterator_tag,
|
||||
SDUse, ptrdiff_t>::pointer pointer;
|
||||
|
||||
use_iterator(const use_iterator &I) : Op(I.Op) {}
|
||||
use_iterator() : Op(0) {}
|
||||
@@ -2015,10 +2016,10 @@ class DbgStopPointSDNode : public SDNode {
|
||||
SDUse Chain;
|
||||
unsigned Line;
|
||||
unsigned Column;
|
||||
Value *CU;
|
||||
MDNode *CU;
|
||||
friend class SelectionDAG;
|
||||
DbgStopPointSDNode(SDValue ch, unsigned l, unsigned c,
|
||||
Value *cu)
|
||||
MDNode *cu)
|
||||
: SDNode(ISD::DBG_STOPPOINT, DebugLoc::getUnknownLoc(),
|
||||
getSDVTList(MVT::Other)), Line(l), Column(c), CU(cu) {
|
||||
InitOperands(&Chain, ch);
|
||||
@@ -2026,7 +2027,7 @@ class DbgStopPointSDNode : public SDNode {
|
||||
public:
|
||||
unsigned getLine() const { return Line; }
|
||||
unsigned getColumn() const { return Column; }
|
||||
Value *getCompileUnit() const { return CU; }
|
||||
MDNode *getCompileUnit() const { return CU; }
|
||||
|
||||
static bool classof(const DbgStopPointSDNode *) { return true; }
|
||||
static bool classof(const SDNode *N) {
|
||||
@@ -2354,7 +2355,8 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class SDNodeIterator : public forward_iterator<SDNode, ptrdiff_t> {
|
||||
class SDNodeIterator : public std::iterator<std::forward_iterator_tag,
|
||||
SDNode, ptrdiff_t> {
|
||||
SDNode *Node;
|
||||
unsigned Operand;
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "llvm/ADT/GraphTraits.h"
|
||||
#include "llvm/ADT/IntrusiveRefCntPtr.h"
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/ADT/StringSet.h"
|
||||
@@ -242,7 +241,8 @@ namespace llvmc {
|
||||
|
||||
|
||||
/// NodeChildIterator - Another auxiliary class needed by GraphTraits.
|
||||
class NodeChildIterator : public bidirectional_iterator<Node, ptrdiff_t> {
|
||||
class NodeChildIterator : public
|
||||
std::iterator<std::bidirectional_iterator_tag, Node, ptrdiff_t> {
|
||||
typedef NodeChildIterator ThisType;
|
||||
typedef Node::container_type::iterator iterator;
|
||||
|
||||
|
||||
@@ -425,9 +425,6 @@
|
||||
/* Define to 1 if you have the <windows.h> header file. */
|
||||
#cmakedefine HAVE_WINDOWS_H ${HAVE_WINDOWS_H}
|
||||
|
||||
/* Define to 1 for ilist sentinel compaction */
|
||||
#cmakedefine LLVM_COMPACT_SENTINELS ${LLVM_COMPACT_SENTINELS}
|
||||
|
||||
/* Installation directory for binary executables */
|
||||
#undef LLVM_BINDIR
|
||||
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
/* Define if dlopen(0) will open the symbols of the program */
|
||||
#undef CAN_DLOPEN_SELF
|
||||
|
||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for `alloca.c' support on those systems.
|
||||
*/
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define to 1 if using `alloca.c'. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define if CBE is enabled for printf %a output */
|
||||
#undef ENABLE_CBE_PRINTF_A
|
||||
|
||||
@@ -12,6 +20,13 @@
|
||||
/* Define if threads enabled */
|
||||
#undef ENABLE_THREADS
|
||||
|
||||
/* Define to 1 if you have `alloca', as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
||||
*/
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define to 1 if you have the `argz_append' function. */
|
||||
#undef HAVE_ARGZ_APPEND
|
||||
|
||||
@@ -446,9 +461,6 @@
|
||||
/* Installation directory for binary executables */
|
||||
#undef LLVM_BINDIR
|
||||
|
||||
/* Define to 1 for ilist sentinel compaction */
|
||||
#undef LLVM_COMPACT_SENTINELS
|
||||
|
||||
/* Time at which LLVM was configured */
|
||||
#undef LLVM_CONFIGTIME
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ template<> struct ilist_traits<BasicBlock>
|
||||
|
||||
static ValueSymbolTable *getSymTab(Function *ItemParent);
|
||||
private:
|
||||
mutable ilist_node<BasicBlock> Sentinel;
|
||||
mutable ilist_half_node<BasicBlock> Sentinel;
|
||||
};
|
||||
|
||||
template<> struct ilist_traits<Argument>
|
||||
@@ -62,7 +62,7 @@ template<> struct ilist_traits<Argument>
|
||||
|
||||
static ValueSymbolTable *getSymTab(Function *ItemParent);
|
||||
private:
|
||||
mutable ilist_node<Argument> Sentinel;
|
||||
mutable ilist_half_node<Argument> Sentinel;
|
||||
};
|
||||
|
||||
class Function : public GlobalValue,
|
||||
|
||||
@@ -53,7 +53,7 @@ protected:
|
||||
virtual void setSuccessorV(unsigned idx, BasicBlock *B) = 0;
|
||||
public:
|
||||
|
||||
virtual Instruction *clone(LLVMContext &Context) const = 0;
|
||||
virtual TerminatorInst *clone(LLVMContext &Context) const = 0;
|
||||
|
||||
/// getNumSuccessors - Return the number of successors that this terminator
|
||||
/// has.
|
||||
@@ -90,7 +90,6 @@ public:
|
||||
|
||||
class UnaryInstruction : public Instruction {
|
||||
void *operator new(size_t, unsigned); // Do not implement
|
||||
UnaryInstruction(const UnaryInstruction&); // Do not implement
|
||||
|
||||
protected:
|
||||
UnaryInstruction(const Type *Ty, unsigned iType, Value *V,
|
||||
@@ -315,12 +314,6 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BinaryOperator, Value)
|
||||
/// if (isa<CastInst>(Instr)) { ... }
|
||||
/// @brief Base class of casting instructions.
|
||||
class CastInst : public UnaryInstruction {
|
||||
/// @brief Copy constructor
|
||||
CastInst(const CastInst &CI)
|
||||
: UnaryInstruction(CI.getType(), CI.getOpcode(), CI.getOperand(0)) {
|
||||
}
|
||||
/// @brief Do not allow default construction
|
||||
CastInst();
|
||||
protected:
|
||||
/// @brief Constructor with insert-before-instruction semantics for subclasses
|
||||
CastInst(const Type *Ty, unsigned iType, Value *S,
|
||||
@@ -613,7 +606,7 @@ public:
|
||||
/// instruction into a BasicBlock right before the specified instruction.
|
||||
/// The specified Instruction is allowed to be a dereferenced end iterator.
|
||||
/// @brief Create a CmpInst
|
||||
static CmpInst *Create(LLVMContext &Context, OtherOps Op,
|
||||
static CmpInst *Create(OtherOps Op,
|
||||
unsigned short predicate, Value *S1,
|
||||
Value *S2, const Twine &Name = "",
|
||||
Instruction *InsertBefore = 0);
|
||||
|
||||
@@ -54,6 +54,11 @@ public:
|
||||
/// extra information (e.g. load is volatile) agree.
|
||||
bool isIdenticalTo(const Instruction *I) const;
|
||||
|
||||
/// isIdenticalToWhenDefined - This is like isIdenticalTo, except that it
|
||||
/// ignores the SubclassOptionalData flags, which specify conditions
|
||||
/// under which the instruction's result is undefined.
|
||||
bool isIdenticalToWhenDefined(const Instruction *I) const;
|
||||
|
||||
/// This function determines if the specified instruction executes the same
|
||||
/// operation as the current one. This means that the opcodes, type, operand
|
||||
/// types and any other factors affecting the operation must be the same. This
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
unsigned getAlignment() const { return (1u << SubclassData) >> 1; }
|
||||
void setAlignment(unsigned Align);
|
||||
|
||||
virtual Instruction *clone(LLVMContext &Context) const = 0;
|
||||
virtual AllocationInst *clone(LLVMContext &Context) const = 0;
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const AllocationInst *) { return true; }
|
||||
@@ -99,7 +99,6 @@ public:
|
||||
/// MallocInst - an instruction to allocated memory on the heap
|
||||
///
|
||||
class MallocInst : public AllocationInst {
|
||||
MallocInst(const MallocInst &MI);
|
||||
public:
|
||||
explicit MallocInst(const Type *Ty, Value *ArraySize = 0,
|
||||
const Twine &NameStr = "",
|
||||
@@ -148,7 +147,6 @@ public:
|
||||
/// AllocaInst - an instruction to allocate memory on the stack
|
||||
///
|
||||
class AllocaInst : public AllocationInst {
|
||||
AllocaInst(const AllocaInst &);
|
||||
public:
|
||||
explicit AllocaInst(const Type *Ty,
|
||||
Value *ArraySize = 0,
|
||||
@@ -234,16 +232,6 @@ public:
|
||||
/// SubclassData field in Value to store whether or not the load is volatile.
|
||||
///
|
||||
class LoadInst : public UnaryInstruction {
|
||||
|
||||
LoadInst(const LoadInst &LI)
|
||||
: UnaryInstruction(LI.getType(), Load, LI.getOperand(0)) {
|
||||
setVolatile(LI.isVolatile());
|
||||
setAlignment(LI.getAlignment());
|
||||
|
||||
#ifndef NDEBUG
|
||||
AssertOK();
|
||||
#endif
|
||||
}
|
||||
void AssertOK();
|
||||
public:
|
||||
LoadInst(Value *Ptr, const Twine &NameStr, Instruction *InsertBefore);
|
||||
@@ -289,6 +277,11 @@ public:
|
||||
const Value *getPointerOperand() const { return getOperand(0); }
|
||||
static unsigned getPointerOperandIndex() { return 0U; }
|
||||
|
||||
unsigned getPointerAddressSpace() const {
|
||||
return cast<PointerType>(getPointerOperand()->getType())->getAddressSpace();
|
||||
}
|
||||
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const LoadInst *) { return true; }
|
||||
static inline bool classof(const Instruction *I) {
|
||||
@@ -308,18 +301,6 @@ public:
|
||||
///
|
||||
class StoreInst : public Instruction {
|
||||
void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
|
||||
|
||||
StoreInst(const StoreInst &SI) : Instruction(SI.getType(), Store,
|
||||
&Op<0>(), 2) {
|
||||
Op<0>() = SI.Op<0>();
|
||||
Op<1>() = SI.Op<1>();
|
||||
setVolatile(SI.isVolatile());
|
||||
setAlignment(SI.getAlignment());
|
||||
|
||||
#ifndef NDEBUG
|
||||
AssertOK();
|
||||
#endif
|
||||
}
|
||||
void AssertOK();
|
||||
public:
|
||||
// allocate space for exactly two operands
|
||||
@@ -365,6 +346,10 @@ public:
|
||||
const Value *getPointerOperand() const { return getOperand(1); }
|
||||
static unsigned getPointerOperandIndex() { return 1U; }
|
||||
|
||||
unsigned getPointerAddressSpace() const {
|
||||
return cast<PointerType>(getPointerOperand()->getType())->getAddressSpace();
|
||||
}
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const StoreInst *) { return true; }
|
||||
static inline bool classof(const Instruction *I) {
|
||||
@@ -585,6 +570,10 @@ public:
|
||||
static unsigned getPointerOperandIndex() {
|
||||
return 0U; // get index for modifying correct operand
|
||||
}
|
||||
|
||||
unsigned getPointerAddressSpace() const {
|
||||
return cast<PointerType>(getType())->getAddressSpace();
|
||||
}
|
||||
|
||||
/// getPointerOperandType - Method to return the pointer operand as a
|
||||
/// PointerType.
|
||||
@@ -720,7 +709,6 @@ public:
|
||||
|
||||
/// @brief Constructor with no-insertion semantics
|
||||
ICmpInst(
|
||||
LLVMContext &Context, ///< Context to construct within
|
||||
Predicate pred, ///< The predicate to use for the comparison
|
||||
Value *LHS, ///< The left-hand-side of the expression
|
||||
Value *RHS, ///< The right-hand-side of the expression
|
||||
@@ -891,7 +879,6 @@ public:
|
||||
|
||||
/// @brief Constructor with no-insertion semantics
|
||||
FCmpInst(
|
||||
LLVMContext &Context, ///< Context to build in
|
||||
Predicate pred, ///< The predicate to use for the comparison
|
||||
Value *LHS, ///< The left-hand-side of the expression
|
||||
Value *RHS, ///< The right-hand-side of the expression
|
||||
@@ -1196,10 +1183,6 @@ class SelectInst : public Instruction {
|
||||
Op<2>() = S2;
|
||||
}
|
||||
|
||||
SelectInst(const SelectInst &SI)
|
||||
: Instruction(SI.getType(), SI.getOpcode(), &Op<0>(), 3) {
|
||||
init(SI.Op<0>(), SI.Op<1>(), SI.Op<2>());
|
||||
}
|
||||
SelectInst(Value *C, Value *S1, Value *S2, const Twine &NameStr,
|
||||
Instruction *InsertBefore)
|
||||
: Instruction(S1->getType(), Instruction::Select,
|
||||
@@ -1267,8 +1250,6 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SelectInst, Value)
|
||||
/// an argument of the specified type given a va_list and increments that list
|
||||
///
|
||||
class VAArgInst : public UnaryInstruction {
|
||||
VAArgInst(const VAArgInst &VAA)
|
||||
: UnaryInstruction(VAA.getType(), VAArg, VAA.getOperand(0)) {}
|
||||
public:
|
||||
VAArgInst(Value *List, const Type *Ty, const Twine &NameStr = "",
|
||||
Instruction *InsertBefore = 0)
|
||||
@@ -1301,21 +1282,11 @@ public:
|
||||
/// element from a VectorType value
|
||||
///
|
||||
class ExtractElementInst : public Instruction {
|
||||
ExtractElementInst(const ExtractElementInst &EE) :
|
||||
Instruction(EE.getType(), ExtractElement, &Op<0>(), 2) {
|
||||
Op<0>() = EE.Op<0>();
|
||||
Op<1>() = EE.Op<1>();
|
||||
}
|
||||
|
||||
ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr = "",
|
||||
Instruction *InsertBefore = 0);
|
||||
ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr,
|
||||
BasicBlock *InsertAtEnd);
|
||||
public:
|
||||
static ExtractElementInst *Create(const ExtractElementInst &EE) {
|
||||
return new(EE.getNumOperands()) ExtractElementInst(EE);
|
||||
}
|
||||
|
||||
static ExtractElementInst *Create(Value *Vec, Value *Idx,
|
||||
const Twine &NameStr = "",
|
||||
Instruction *InsertBefore = 0) {
|
||||
@@ -1360,16 +1331,12 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractElementInst, Value)
|
||||
/// element into a VectorType value
|
||||
///
|
||||
class InsertElementInst : public Instruction {
|
||||
InsertElementInst(const InsertElementInst &IE);
|
||||
InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
|
||||
const Twine &NameStr = "",
|
||||
Instruction *InsertBefore = 0);
|
||||
InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
|
||||
const Twine &NameStr, BasicBlock *InsertAtEnd);
|
||||
public:
|
||||
static InsertElementInst *Create(const InsertElementInst &IE) {
|
||||
return new(IE.getNumOperands()) InsertElementInst(IE);
|
||||
}
|
||||
static InsertElementInst *Create(Value *Vec, Value *NewElt, Value *Idx,
|
||||
const Twine &NameStr = "",
|
||||
Instruction *InsertBefore = 0) {
|
||||
@@ -1421,7 +1388,6 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertElementInst, Value)
|
||||
/// input vectors.
|
||||
///
|
||||
class ShuffleVectorInst : public Instruction {
|
||||
ShuffleVectorInst(const ShuffleVectorInst &IE);
|
||||
public:
|
||||
// allocate space for exactly three operands
|
||||
void *operator new(size_t s) {
|
||||
@@ -2658,10 +2624,6 @@ private:
|
||||
|
||||
/// @brief This class represents a truncation of integer types.
|
||||
class TruncInst : public CastInst {
|
||||
/// Private copy constructor
|
||||
TruncInst(const TruncInst &CI)
|
||||
: CastInst(CI.getType(), Trunc, CI.getOperand(0)) {
|
||||
}
|
||||
public:
|
||||
/// @brief Constructor with insert-before-instruction semantics
|
||||
TruncInst(
|
||||
@@ -2680,7 +2642,7 @@ public:
|
||||
);
|
||||
|
||||
/// @brief Clone an identical TruncInst
|
||||
virtual CastInst *clone(LLVMContext &Context) const;
|
||||
virtual TruncInst *clone(LLVMContext &Context) const;
|
||||
|
||||
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const TruncInst *) { return true; }
|
||||
@@ -2698,10 +2660,6 @@ public:
|
||||
|
||||
/// @brief This class represents zero extension of integer types.
|
||||
class ZExtInst : public CastInst {
|
||||
/// @brief Private copy constructor
|
||||
ZExtInst(const ZExtInst &CI)
|
||||
: CastInst(CI.getType(), ZExt, CI.getOperand(0)) {
|
||||
}
|
||||
public:
|
||||
/// @brief Constructor with insert-before-instruction semantics
|
||||
ZExtInst(
|
||||
@@ -2720,7 +2678,7 @@ public:
|
||||
);
|
||||
|
||||
/// @brief Clone an identical ZExtInst
|
||||
virtual CastInst *clone(LLVMContext &Context) const;
|
||||
virtual ZExtInst *clone(LLVMContext &Context) const;
|
||||
|
||||
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const ZExtInst *) { return true; }
|
||||
@@ -2738,10 +2696,6 @@ public:
|
||||
|
||||
/// @brief This class represents a sign extension of integer types.
|
||||
class SExtInst : public CastInst {
|
||||
/// @brief Private copy constructor
|
||||
SExtInst(const SExtInst &CI)
|
||||
: CastInst(CI.getType(), SExt, CI.getOperand(0)) {
|
||||
}
|
||||
public:
|
||||
/// @brief Constructor with insert-before-instruction semantics
|
||||
SExtInst(
|
||||
@@ -2760,7 +2714,7 @@ public:
|
||||
);
|
||||
|
||||
/// @brief Clone an identical SExtInst
|
||||
virtual CastInst *clone(LLVMContext &Context) const;
|
||||
virtual SExtInst *clone(LLVMContext &Context) const;
|
||||
|
||||
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const SExtInst *) { return true; }
|
||||
@@ -2778,9 +2732,6 @@ public:
|
||||
|
||||
/// @brief This class represents a truncation of floating point types.
|
||||
class FPTruncInst : public CastInst {
|
||||
FPTruncInst(const FPTruncInst &CI)
|
||||
: CastInst(CI.getType(), FPTrunc, CI.getOperand(0)) {
|
||||
}
|
||||
public:
|
||||
/// @brief Constructor with insert-before-instruction semantics
|
||||
FPTruncInst(
|
||||
@@ -2799,7 +2750,7 @@ public:
|
||||
);
|
||||
|
||||
/// @brief Clone an identical FPTruncInst
|
||||
virtual CastInst *clone(LLVMContext &Context) const;
|
||||
virtual FPTruncInst *clone(LLVMContext &Context) const;
|
||||
|
||||
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const FPTruncInst *) { return true; }
|
||||
@@ -2817,9 +2768,6 @@ public:
|
||||
|
||||
/// @brief This class represents an extension of floating point types.
|
||||
class FPExtInst : public CastInst {
|
||||
FPExtInst(const FPExtInst &CI)
|
||||
: CastInst(CI.getType(), FPExt, CI.getOperand(0)) {
|
||||
}
|
||||
public:
|
||||
/// @brief Constructor with insert-before-instruction semantics
|
||||
FPExtInst(
|
||||
@@ -2838,7 +2786,7 @@ public:
|
||||
);
|
||||
|
||||
/// @brief Clone an identical FPExtInst
|
||||
virtual CastInst *clone(LLVMContext &Context) const;
|
||||
virtual FPExtInst *clone(LLVMContext &Context) const;
|
||||
|
||||
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const FPExtInst *) { return true; }
|
||||
@@ -2856,9 +2804,6 @@ public:
|
||||
|
||||
/// @brief This class represents a cast unsigned integer to floating point.
|
||||
class UIToFPInst : public CastInst {
|
||||
UIToFPInst(const UIToFPInst &CI)
|
||||
: CastInst(CI.getType(), UIToFP, CI.getOperand(0)) {
|
||||
}
|
||||
public:
|
||||
/// @brief Constructor with insert-before-instruction semantics
|
||||
UIToFPInst(
|
||||
@@ -2877,7 +2822,7 @@ public:
|
||||
);
|
||||
|
||||
/// @brief Clone an identical UIToFPInst
|
||||
virtual CastInst *clone(LLVMContext &Context) const;
|
||||
virtual UIToFPInst *clone(LLVMContext &Context) const;
|
||||
|
||||
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const UIToFPInst *) { return true; }
|
||||
@@ -2895,9 +2840,6 @@ public:
|
||||
|
||||
/// @brief This class represents a cast from signed integer to floating point.
|
||||
class SIToFPInst : public CastInst {
|
||||
SIToFPInst(const SIToFPInst &CI)
|
||||
: CastInst(CI.getType(), SIToFP, CI.getOperand(0)) {
|
||||
}
|
||||
public:
|
||||
/// @brief Constructor with insert-before-instruction semantics
|
||||
SIToFPInst(
|
||||
@@ -2916,7 +2858,7 @@ public:
|
||||
);
|
||||
|
||||
/// @brief Clone an identical SIToFPInst
|
||||
virtual CastInst *clone(LLVMContext &Context) const;
|
||||
virtual SIToFPInst *clone(LLVMContext &Context) const;
|
||||
|
||||
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const SIToFPInst *) { return true; }
|
||||
@@ -2934,9 +2876,6 @@ public:
|
||||
|
||||
/// @brief This class represents a cast from floating point to unsigned integer
|
||||
class FPToUIInst : public CastInst {
|
||||
FPToUIInst(const FPToUIInst &CI)
|
||||
: CastInst(CI.getType(), FPToUI, CI.getOperand(0)) {
|
||||
}
|
||||
public:
|
||||
/// @brief Constructor with insert-before-instruction semantics
|
||||
FPToUIInst(
|
||||
@@ -2955,7 +2894,7 @@ public:
|
||||
);
|
||||
|
||||
/// @brief Clone an identical FPToUIInst
|
||||
virtual CastInst *clone(LLVMContext &Context) const;
|
||||
virtual FPToUIInst *clone(LLVMContext &Context) const;
|
||||
|
||||
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const FPToUIInst *) { return true; }
|
||||
@@ -2973,9 +2912,6 @@ public:
|
||||
|
||||
/// @brief This class represents a cast from floating point to signed integer.
|
||||
class FPToSIInst : public CastInst {
|
||||
FPToSIInst(const FPToSIInst &CI)
|
||||
: CastInst(CI.getType(), FPToSI, CI.getOperand(0)) {
|
||||
}
|
||||
public:
|
||||
/// @brief Constructor with insert-before-instruction semantics
|
||||
FPToSIInst(
|
||||
@@ -2994,7 +2930,7 @@ public:
|
||||
);
|
||||
|
||||
/// @brief Clone an identical FPToSIInst
|
||||
virtual CastInst *clone(LLVMContext &Context) const;
|
||||
virtual FPToSIInst *clone(LLVMContext &Context) const;
|
||||
|
||||
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const FPToSIInst *) { return true; }
|
||||
@@ -3012,9 +2948,6 @@ public:
|
||||
|
||||
/// @brief This class represents a cast from an integer to a pointer.
|
||||
class IntToPtrInst : public CastInst {
|
||||
IntToPtrInst(const IntToPtrInst &CI)
|
||||
: CastInst(CI.getType(), IntToPtr, CI.getOperand(0)) {
|
||||
}
|
||||
public:
|
||||
/// @brief Constructor with insert-before-instruction semantics
|
||||
IntToPtrInst(
|
||||
@@ -3033,7 +2966,7 @@ public:
|
||||
);
|
||||
|
||||
/// @brief Clone an identical IntToPtrInst
|
||||
virtual CastInst *clone(LLVMContext &Context) const;
|
||||
virtual IntToPtrInst *clone(LLVMContext &Context) const;
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const IntToPtrInst *) { return true; }
|
||||
@@ -3051,9 +2984,6 @@ public:
|
||||
|
||||
/// @brief This class represents a cast from a pointer to an integer
|
||||
class PtrToIntInst : public CastInst {
|
||||
PtrToIntInst(const PtrToIntInst &CI)
|
||||
: CastInst(CI.getType(), PtrToInt, CI.getOperand(0)) {
|
||||
}
|
||||
public:
|
||||
/// @brief Constructor with insert-before-instruction semantics
|
||||
PtrToIntInst(
|
||||
@@ -3072,7 +3002,7 @@ public:
|
||||
);
|
||||
|
||||
/// @brief Clone an identical PtrToIntInst
|
||||
virtual CastInst *clone(LLVMContext &Context) const;
|
||||
virtual PtrToIntInst *clone(LLVMContext &Context) const;
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const PtrToIntInst *) { return true; }
|
||||
@@ -3090,9 +3020,6 @@ public:
|
||||
|
||||
/// @brief This class represents a no-op cast from one type to another.
|
||||
class BitCastInst : public CastInst {
|
||||
BitCastInst(const BitCastInst &CI)
|
||||
: CastInst(CI.getType(), BitCast, CI.getOperand(0)) {
|
||||
}
|
||||
public:
|
||||
/// @brief Constructor with insert-before-instruction semantics
|
||||
BitCastInst(
|
||||
@@ -3111,7 +3038,7 @@ public:
|
||||
);
|
||||
|
||||
/// @brief Clone an identical BitCastInst
|
||||
virtual CastInst *clone(LLVMContext &Context) const;
|
||||
virtual BitCastInst *clone(LLVMContext &Context) const;
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const BitCastInst *) { return true; }
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#define LLVM_INTRINSICINST_H
|
||||
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/Metadata.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/Instructions.h"
|
||||
#include "llvm/Intrinsics.h"
|
||||
@@ -85,8 +86,8 @@ namespace llvm {
|
||||
struct DbgStopPointInst : public DbgInfoIntrinsic {
|
||||
Value *getLineValue() const { return const_cast<Value*>(getOperand(1)); }
|
||||
Value *getColumnValue() const { return const_cast<Value*>(getOperand(2)); }
|
||||
Value *getContext() const {
|
||||
return StripCast(getOperand(3));
|
||||
MDNode *getContext() const {
|
||||
return cast<MDNode>(getOperand(3));
|
||||
}
|
||||
|
||||
unsigned getLine() const {
|
||||
@@ -112,7 +113,7 @@ namespace llvm {
|
||||
/// DbgFuncStartInst - This represents the llvm.dbg.func.start instruction.
|
||||
///
|
||||
struct DbgFuncStartInst : public DbgInfoIntrinsic {
|
||||
Value *getSubprogram() const { return StripCast(getOperand(1)); }
|
||||
MDNode *getSubprogram() const { return cast<MDNode>(getOperand(1)); }
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const DbgFuncStartInst *) { return true; }
|
||||
@@ -127,7 +128,7 @@ namespace llvm {
|
||||
/// DbgRegionStartInst - This represents the llvm.dbg.region.start
|
||||
/// instruction.
|
||||
struct DbgRegionStartInst : public DbgInfoIntrinsic {
|
||||
Value *getContext() const { return StripCast(getOperand(1)); }
|
||||
MDNode *getContext() const { return cast<MDNode>(getOperand(1)); }
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const DbgRegionStartInst *) { return true; }
|
||||
@@ -142,7 +143,7 @@ namespace llvm {
|
||||
/// DbgRegionEndInst - This represents the llvm.dbg.region.end instruction.
|
||||
///
|
||||
struct DbgRegionEndInst : public DbgInfoIntrinsic {
|
||||
Value *getContext() const { return StripCast(getOperand(1)); }
|
||||
MDNode *getContext() const { return cast<MDNode>(getOperand(1)); }
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const DbgRegionEndInst *) { return true; }
|
||||
@@ -158,7 +159,7 @@ namespace llvm {
|
||||
///
|
||||
struct DbgDeclareInst : public DbgInfoIntrinsic {
|
||||
Value *getAddress() const { return getOperand(1); }
|
||||
Value *getVariable() const { return StripCast(getOperand(2)); }
|
||||
MDNode *getVariable() const { return cast<MDNode>(getOperand(2)); }
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const DbgDeclareInst *) { return true; }
|
||||
|
||||
@@ -110,6 +110,7 @@ def llvm_ptrptr_ty : LLVMPointerType<llvm_ptr_ty>; // i8**
|
||||
def llvm_anyptr_ty : LLVMAnyPointerType<llvm_i8_ty>; // (space)i8*
|
||||
def llvm_empty_ty : LLVMType<OtherVT>; // { }
|
||||
def llvm_descriptor_ty : LLVMPointerType<llvm_empty_ty>; // { }*
|
||||
def llvm_metadata_ty : LLVMType<MetadataVT>; // !{...}
|
||||
|
||||
def llvm_v2i8_ty : LLVMType<v2i8>; // 2 x i8
|
||||
def llvm_v4i8_ty : LLVMType<v4i8>; // 4 x i8
|
||||
@@ -278,12 +279,12 @@ let Properties = [IntrNoMem] in {
|
||||
let Properties = [IntrNoMem] in {
|
||||
def int_dbg_stoppoint : Intrinsic<[llvm_void_ty],
|
||||
[llvm_i32_ty, llvm_i32_ty,
|
||||
llvm_descriptor_ty]>;
|
||||
def int_dbg_region_start : Intrinsic<[llvm_void_ty], [llvm_descriptor_ty]>;
|
||||
def int_dbg_region_end : Intrinsic<[llvm_void_ty], [llvm_descriptor_ty]>;
|
||||
def int_dbg_func_start : Intrinsic<[llvm_void_ty], [llvm_descriptor_ty]>;
|
||||
llvm_metadata_ty]>;
|
||||
def int_dbg_region_start : Intrinsic<[llvm_void_ty], [llvm_metadata_ty]>;
|
||||
def int_dbg_region_end : Intrinsic<[llvm_void_ty], [llvm_metadata_ty]>;
|
||||
def int_dbg_func_start : Intrinsic<[llvm_void_ty], [llvm_metadata_ty]>;
|
||||
def int_dbg_declare : Intrinsic<[llvm_void_ty],
|
||||
[llvm_descriptor_ty, llvm_descriptor_ty]>;
|
||||
[llvm_descriptor_ty, llvm_metadata_ty]>;
|
||||
}
|
||||
|
||||
//===------------------ Exception Handling Intrinsics----------------------===//
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace {
|
||||
(void) llvm::createStructRetPromotionPass();
|
||||
(void) llvm::createBasicAliasAnalysisPass();
|
||||
(void) llvm::createLibCallAliasAnalysisPass(0);
|
||||
(void) llvm::createScalarEvolutionAliasAnalysisPass();
|
||||
(void) llvm::createBlockPlacementPass();
|
||||
(void) llvm::createBlockProfilerPass();
|
||||
(void) llvm::createBreakCriticalEdgesPass();
|
||||
|
||||
@@ -16,12 +16,9 @@
|
||||
#ifndef LLVM_TARGET_ASM_INFO_H
|
||||
#define LLVM_TARGET_ASM_INFO_H
|
||||
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include <cassert>
|
||||
|
||||
namespace llvm {
|
||||
template <typename T> class SmallVectorImpl;
|
||||
|
||||
/// MCAsmInfo - This class is intended to be used as a base class for asm
|
||||
/// properties and features specific to the target.
|
||||
namespace ExceptionHandling { enum ExceptionsType { None, Dwarf, SjLj }; }
|
||||
@@ -34,7 +31,7 @@ namespace llvm {
|
||||
|
||||
/// ZeroFillDirective - Directive for emitting a global to the ZeroFill
|
||||
/// section on this target. Null if this target doesn't support zerofill.
|
||||
const char *ZeroFillDirective; // Default is null.
|
||||
const char *ZeroFillDirective; // Default is null.
|
||||
|
||||
/// NonexecutableStackDirective - Directive for declaring to the
|
||||
/// linker and beyond that the emitted code does not require stack
|
||||
@@ -50,77 +47,77 @@ namespace llvm {
|
||||
/// .long x-y
|
||||
/// is relocated if the relative locations of x and y change at linktime.
|
||||
/// We want both these things in different places.
|
||||
bool NeedsSet; // Defaults to false.
|
||||
bool NeedsSet; // Defaults to false.
|
||||
|
||||
/// MaxInstLength - This is the maximum possible length of an instruction,
|
||||
/// which is needed to compute the size of an inline asm.
|
||||
unsigned MaxInstLength; // Defaults to 4.
|
||||
unsigned MaxInstLength; // Defaults to 4.
|
||||
|
||||
/// PCSymbol - The symbol used to represent the current PC. Used in PC
|
||||
/// relative expressions.
|
||||
const char *PCSymbol; // Defaults to "$".
|
||||
const char *PCSymbol; // Defaults to "$".
|
||||
|
||||
/// SeparatorChar - This character, if specified, is used to separate
|
||||
/// instructions from each other when on the same line. This is used to
|
||||
/// measure inline asm instructions.
|
||||
char SeparatorChar; // Defaults to ';'
|
||||
char SeparatorChar; // Defaults to ';'
|
||||
|
||||
/// CommentColumn - This indicates the comment num (zero-based) at
|
||||
/// which asm comments should be printed.
|
||||
unsigned CommentColumn; // Defaults to 60
|
||||
unsigned CommentColumn; // Defaults to 60
|
||||
|
||||
/// CommentString - This indicates the comment character used by the
|
||||
/// assembler.
|
||||
const char *CommentString; // Defaults to "#"
|
||||
const char *CommentString; // Defaults to "#"
|
||||
|
||||
/// GlobalPrefix - If this is set to a non-empty string, it is prepended
|
||||
/// onto all global symbols. This is often used for "_" or ".".
|
||||
const char *GlobalPrefix; // Defaults to ""
|
||||
const char *GlobalPrefix; // Defaults to ""
|
||||
|
||||
/// PrivateGlobalPrefix - This prefix is used for globals like constant
|
||||
/// pool entries that are completely private to the .s file and should not
|
||||
/// have names in the .o file. This is often "." or "L".
|
||||
const char *PrivateGlobalPrefix; // Defaults to "."
|
||||
const char *PrivateGlobalPrefix; // Defaults to "."
|
||||
|
||||
/// LinkerPrivateGlobalPrefix - This prefix is used for symbols that should
|
||||
/// be passed through the assembler but be removed by the linker. This
|
||||
/// is "l" on Darwin, currently used for some ObjC metadata.
|
||||
const char *LinkerPrivateGlobalPrefix; // Defaults to ""
|
||||
const char *LinkerPrivateGlobalPrefix; // Defaults to ""
|
||||
|
||||
/// JumpTableSpecialLabelPrefix - If not null, a extra (dead) label is
|
||||
/// emitted before jump tables with the specified prefix.
|
||||
const char *JumpTableSpecialLabelPrefix; // Default to null.
|
||||
const char *JumpTableSpecialLabelPrefix; // Default to null.
|
||||
|
||||
/// GlobalVarAddrPrefix/Suffix - If these are nonempty, these strings
|
||||
/// will enclose any GlobalVariable (that isn't a function)
|
||||
///
|
||||
const char *GlobalVarAddrPrefix; // Defaults to ""
|
||||
const char *GlobalVarAddrSuffix; // Defaults to ""
|
||||
const char *GlobalVarAddrPrefix; // Defaults to ""
|
||||
const char *GlobalVarAddrSuffix; // Defaults to ""
|
||||
|
||||
/// FunctionAddrPrefix/Suffix - If these are nonempty, these strings
|
||||
/// will enclose any GlobalVariable that points to a function.
|
||||
///
|
||||
const char *FunctionAddrPrefix; // Defaults to ""
|
||||
const char *FunctionAddrSuffix; // Defaults to ""
|
||||
const char *FunctionAddrPrefix; // Defaults to ""
|
||||
const char *FunctionAddrSuffix; // Defaults to ""
|
||||
|
||||
/// PersonalityPrefix/Suffix - If these are nonempty, these strings will
|
||||
/// enclose any personality function in the common frame section.
|
||||
///
|
||||
const char *PersonalityPrefix; // Defaults to ""
|
||||
const char *PersonalitySuffix; // Defaults to ""
|
||||
const char *PersonalityPrefix; // Defaults to ""
|
||||
const char *PersonalitySuffix; // Defaults to ""
|
||||
|
||||
/// NeedsIndirectEncoding - If set, we need to set the indirect encoding bit
|
||||
/// for EH in Dwarf.
|
||||
///
|
||||
bool NeedsIndirectEncoding; // Defaults to false
|
||||
bool NeedsIndirectEncoding; // Defaults to false
|
||||
|
||||
/// InlineAsmStart/End - If these are nonempty, they contain a directive to
|
||||
/// emit before and after an inline assembly statement.
|
||||
const char *InlineAsmStart; // Defaults to "#APP\n"
|
||||
const char *InlineAsmEnd; // Defaults to "#NO_APP\n"
|
||||
const char *InlineAsmStart; // Defaults to "#APP\n"
|
||||
const char *InlineAsmEnd; // Defaults to "#NO_APP\n"
|
||||
|
||||
/// AssemblerDialect - Which dialect of an assembler variant to use.
|
||||
unsigned AssemblerDialect; // Defaults to 0
|
||||
unsigned AssemblerDialect; // Defaults to 0
|
||||
|
||||
/// AllowQuotesInName - This is true if the assembler allows for complex
|
||||
/// symbol names to be surrounded in quotes. This defaults to false.
|
||||
@@ -132,25 +129,25 @@ namespace llvm {
|
||||
/// number of zero bytes emitted to the current section. Common cases are
|
||||
/// "\t.zero\t" and "\t.space\t". If this is set to null, the
|
||||
/// Data*bitsDirective's will be used to emit zero bytes.
|
||||
const char *ZeroDirective; // Defaults to "\t.zero\t"
|
||||
const char *ZeroDirectiveSuffix; // Defaults to ""
|
||||
const char *ZeroDirective; // Defaults to "\t.zero\t"
|
||||
const char *ZeroDirectiveSuffix; // Defaults to ""
|
||||
|
||||
/// AsciiDirective - This directive allows emission of an ascii string with
|
||||
/// the standard C escape characters embedded into it.
|
||||
const char *AsciiDirective; // Defaults to "\t.ascii\t"
|
||||
const char *AsciiDirective; // Defaults to "\t.ascii\t"
|
||||
|
||||
/// AscizDirective - If not null, this allows for special handling of
|
||||
/// zero terminated strings on this target. This is commonly supported as
|
||||
/// ".asciz". If a target doesn't support this, it can be set to null.
|
||||
const char *AscizDirective; // Defaults to "\t.asciz\t"
|
||||
const char *AscizDirective; // Defaults to "\t.asciz\t"
|
||||
|
||||
/// DataDirectives - These directives are used to output some unit of
|
||||
/// integer data to the current section. If a data directive is set to
|
||||
/// null, smaller data directives will be used to emit the large sizes.
|
||||
const char *Data8bitsDirective; // Defaults to "\t.byte\t"
|
||||
const char *Data16bitsDirective; // Defaults to "\t.short\t"
|
||||
const char *Data32bitsDirective; // Defaults to "\t.long\t"
|
||||
const char *Data64bitsDirective; // Defaults to "\t.quad\t"
|
||||
const char *Data8bitsDirective; // Defaults to "\t.byte\t"
|
||||
const char *Data16bitsDirective; // Defaults to "\t.short\t"
|
||||
const char *Data32bitsDirective; // Defaults to "\t.long\t"
|
||||
const char *Data64bitsDirective; // Defaults to "\t.quad\t"
|
||||
|
||||
/// getDataASDirective - Return the directive that should be used to emit
|
||||
/// data of the specified size to the specified numeric address space.
|
||||
@@ -162,151 +159,144 @@ namespace llvm {
|
||||
/// SunStyleELFSectionSwitchSyntax - This is true if this target uses "Sun
|
||||
/// Style" syntax for section switching ("#alloc,#write" etc) instead of the
|
||||
/// normal ELF syntax (,"a,w") in .section directives.
|
||||
bool SunStyleELFSectionSwitchSyntax; // Defaults to false.
|
||||
bool SunStyleELFSectionSwitchSyntax; // Defaults to false.
|
||||
|
||||
/// UsesELFSectionDirectiveForBSS - This is true if this target uses ELF
|
||||
/// '.section' directive before the '.bss' one. It's used for PPC/Linux
|
||||
/// which doesn't support the '.bss' directive only.
|
||||
bool UsesELFSectionDirectiveForBSS; // Defaults to false.
|
||||
bool UsesELFSectionDirectiveForBSS; // Defaults to false.
|
||||
|
||||
//===--- Alignment Information ----------------------------------------===//
|
||||
|
||||
/// AlignDirective - The directive used to emit round up to an alignment
|
||||
/// boundary.
|
||||
///
|
||||
const char *AlignDirective; // Defaults to "\t.align\t"
|
||||
const char *AlignDirective; // Defaults to "\t.align\t"
|
||||
|
||||
/// AlignmentIsInBytes - If this is true (the default) then the asmprinter
|
||||
/// emits ".align N" directives, where N is the number of bytes to align to.
|
||||
/// Otherwise, it emits ".align log2(N)", e.g. 3 to align to an 8 byte
|
||||
/// boundary.
|
||||
bool AlignmentIsInBytes; // Defaults to true
|
||||
bool AlignmentIsInBytes; // Defaults to true
|
||||
|
||||
/// TextAlignFillValue - If non-zero, this is used to fill the executable
|
||||
/// space created as the result of a alignment directive.
|
||||
unsigned TextAlignFillValue;
|
||||
unsigned TextAlignFillValue; // Defaults to 0
|
||||
|
||||
//===--- Section Switching Directives ---------------------------------===//
|
||||
|
||||
/// JumpTableDirective - if non-null, the directive to emit before jump
|
||||
/// table entries. FIXME: REMOVE THIS.
|
||||
const char *JumpTableDirective;
|
||||
const char *PICJumpTableDirective;
|
||||
const char *JumpTableDirective; // Defaults to NULL.
|
||||
const char *PICJumpTableDirective; // Defaults to NULL.
|
||||
|
||||
|
||||
//===--- Global Variable Emission Directives --------------------------===//
|
||||
|
||||
/// GlobalDirective - This is the directive used to declare a global entity.
|
||||
///
|
||||
const char *GlobalDirective; // Defaults to NULL.
|
||||
const char *GlobalDirective; // Defaults to NULL.
|
||||
|
||||
/// ExternDirective - This is the directive used to declare external
|
||||
/// globals.
|
||||
///
|
||||
const char *ExternDirective; // Defaults to NULL.
|
||||
const char *ExternDirective; // Defaults to NULL.
|
||||
|
||||
/// SetDirective - This is the name of a directive that can be used to tell
|
||||
/// the assembler to set the value of a variable to some expression.
|
||||
const char *SetDirective; // Defaults to null.
|
||||
const char *SetDirective; // Defaults to null.
|
||||
|
||||
/// LCOMMDirective - This is the name of a directive (if supported) that can
|
||||
/// be used to efficiently declare a local (internal) block of zero
|
||||
/// initialized data in the .bss/.data section. The syntax expected is:
|
||||
/// @verbatim <LCOMMDirective> SYMBOLNAME LENGTHINBYTES, ALIGNMENT
|
||||
/// @endverbatim
|
||||
const char *LCOMMDirective; // Defaults to null.
|
||||
const char *LCOMMDirective; // Defaults to null.
|
||||
|
||||
const char *COMMDirective; // Defaults to "\t.comm\t".
|
||||
const char *COMMDirective; // Defaults to "\t.comm\t".
|
||||
|
||||
/// COMMDirectiveTakesAlignment - True if COMMDirective take a third
|
||||
/// argument that specifies the alignment of the declaration.
|
||||
bool COMMDirectiveTakesAlignment; // Defaults to true.
|
||||
bool COMMDirectiveTakesAlignment; // Defaults to true.
|
||||
|
||||
/// HasDotTypeDotSizeDirective - True if the target has .type and .size
|
||||
/// directives, this is true for most ELF targets.
|
||||
bool HasDotTypeDotSizeDirective; // Defaults to true.
|
||||
bool HasDotTypeDotSizeDirective; // Defaults to true.
|
||||
|
||||
/// HasSingleParameterDotFile - True if the target has a single parameter
|
||||
/// .file directive, this is true for ELF targets.
|
||||
bool HasSingleParameterDotFile; // Defaults to true.
|
||||
bool HasSingleParameterDotFile; // Defaults to true.
|
||||
|
||||
/// UsedDirective - This directive, if non-null, is used to declare a global
|
||||
/// as being used somehow that the assembler can't see. This prevents dead
|
||||
/// code elimination on some targets.
|
||||
const char *UsedDirective; // Defaults to null.
|
||||
const char *UsedDirective; // Defaults to NULL.
|
||||
|
||||
/// WeakRefDirective - This directive, if non-null, is used to declare a
|
||||
/// global as being a weak undefined symbol.
|
||||
const char *WeakRefDirective; // Defaults to null.
|
||||
const char *WeakRefDirective; // Defaults to NULL.
|
||||
|
||||
/// WeakDefDirective - This directive, if non-null, is used to declare a
|
||||
/// global as being a weak defined symbol.
|
||||
const char *WeakDefDirective; // Defaults to null.
|
||||
const char *WeakDefDirective; // Defaults to NULL.
|
||||
|
||||
/// HiddenDirective - This directive, if non-null, is used to declare a
|
||||
/// global or function as having hidden visibility.
|
||||
const char *HiddenDirective; // Defaults to "\t.hidden\t".
|
||||
const char *HiddenDirective; // Defaults to "\t.hidden\t".
|
||||
|
||||
/// ProtectedDirective - This directive, if non-null, is used to declare a
|
||||
/// global or function as having protected visibility.
|
||||
const char *ProtectedDirective; // Defaults to "\t.protected\t".
|
||||
const char *ProtectedDirective; // Defaults to "\t.protected\t".
|
||||
|
||||
//===--- Dwarf Emission Directives -----------------------------------===//
|
||||
|
||||
/// AbsoluteDebugSectionOffsets - True if we should emit abolute section
|
||||
/// offsets for debug information. Defaults to false.
|
||||
bool AbsoluteDebugSectionOffsets;
|
||||
/// offsets for debug information.
|
||||
bool AbsoluteDebugSectionOffsets; // Defaults to false.
|
||||
|
||||
/// AbsoluteEHSectionOffsets - True if we should emit abolute section
|
||||
/// offsets for EH information. Defaults to false.
|
||||
bool AbsoluteEHSectionOffsets;
|
||||
|
||||
/// HasLEB128 - True if target asm supports leb128 directives.
|
||||
///
|
||||
bool HasLEB128; // Defaults to false.
|
||||
bool HasLEB128; // Defaults to false.
|
||||
|
||||
/// hasDotLocAndDotFile - True if target asm supports .loc and .file
|
||||
/// directives for emitting debugging information.
|
||||
///
|
||||
bool HasDotLocAndDotFile; // Defaults to false.
|
||||
bool HasDotLocAndDotFile; // Defaults to false.
|
||||
|
||||
/// SupportsDebugInformation - True if target supports emission of debugging
|
||||
/// information.
|
||||
bool SupportsDebugInformation;
|
||||
bool SupportsDebugInformation; // Defaults to false.
|
||||
|
||||
/// SupportsExceptionHandling - True if target supports
|
||||
/// exception handling.
|
||||
///
|
||||
// Defaults to None
|
||||
ExceptionHandling::ExceptionsType ExceptionsType;
|
||||
/// SupportsExceptionHandling - True if target supports exception handling.
|
||||
ExceptionHandling::ExceptionsType ExceptionsType; // Defaults to None
|
||||
|
||||
/// RequiresFrameSection - true if the Dwarf2 output needs a frame section
|
||||
///
|
||||
bool DwarfRequiresFrameSection; // Defaults to true.
|
||||
bool DwarfRequiresFrameSection; // Defaults to true.
|
||||
|
||||
/// DwarfUsesInlineInfoSection - True if DwarfDebugInlineSection is used to
|
||||
/// encode inline subroutine information.
|
||||
bool DwarfUsesInlineInfoSection; // Defaults to false.
|
||||
bool DwarfUsesInlineInfoSection; // Defaults to false.
|
||||
|
||||
/// Is_EHSymbolPrivate - If set, the "_foo.eh" is made private so that it
|
||||
/// doesn't show up in the symbol table of the object file.
|
||||
bool Is_EHSymbolPrivate; // Defaults to true.
|
||||
bool Is_EHSymbolPrivate; // Defaults to true.
|
||||
|
||||
/// GlobalEHDirective - This is the directive used to make exception frame
|
||||
/// tables globally visible.
|
||||
///
|
||||
const char *GlobalEHDirective; // Defaults to NULL.
|
||||
const char *GlobalEHDirective; // Defaults to NULL.
|
||||
|
||||
/// SupportsWeakEmptyEHFrame - True if target assembler and linker will
|
||||
/// handle a weak_definition of constant 0 for an omitted EH frame.
|
||||
bool SupportsWeakOmittedEHFrame; // Defaults to true.
|
||||
bool SupportsWeakOmittedEHFrame; // Defaults to true.
|
||||
|
||||
/// DwarfSectionOffsetDirective - Special section offset directive.
|
||||
const char* DwarfSectionOffsetDirective; // Defaults to NULL
|
||||
|
||||
//===--- CBE Asm Translation Table -----------------------------------===//
|
||||
|
||||
const char *const *AsmTransCBE; // Defaults to empty
|
||||
const char *const *AsmTransCBE; // Defaults to empty
|
||||
|
||||
public:
|
||||
explicit MCAsmInfo();
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
namespace llvm {
|
||||
class MCAsmLexer;
|
||||
class MCContext;
|
||||
class MCExpr;
|
||||
class MCValue;
|
||||
class SMLoc;
|
||||
class Twine;
|
||||
@@ -31,6 +33,8 @@ public:
|
||||
|
||||
virtual MCAsmLexer &getLexer() = 0;
|
||||
|
||||
virtual MCContext &getContext() = 0;
|
||||
|
||||
/// Warning - Emit a warning at the location \arg L, with the message \arg
|
||||
/// Msg.
|
||||
virtual void Warning(SMLoc L, const Twine &Msg) = 0;
|
||||
@@ -42,6 +46,21 @@ public:
|
||||
/// clients.
|
||||
virtual bool Error(SMLoc L, const Twine &Msg) = 0;
|
||||
|
||||
/// ParseExpression - Parse an arbitrary expression.
|
||||
///
|
||||
/// @param Res - The value of the expression. The result is undefined
|
||||
/// on error.
|
||||
/// @result - False on success.
|
||||
virtual bool ParseExpression(const MCExpr *&Res) = 0;
|
||||
|
||||
/// ParseParenExpression - Parse an arbitrary expression, assuming that an
|
||||
/// initial '(' has already been consumed.
|
||||
///
|
||||
/// @param Res - The value of the expression. The result is undefined
|
||||
/// on error.
|
||||
/// @result - False on success.
|
||||
virtual bool ParseParenExpression(const MCExpr *&Res) = 0;
|
||||
|
||||
/// ParseAbsoluteExpression - Parse an expression which must evaluate to an
|
||||
/// absolute value.
|
||||
///
|
||||
@@ -49,24 +68,6 @@ public:
|
||||
/// on error.
|
||||
/// @result - False on success.
|
||||
virtual bool ParseAbsoluteExpression(int64_t &Res) = 0;
|
||||
|
||||
/// ParseRelocatableExpression - Parse an expression which must be
|
||||
/// relocatable.
|
||||
///
|
||||
/// @param Res - The relocatable expression value. The result is undefined on
|
||||
/// error.
|
||||
/// @result - False on success.
|
||||
virtual bool ParseRelocatableExpression(MCValue &Res) = 0;
|
||||
|
||||
/// ParseParenRelocatableExpression - Parse an expression which must be
|
||||
/// relocatable, assuming that an initial '(' has already been consumed.
|
||||
///
|
||||
/// @param Res - The relocatable expression value. The result is undefined on
|
||||
/// error.
|
||||
/// @result - False on success.
|
||||
///
|
||||
/// @see ParseRelocatableExpression, ParseParenExpr.
|
||||
virtual bool ParseParenRelocatableExpression(MCValue &Res) = 0;
|
||||
};
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
@@ -16,10 +16,12 @@
|
||||
#include "llvm/MC/MCValue.h"
|
||||
#include "llvm/Support/Casting.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include <vector> // FIXME: Shouldn't be needed.
|
||||
|
||||
namespace llvm {
|
||||
class raw_ostream;
|
||||
class MCAssembler;
|
||||
class MCContext;
|
||||
class MCSection;
|
||||
class MCSectionData;
|
||||
|
||||
@@ -32,12 +34,16 @@ public:
|
||||
FT_Data,
|
||||
FT_Align,
|
||||
FT_Fill,
|
||||
FT_Org
|
||||
FT_Org,
|
||||
FT_ZeroFill
|
||||
};
|
||||
|
||||
private:
|
||||
FragmentType Kind;
|
||||
|
||||
/// Parent - The data for the section this fragment is in.
|
||||
MCSectionData *Parent;
|
||||
|
||||
/// @name Assembler Backend Data
|
||||
/// @{
|
||||
//
|
||||
@@ -53,7 +59,7 @@ private:
|
||||
/// @}
|
||||
|
||||
protected:
|
||||
MCFragment(FragmentType _Kind, MCSectionData *SD = 0);
|
||||
MCFragment(FragmentType _Kind, MCSectionData *_Parent = 0);
|
||||
|
||||
public:
|
||||
// Only for sentinel.
|
||||
@@ -62,6 +68,9 @@ public:
|
||||
|
||||
FragmentType getKind() const { return Kind; }
|
||||
|
||||
MCSectionData *getParent() const { return Parent; }
|
||||
void setParent(MCSectionData *Value) { Parent = Value; }
|
||||
|
||||
// FIXME: This should be abstract, fix sentinel.
|
||||
virtual uint64_t getMaxFileSize() const {
|
||||
assert(0 && "Invalid getMaxFileSize call!");
|
||||
@@ -73,7 +82,9 @@ public:
|
||||
//
|
||||
// FIXME: This could all be kept private to the assembler implementation.
|
||||
|
||||
unsigned getFileSize() const {
|
||||
uint64_t getAddress() const;
|
||||
|
||||
uint64_t getFileSize() const {
|
||||
assert(FileSize != ~UINT64_C(0) && "File size not set!");
|
||||
return FileSize;
|
||||
}
|
||||
@@ -209,6 +220,7 @@ public:
|
||||
MCOrgFragment(MCValue _Offset, int8_t _Value, MCSectionData *SD = 0)
|
||||
: MCFragment(FT_Org, SD),
|
||||
Offset(_Offset), Value(_Value) {}
|
||||
|
||||
/// @name Accessors
|
||||
/// @{
|
||||
|
||||
@@ -229,6 +241,40 @@ public:
|
||||
static bool classof(const MCOrgFragment *) { return true; }
|
||||
};
|
||||
|
||||
/// MCZeroFillFragment - Represent data which has a fixed size and alignment,
|
||||
/// but requires no physical space in the object file.
|
||||
class MCZeroFillFragment : public MCFragment {
|
||||
/// Size - The size of this fragment.
|
||||
uint64_t Size;
|
||||
|
||||
/// Alignment - The alignment for this fragment.
|
||||
unsigned Alignment;
|
||||
|
||||
public:
|
||||
MCZeroFillFragment(uint64_t _Size, unsigned _Alignment, MCSectionData *SD = 0)
|
||||
: MCFragment(FT_ZeroFill, SD),
|
||||
Size(_Size), Alignment(_Alignment) {}
|
||||
|
||||
/// @name Accessors
|
||||
/// @{
|
||||
|
||||
uint64_t getMaxFileSize() const {
|
||||
// FIXME: This also doesn't make much sense, this method is misnamed.
|
||||
return ~UINT64_C(0);
|
||||
}
|
||||
|
||||
uint64_t getSize() const { return Size; }
|
||||
|
||||
unsigned getAlignment() const { return Alignment; }
|
||||
|
||||
/// @}
|
||||
|
||||
static bool classof(const MCFragment *F) {
|
||||
return F->getKind() == MCFragment::FT_ZeroFill;
|
||||
}
|
||||
static bool classof(const MCZeroFillFragment *) { return true; }
|
||||
};
|
||||
|
||||
// FIXME: Should this be a separate class, or just merged into MCSection? Since
|
||||
// we anticipate the fast path being through an MCAssembler, the only reason to
|
||||
// keep it out is for API abstraction.
|
||||
@@ -237,14 +283,48 @@ class MCSectionData : public ilist_node<MCSectionData> {
|
||||
void operator=(const MCSectionData&); // DO NOT IMPLEMENT
|
||||
|
||||
public:
|
||||
/// Fixup - Represent a fixed size region of bytes inside some fragment which
|
||||
/// needs to be rewritten. This region will either be rewritten by the
|
||||
/// assembler or cause a relocation entry to be generated.
|
||||
struct Fixup {
|
||||
/// Fragment - The fragment containing the fixup.
|
||||
MCFragment *Fragment;
|
||||
|
||||
/// Offset - The offset inside the fragment which needs to be rewritten.
|
||||
uint64_t Offset;
|
||||
|
||||
/// Value - The expression to eventually write into the fragment.
|
||||
//
|
||||
// FIXME: We could probably get away with requiring the client to pass in an
|
||||
// owned reference whose lifetime extends past that of the fixup.
|
||||
MCValue Value;
|
||||
|
||||
/// Size - The fixup size.
|
||||
unsigned Size;
|
||||
|
||||
/// FixedValue - The value to replace the fix up by.
|
||||
//
|
||||
// FIXME: This should not be here.
|
||||
uint64_t FixedValue;
|
||||
|
||||
public:
|
||||
Fixup(MCFragment &_Fragment, uint64_t _Offset, const MCValue &_Value,
|
||||
unsigned _Size)
|
||||
: Fragment(&_Fragment), Offset(_Offset), Value(_Value), Size(_Size),
|
||||
FixedValue(0) {}
|
||||
};
|
||||
|
||||
typedef iplist<MCFragment> FragmentListType;
|
||||
|
||||
typedef FragmentListType::const_iterator const_iterator;
|
||||
typedef FragmentListType::iterator iterator;
|
||||
|
||||
typedef std::vector<Fixup>::const_iterator const_fixup_iterator;
|
||||
typedef std::vector<Fixup>::iterator fixup_iterator;
|
||||
|
||||
private:
|
||||
iplist<MCFragment> Fragments;
|
||||
const MCSection &Section;
|
||||
const MCSection *Section;
|
||||
|
||||
/// Alignment - The maximum alignment seen in this section.
|
||||
unsigned Alignment;
|
||||
@@ -254,10 +334,23 @@ private:
|
||||
//
|
||||
// FIXME: This could all be kept private to the assembler implementation.
|
||||
|
||||
/// Address - The computed address of this section. This is ~0 until
|
||||
/// initialized.
|
||||
uint64_t Address;
|
||||
|
||||
/// Size - The content size of this section. This is ~0 until initialized.
|
||||
uint64_t Size;
|
||||
|
||||
/// FileSize - The size of this section in the object file. This is ~0 until
|
||||
/// initialized.
|
||||
uint64_t FileSize;
|
||||
|
||||
/// LastFixupLookup - Cache for the last looked up fixup.
|
||||
mutable unsigned LastFixupLookup;
|
||||
|
||||
/// Fixups - The list of fixups in this section.
|
||||
std::vector<Fixup> Fixups;
|
||||
|
||||
/// @}
|
||||
|
||||
public:
|
||||
@@ -265,12 +358,12 @@ public:
|
||||
MCSectionData();
|
||||
MCSectionData(const MCSection &Section, MCAssembler *A = 0);
|
||||
|
||||
const MCSection &getSection() const { return Section; }
|
||||
const MCSection &getSection() const { return *Section; }
|
||||
|
||||
unsigned getAlignment() const { return Alignment; }
|
||||
void setAlignment(unsigned Value) { Alignment = Value; }
|
||||
|
||||
/// @name Section List Access
|
||||
/// @name Fragment Access
|
||||
/// @{
|
||||
|
||||
const FragmentListType &getFragmentList() const { return Fragments; }
|
||||
@@ -286,17 +379,57 @@ public:
|
||||
|
||||
bool empty() const { return Fragments.empty(); }
|
||||
|
||||
/// @}
|
||||
/// @name Fixup Access
|
||||
/// @{
|
||||
|
||||
std::vector<Fixup> &getFixups() {
|
||||
return Fixups;
|
||||
}
|
||||
|
||||
fixup_iterator fixup_begin() {
|
||||
return Fixups.begin();
|
||||
}
|
||||
|
||||
fixup_iterator fixup_end() {
|
||||
return Fixups.end();
|
||||
}
|
||||
|
||||
size_t fixup_size() const { return Fixups.size(); }
|
||||
|
||||
/// @}
|
||||
/// @name Assembler Backend Support
|
||||
/// @{
|
||||
//
|
||||
// FIXME: This could all be kept private to the assembler implementation.
|
||||
|
||||
unsigned getFileSize() const {
|
||||
/// LookupFixup - Look up the fixup for the given \arg Fragment and \arg
|
||||
/// Offset.
|
||||
///
|
||||
/// If multiple fixups exist for the same fragment and offset it is undefined
|
||||
/// which one is returned.
|
||||
//
|
||||
// FIXME: This isn't horribly slow in practice, but there are much nicer
|
||||
// solutions to applying the fixups.
|
||||
const Fixup *LookupFixup(const MCFragment *Fragment, uint64_t Offset) const;
|
||||
|
||||
uint64_t getAddress() const {
|
||||
assert(Address != ~UINT64_C(0) && "Address not set!");
|
||||
return Address;
|
||||
}
|
||||
void setAddress(uint64_t Value) { Address = Value; }
|
||||
|
||||
uint64_t getSize() const {
|
||||
assert(Size != ~UINT64_C(0) && "File size not set!");
|
||||
return Size;
|
||||
}
|
||||
void setSize(uint64_t Value) { Size = Value; }
|
||||
|
||||
uint64_t getFileSize() const {
|
||||
assert(FileSize != ~UINT64_C(0) && "File size not set!");
|
||||
return FileSize;
|
||||
}
|
||||
void setFileSize(uint64_t Value) { FileSize = Value; }
|
||||
void setFileSize(uint64_t Value) { FileSize = Value; }
|
||||
|
||||
/// @}
|
||||
};
|
||||
@@ -304,7 +437,7 @@ public:
|
||||
// FIXME: Same concerns as with SectionData.
|
||||
class MCSymbolData : public ilist_node<MCSymbolData> {
|
||||
public:
|
||||
MCSymbol &Symbol;
|
||||
const MCSymbol &Symbol;
|
||||
|
||||
/// Fragment - The fragment this symbol's value is relative to, if any.
|
||||
MCFragment *Fragment;
|
||||
@@ -320,20 +453,34 @@ public:
|
||||
/// IsPrivateExtern - True if this symbol is private extern.
|
||||
unsigned IsPrivateExtern : 1;
|
||||
|
||||
/// CommonSize - The size of the symbol, if it is 'common', or 0.
|
||||
//
|
||||
// FIXME: Pack this in with other fields? We could put it in offset, since a
|
||||
// common symbol can never get a definition.
|
||||
uint64_t CommonSize;
|
||||
|
||||
/// CommonAlign - The alignment of the symbol, if it is 'common'.
|
||||
//
|
||||
// FIXME: Pack this in with other fields?
|
||||
unsigned CommonAlign;
|
||||
|
||||
/// Flags - The Flags field is used by object file implementations to store
|
||||
/// additional per symbol information which is not easily classified.
|
||||
uint32_t Flags;
|
||||
|
||||
/// Index - Index field, for use by the object file implementation.
|
||||
uint64_t Index;
|
||||
|
||||
public:
|
||||
// Only for use as sentinel.
|
||||
MCSymbolData();
|
||||
MCSymbolData(MCSymbol &_Symbol, MCFragment *_Fragment, uint64_t _Offset,
|
||||
MCSymbolData(const MCSymbol &_Symbol, MCFragment *_Fragment, uint64_t _Offset,
|
||||
MCAssembler *A = 0);
|
||||
|
||||
/// @name Accessors
|
||||
/// @{
|
||||
|
||||
MCSymbol &getSymbol() const { return Symbol; }
|
||||
const MCSymbol &getSymbol() const { return Symbol; }
|
||||
|
||||
MCFragment *getFragment() const { return Fragment; }
|
||||
void setFragment(MCFragment *Value) { Fragment = Value; }
|
||||
@@ -350,16 +497,52 @@ public:
|
||||
|
||||
bool isPrivateExtern() const { return IsPrivateExtern; }
|
||||
void setPrivateExtern(bool Value) { IsPrivateExtern = Value; }
|
||||
|
||||
|
||||
/// isCommon - Is this a 'common' symbol.
|
||||
bool isCommon() const { return CommonSize != 0; }
|
||||
|
||||
/// setCommon - Mark this symbol as being 'common'.
|
||||
///
|
||||
/// \param Size - The size of the symbol.
|
||||
/// \param Align - The alignment of the symbol.
|
||||
void setCommon(uint64_t Size, unsigned Align) {
|
||||
CommonSize = Size;
|
||||
CommonAlign = Align;
|
||||
}
|
||||
|
||||
/// getCommonSize - Return the size of a 'common' symbol.
|
||||
uint64_t getCommonSize() const {
|
||||
assert(isCommon() && "Not a 'common' symbol!");
|
||||
return CommonSize;
|
||||
}
|
||||
|
||||
/// getCommonAlignment - Return the alignment of a 'common' symbol.
|
||||
unsigned getCommonAlignment() const {
|
||||
assert(isCommon() && "Not a 'common' symbol!");
|
||||
return CommonAlign;
|
||||
}
|
||||
|
||||
/// getFlags - Get the (implementation defined) symbol flags.
|
||||
uint32_t getFlags() const { return Flags; }
|
||||
|
||||
/// setFlags - Set the (implementation defined) symbol flags.
|
||||
void setFlags(uint32_t Value) { Flags = Value; }
|
||||
|
||||
/// getIndex - Get the (implementation defined) index.
|
||||
uint64_t getIndex() const { return Index; }
|
||||
|
||||
/// setIndex - Set the (implementation defined) index.
|
||||
void setIndex(uint64_t Value) { Index = Value; }
|
||||
|
||||
/// @}
|
||||
};
|
||||
|
||||
// FIXME: This really doesn't belong here. See comments below.
|
||||
struct IndirectSymbolData {
|
||||
MCSymbol *Symbol;
|
||||
MCSectionData *SectionData;
|
||||
};
|
||||
|
||||
class MCAssembler {
|
||||
public:
|
||||
typedef iplist<MCSectionData> SectionDataListType;
|
||||
@@ -371,16 +554,24 @@ public:
|
||||
typedef SymbolDataListType::const_iterator const_symbol_iterator;
|
||||
typedef SymbolDataListType::iterator symbol_iterator;
|
||||
|
||||
typedef std::vector<IndirectSymbolData>::iterator indirect_symbol_iterator;
|
||||
|
||||
private:
|
||||
MCAssembler(const MCAssembler&); // DO NOT IMPLEMENT
|
||||
void operator=(const MCAssembler&); // DO NOT IMPLEMENT
|
||||
|
||||
MCContext &Context;
|
||||
|
||||
raw_ostream &OS;
|
||||
|
||||
iplist<MCSectionData> Sections;
|
||||
|
||||
iplist<MCSymbolData> Symbols;
|
||||
|
||||
std::vector<IndirectSymbolData> IndirectSymbols;
|
||||
|
||||
unsigned SubsectionsViaSymbols : 1;
|
||||
|
||||
private:
|
||||
/// LayoutSection - Assign offsets and sizes to the fragments in the section
|
||||
/// \arg SD, and update the section size. The section file offset should
|
||||
@@ -396,12 +587,22 @@ public:
|
||||
// concrete and require clients to pass in a target like object. The other
|
||||
// option is to make this abstract, and have targets provide concrete
|
||||
// implementations as we do with AsmParser.
|
||||
MCAssembler(raw_ostream &OS);
|
||||
MCAssembler(MCContext &_Context, raw_ostream &OS);
|
||||
~MCAssembler();
|
||||
|
||||
MCContext &getContext() const { return Context; }
|
||||
|
||||
/// Finish - Do final processing and write the object to the output stream.
|
||||
void Finish();
|
||||
|
||||
// FIXME: This does not belong here.
|
||||
bool getSubsectionsViaSymbols() const {
|
||||
return SubsectionsViaSymbols;
|
||||
}
|
||||
void setSubsectionsViaSymbols(bool Value) {
|
||||
SubsectionsViaSymbols = Value;
|
||||
}
|
||||
|
||||
/// @name Section List Access
|
||||
/// @{
|
||||
|
||||
@@ -431,6 +632,27 @@ public:
|
||||
|
||||
size_t symbol_size() const { return Symbols.size(); }
|
||||
|
||||
/// @}
|
||||
/// @name Indirect Symbol List Access
|
||||
/// @{
|
||||
|
||||
// FIXME: This is a total hack, this should not be here. Once things are
|
||||
// factored so that the streamer has direct access to the .o writer, it can
|
||||
// disappear.
|
||||
std::vector<IndirectSymbolData> &getIndirectSymbols() {
|
||||
return IndirectSymbols;
|
||||
}
|
||||
|
||||
indirect_symbol_iterator indirect_symbol_begin() {
|
||||
return IndirectSymbols.begin();
|
||||
}
|
||||
|
||||
indirect_symbol_iterator indirect_symbol_end() {
|
||||
return IndirectSymbols.end();
|
||||
}
|
||||
|
||||
size_t indirect_symbol_size() const { return IndirectSymbols.size(); }
|
||||
|
||||
/// @}
|
||||
};
|
||||
|
||||
|
||||
34
libclamav/c++/llvm/include/llvm/MC/MCCodeEmitter.h
Normal file
34
libclamav/c++/llvm/include/llvm/MC/MCCodeEmitter.h
Normal file
@@ -0,0 +1,34 @@
|
||||
//===-- llvm/MC/MCCodeEmitter.h - Instruction Encoding ----------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_MC_MCCODEEMITTER_H
|
||||
#define LLVM_MC_MCCODEEMITTER_H
|
||||
|
||||
namespace llvm {
|
||||
class MCInst;
|
||||
class raw_ostream;
|
||||
|
||||
/// MCCodeEmitter - Generic instruction encoding interface.
|
||||
class MCCodeEmitter {
|
||||
MCCodeEmitter(const MCCodeEmitter &); // DO NOT IMPLEMENT
|
||||
void operator=(const MCCodeEmitter &); // DO NOT IMPLEMENT
|
||||
protected: // Can only create subclasses.
|
||||
MCCodeEmitter();
|
||||
|
||||
public:
|
||||
virtual ~MCCodeEmitter();
|
||||
|
||||
/// EncodeInstruction - Encode the given \arg Inst to bytes on the output
|
||||
/// stream \arg OS.
|
||||
virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS) const = 0;
|
||||
};
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
#endif
|
||||
@@ -36,7 +36,7 @@ namespace llvm {
|
||||
/// SymbolValues - Bindings of symbols to values.
|
||||
//
|
||||
// FIXME: Is there a good reason to not just put this in the MCSymbol?
|
||||
DenseMap<MCSymbol*, MCValue> SymbolValues;
|
||||
DenseMap<const MCSymbol*, MCValue> SymbolValues;
|
||||
|
||||
/// Allocator - Allocator object used for creating machine code objects.
|
||||
///
|
||||
@@ -46,7 +46,10 @@ namespace llvm {
|
||||
public:
|
||||
MCContext();
|
||||
~MCContext();
|
||||
|
||||
|
||||
/// @name Symbol Managment
|
||||
/// @{
|
||||
|
||||
/// CreateSymbol - Create a new symbol with the specified @param Name.
|
||||
///
|
||||
/// @param Name - The symbol name, which must be unique across all symbols.
|
||||
@@ -57,6 +60,8 @@ namespace llvm {
|
||||
/// reference and return it.
|
||||
///
|
||||
/// @param Name - The symbol name, which must be unique across all symbols.
|
||||
/// @param IsTemporary - Whether this symbol is an assembler temporary,
|
||||
/// which should not survive into the symbol table for the translation unit.
|
||||
MCSymbol *GetOrCreateSymbol(const StringRef &Name);
|
||||
|
||||
/// CreateTemporarySymbol - Create a new temporary symbol with the specified
|
||||
@@ -70,17 +75,21 @@ namespace llvm {
|
||||
/// LookupSymbol - Get the symbol for @param Name, or null.
|
||||
MCSymbol *LookupSymbol(const StringRef &Name) const;
|
||||
|
||||
/// ClearSymbolValue - Erase a value binding for @param Symbol, if one
|
||||
/// exists.
|
||||
void ClearSymbolValue(MCSymbol *Symbol);
|
||||
/// @}
|
||||
/// @name Symbol Value Table
|
||||
/// @{
|
||||
|
||||
/// SetSymbolValue - Set the value binding for @param Symbol to @param
|
||||
/// Value.
|
||||
void SetSymbolValue(MCSymbol *Symbol, const MCValue &Value);
|
||||
/// ClearSymbolValue - Erase a value binding for @arg Symbol, if one exists.
|
||||
void ClearSymbolValue(const MCSymbol *Symbol);
|
||||
|
||||
/// GetSymbolValue - Return the current value for @param Symbol, or null if
|
||||
/// SetSymbolValue - Set the value binding for @arg Symbol to @arg Value.
|
||||
void SetSymbolValue(const MCSymbol *Symbol, const MCValue &Value);
|
||||
|
||||
/// GetSymbolValue - Return the current value for @arg Symbol, or null if
|
||||
/// none exists.
|
||||
const MCValue *GetSymbolValue(MCSymbol *Symbol) const;
|
||||
const MCValue *GetSymbolValue(const MCSymbol *Symbol) const;
|
||||
|
||||
/// @}
|
||||
|
||||
void *Allocate(unsigned Size, unsigned Align = 8) {
|
||||
return Allocator.Allocate(Size, Align);
|
||||
|
||||
323
libclamav/c++/llvm/include/llvm/MC/MCExpr.h
Normal file
323
libclamav/c++/llvm/include/llvm/MC/MCExpr.h
Normal file
@@ -0,0 +1,323 @@
|
||||
//===- MCExpr.h - Assembly Level Expressions --------------------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_MC_MCEXPR_H
|
||||
#define LLVM_MC_MCEXPR_H
|
||||
|
||||
#include "llvm/Support/Casting.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
|
||||
namespace llvm {
|
||||
class MCContext;
|
||||
class MCSymbol;
|
||||
class MCValue;
|
||||
class raw_ostream;
|
||||
|
||||
/// MCExpr - Base class for the full range of assembler expressions which are
|
||||
/// needed for parsing.
|
||||
class MCExpr {
|
||||
public:
|
||||
enum ExprKind {
|
||||
Binary, ///< Binary expressions.
|
||||
Constant, ///< Constant expressions.
|
||||
SymbolRef, ///< References to labels and assigned expressions.
|
||||
Unary ///< Unary expressions.
|
||||
};
|
||||
|
||||
private:
|
||||
ExprKind Kind;
|
||||
|
||||
MCExpr(const MCExpr&); // DO NOT IMPLEMENT
|
||||
void operator=(const MCExpr&); // DO NOT IMPLEMENT
|
||||
|
||||
protected:
|
||||
MCExpr(ExprKind _Kind) : Kind(_Kind) {}
|
||||
|
||||
public:
|
||||
/// @name Accessors
|
||||
/// @{
|
||||
|
||||
ExprKind getKind() const { return Kind; }
|
||||
|
||||
/// @}
|
||||
/// @name Utility Methods
|
||||
/// @{
|
||||
|
||||
void print(raw_ostream &OS) const;
|
||||
void dump() const;
|
||||
|
||||
/// @}
|
||||
/// @name Expression Evaluation
|
||||
/// @{
|
||||
|
||||
/// EvaluateAsAbsolute - Try to evaluate the expression to an absolute value.
|
||||
///
|
||||
/// @param Res - The absolute value, if evaluation succeeds.
|
||||
/// @result - True on success.
|
||||
bool EvaluateAsAbsolute(MCContext &Ctx, int64_t &Res) const;
|
||||
|
||||
/// EvaluateAsRelocatable - Try to evaluate the expression to a relocatable
|
||||
/// value, i.e. an expression of the fixed form (a - b + constant).
|
||||
///
|
||||
/// @param Res - The relocatable value, if evaluation succeeds.
|
||||
/// @result - True on success.
|
||||
bool EvaluateAsRelocatable(MCContext &Ctx, MCValue &Res) const;
|
||||
|
||||
/// @}
|
||||
|
||||
static bool classof(const MCExpr *) { return true; }
|
||||
};
|
||||
|
||||
//// MCConstantExpr - Represent a constant integer expression.
|
||||
class MCConstantExpr : public MCExpr {
|
||||
int64_t Value;
|
||||
|
||||
MCConstantExpr(int64_t _Value)
|
||||
: MCExpr(MCExpr::Constant), Value(_Value) {}
|
||||
|
||||
public:
|
||||
/// @name Construction
|
||||
/// @{
|
||||
|
||||
static const MCConstantExpr *Create(int64_t Value, MCContext &Ctx);
|
||||
|
||||
/// @}
|
||||
/// @name Accessors
|
||||
/// @{
|
||||
|
||||
int64_t getValue() const { return Value; }
|
||||
|
||||
/// @}
|
||||
|
||||
static bool classof(const MCExpr *E) {
|
||||
return E->getKind() == MCExpr::Constant;
|
||||
}
|
||||
static bool classof(const MCConstantExpr *) { return true; }
|
||||
};
|
||||
|
||||
/// MCSymbolRefExpr - Represent a reference to a symbol from inside an
|
||||
/// expression.
|
||||
///
|
||||
/// A symbol reference in an expression may be a use of a label, a use of an
|
||||
/// assembler variable (defined constant), or constitute an implicit definition
|
||||
/// of the symbol as external.
|
||||
class MCSymbolRefExpr : public MCExpr {
|
||||
const MCSymbol *Symbol;
|
||||
|
||||
MCSymbolRefExpr(const MCSymbol *_Symbol)
|
||||
: MCExpr(MCExpr::SymbolRef), Symbol(_Symbol) {}
|
||||
|
||||
public:
|
||||
/// @name Construction
|
||||
/// @{
|
||||
|
||||
static const MCSymbolRefExpr *Create(const MCSymbol *Symbol, MCContext &Ctx);
|
||||
|
||||
/// @}
|
||||
/// @name Accessors
|
||||
/// @{
|
||||
|
||||
const MCSymbol &getSymbol() const { return *Symbol; }
|
||||
|
||||
/// @}
|
||||
|
||||
static bool classof(const MCExpr *E) {
|
||||
return E->getKind() == MCExpr::SymbolRef;
|
||||
}
|
||||
static bool classof(const MCSymbolRefExpr *) { return true; }
|
||||
};
|
||||
|
||||
/// MCUnaryExpr - Unary assembler expressions.
|
||||
class MCUnaryExpr : public MCExpr {
|
||||
public:
|
||||
enum Opcode {
|
||||
LNot, ///< Logical negation.
|
||||
Minus, ///< Unary minus.
|
||||
Not, ///< Bitwise negation.
|
||||
Plus ///< Unary plus.
|
||||
};
|
||||
|
||||
private:
|
||||
Opcode Op;
|
||||
const MCExpr *Expr;
|
||||
|
||||
MCUnaryExpr(Opcode _Op, const MCExpr *_Expr)
|
||||
: MCExpr(MCExpr::Unary), Op(_Op), Expr(_Expr) {}
|
||||
|
||||
public:
|
||||
/// @name Construction
|
||||
/// @{
|
||||
|
||||
static const MCUnaryExpr *Create(Opcode Op, const MCExpr *Expr,
|
||||
MCContext &Ctx);
|
||||
static const MCUnaryExpr *CreateLNot(const MCExpr *Expr, MCContext &Ctx) {
|
||||
return Create(LNot, Expr, Ctx);
|
||||
}
|
||||
static const MCUnaryExpr *CreateMinus(const MCExpr *Expr, MCContext &Ctx) {
|
||||
return Create(Minus, Expr, Ctx);
|
||||
}
|
||||
static const MCUnaryExpr *CreateNot(const MCExpr *Expr, MCContext &Ctx) {
|
||||
return Create(Not, Expr, Ctx);
|
||||
}
|
||||
static const MCUnaryExpr *CreatePlus(const MCExpr *Expr, MCContext &Ctx) {
|
||||
return Create(Plus, Expr, Ctx);
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @name Accessors
|
||||
/// @{
|
||||
|
||||
/// getOpcode - Get the kind of this unary expression.
|
||||
Opcode getOpcode() const { return Op; }
|
||||
|
||||
/// getSubExpr - Get the child of this unary expression.
|
||||
const MCExpr *getSubExpr() const { return Expr; }
|
||||
|
||||
/// @}
|
||||
|
||||
static bool classof(const MCExpr *E) {
|
||||
return E->getKind() == MCExpr::Unary;
|
||||
}
|
||||
static bool classof(const MCUnaryExpr *) { return true; }
|
||||
};
|
||||
|
||||
/// MCBinaryExpr - Binary assembler expressions.
|
||||
class MCBinaryExpr : public MCExpr {
|
||||
public:
|
||||
enum Opcode {
|
||||
Add, ///< Addition.
|
||||
And, ///< Bitwise and.
|
||||
Div, ///< Division.
|
||||
EQ, ///< Equality comparison.
|
||||
GT, ///< Greater than comparison.
|
||||
GTE, ///< Greater than or equal comparison.
|
||||
LAnd, ///< Logical and.
|
||||
LOr, ///< Logical or.
|
||||
LT, ///< Less than comparison.
|
||||
LTE, ///< Less than or equal comparison.
|
||||
Mod, ///< Modulus.
|
||||
Mul, ///< Multiplication.
|
||||
NE, ///< Inequality comparison.
|
||||
Or, ///< Bitwise or.
|
||||
Shl, ///< Bitwise shift left.
|
||||
Shr, ///< Bitwise shift right.
|
||||
Sub, ///< Subtraction.
|
||||
Xor ///< Bitwise exclusive or.
|
||||
};
|
||||
|
||||
private:
|
||||
Opcode Op;
|
||||
const MCExpr *LHS, *RHS;
|
||||
|
||||
MCBinaryExpr(Opcode _Op, const MCExpr *_LHS, const MCExpr *_RHS)
|
||||
: MCExpr(MCExpr::Binary), Op(_Op), LHS(_LHS), RHS(_RHS) {}
|
||||
|
||||
public:
|
||||
/// @name Construction
|
||||
/// @{
|
||||
|
||||
static const MCBinaryExpr *Create(Opcode Op, const MCExpr *LHS,
|
||||
const MCExpr *RHS, MCContext &Ctx);
|
||||
static const MCBinaryExpr *CreateAdd(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(Add, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateAnd(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(And, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateDiv(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(Div, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateEQ(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(EQ, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateGT(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(GT, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateGTE(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(GTE, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateLAnd(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(LAnd, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateLOr(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(LOr, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateLT(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(LT, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateLTE(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(LTE, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateMod(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(Mod, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateMul(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(Mul, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateNE(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(NE, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateOr(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(Or, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateShl(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(Shl, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateShr(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(Shr, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateSub(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(Sub, LHS, RHS, Ctx);
|
||||
}
|
||||
static const MCBinaryExpr *CreateXor(const MCExpr *LHS, const MCExpr *RHS,
|
||||
MCContext &Ctx) {
|
||||
return Create(Xor, LHS, RHS, Ctx);
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @name Accessors
|
||||
/// @{
|
||||
|
||||
/// getOpcode - Get the kind of this binary expression.
|
||||
Opcode getOpcode() const { return Op; }
|
||||
|
||||
/// getLHS - Get the left-hand side expression of the binary operator.
|
||||
const MCExpr *getLHS() const { return LHS; }
|
||||
|
||||
/// getRHS - Get the right-hand side expression of the binary operator.
|
||||
const MCExpr *getRHS() const { return RHS; }
|
||||
|
||||
/// @}
|
||||
|
||||
static bool classof(const MCExpr *E) {
|
||||
return E->getKind() == MCExpr::Binary;
|
||||
}
|
||||
static bool classof(const MCBinaryExpr *) { return true; }
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
#endif
|
||||
@@ -16,12 +16,13 @@
|
||||
#ifndef LLVM_MC_MCINST_H
|
||||
#define LLVM_MC_MCINST_H
|
||||
|
||||
#include "llvm/MC/MCValue.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include "llvm/Support/DebugLoc.h"
|
||||
|
||||
namespace llvm {
|
||||
class raw_ostream;
|
||||
class MCExpr;
|
||||
|
||||
/// MCOperand - Instances of this class represent operands of the MCInst class.
|
||||
/// This is a simple discriminated union.
|
||||
@@ -31,14 +32,14 @@ class MCOperand {
|
||||
kRegister, ///< Register operand.
|
||||
kImmediate, ///< Immediate operand.
|
||||
kMBBLabel, ///< Basic block label.
|
||||
kMCValue ///< Relocatable immediate operand.
|
||||
kExpr ///< Relocatable immediate operand.
|
||||
};
|
||||
unsigned char Kind;
|
||||
|
||||
union {
|
||||
unsigned RegVal;
|
||||
int64_t ImmVal;
|
||||
MCValue MCValueVal;
|
||||
const MCExpr *ExprVal;
|
||||
struct {
|
||||
unsigned FunctionNo;
|
||||
unsigned BlockNo;
|
||||
@@ -53,7 +54,7 @@ public:
|
||||
bool isReg() const { return Kind == kRegister; }
|
||||
bool isImm() const { return Kind == kImmediate; }
|
||||
bool isMBBLabel() const { return Kind == kMBBLabel; }
|
||||
bool isMCValue() const { return Kind == kMCValue; }
|
||||
bool isExpr() const { return Kind == kExpr; }
|
||||
|
||||
/// getReg - Returns the register number.
|
||||
unsigned getReg() const {
|
||||
@@ -77,21 +78,21 @@ public:
|
||||
}
|
||||
|
||||
unsigned getMBBLabelFunction() const {
|
||||
assert(isMBBLabel() && "Wrong accessor");
|
||||
assert(isMBBLabel() && "This is not a machine basic block");
|
||||
return MBBLabel.FunctionNo;
|
||||
}
|
||||
unsigned getMBBLabelBlock() const {
|
||||
assert(isMBBLabel() && "Wrong accessor");
|
||||
assert(isMBBLabel() && "This is not a machine basic block");
|
||||
return MBBLabel.BlockNo;
|
||||
}
|
||||
|
||||
const MCValue &getMCValue() const {
|
||||
assert(isMCValue() && "This is not an MCValue");
|
||||
return MCValueVal;
|
||||
const MCExpr *getExpr() const {
|
||||
assert(isExpr() && "This is not an expression");
|
||||
return ExprVal;
|
||||
}
|
||||
void setMCValue(const MCValue &Val) {
|
||||
assert(isMCValue() && "This is not an MCValue");
|
||||
MCValueVal = Val;
|
||||
void setExpr(const MCExpr *Val) {
|
||||
assert(isExpr() && "This is not an expression");
|
||||
ExprVal = Val;
|
||||
}
|
||||
|
||||
static MCOperand CreateReg(unsigned Reg) {
|
||||
@@ -113,12 +114,15 @@ public:
|
||||
Op.MBBLabel.BlockNo = MBB;
|
||||
return Op;
|
||||
}
|
||||
static MCOperand CreateMCValue(const MCValue &Val) {
|
||||
static MCOperand CreateExpr(const MCExpr *Val) {
|
||||
MCOperand Op;
|
||||
Op.Kind = kMCValue;
|
||||
Op.MCValueVal = Val;
|
||||
Op.Kind = kExpr;
|
||||
Op.ExprVal = Val;
|
||||
return Op;
|
||||
}
|
||||
|
||||
void print(raw_ostream &OS) const;
|
||||
void dump() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -142,6 +146,9 @@ public:
|
||||
void addOperand(const MCOperand &Op) {
|
||||
Operands.push_back(Op);
|
||||
}
|
||||
|
||||
void print(raw_ostream &OS) const;
|
||||
void dump() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -18,19 +18,20 @@
|
||||
|
||||
namespace llvm {
|
||||
class AsmPrinter;
|
||||
class MCAsmInfo;
|
||||
class MCCodeEmitter;
|
||||
class MCContext;
|
||||
class MCValue;
|
||||
class MCExpr;
|
||||
class MCInst;
|
||||
class MCSection;
|
||||
class MCSymbol;
|
||||
class StringRef;
|
||||
class raw_ostream;
|
||||
class MCAsmInfo;
|
||||
|
||||
/// MCStreamer - Streaming machine code generation interface. This interface
|
||||
/// is intended to provide a programatic interface that is very similar to the
|
||||
/// level that an assembler .s file provides. It has callbacks to emit bytes,
|
||||
/// "emit directives", etc. The implementation of this interface retains
|
||||
/// handle directives, etc. The implementation of this interface retains
|
||||
/// state to know what the current section is etc.
|
||||
///
|
||||
/// There are multiple implementations of this interface: one for writing out
|
||||
@@ -72,6 +73,7 @@ namespace llvm {
|
||||
/// CurSection - This is the current section code is being emitted to, it is
|
||||
/// kept up to date by SwitchSection.
|
||||
const MCSection *CurSection;
|
||||
|
||||
public:
|
||||
virtual ~MCStreamer();
|
||||
|
||||
@@ -79,17 +81,16 @@ namespace llvm {
|
||||
|
||||
/// @name Symbol & Section Management
|
||||
/// @{
|
||||
|
||||
/// getCurrentSection - Return the current seciton that the streamer is
|
||||
/// emitting code to.
|
||||
const MCSection *getCurrentSection() const { return CurSection; }
|
||||
|
||||
/// SwitchSection - Set the current section where code is being emitted to
|
||||
/// @param Section. This is required to update CurSection.
|
||||
///
|
||||
/// This corresponds to assembler directives like .section, .text, etc.
|
||||
virtual void SwitchSection(const MCSection *Section) = 0;
|
||||
|
||||
|
||||
/// getCurrentSection - Return the current seciton that the streamer is
|
||||
/// emitting code to.
|
||||
const MCSection *getCurrentSection() const { return CurSection; }
|
||||
|
||||
/// EmitLabel - Emit a label for @param Symbol into the current section.
|
||||
///
|
||||
@@ -99,9 +100,6 @@ namespace llvm {
|
||||
/// @param Symbol - The symbol to emit. A given symbol should only be
|
||||
/// emitted as a label once, and symbols emitted as a label should never be
|
||||
/// used in an assignment.
|
||||
//
|
||||
// FIXME: What to do about the current section? Should we get rid of the
|
||||
// symbol section in the constructor and initialize it here?
|
||||
virtual void EmitLabel(MCSymbol *Symbol) = 0;
|
||||
|
||||
/// EmitAssemblerFlag - Note in the output the specified @param Flag
|
||||
@@ -118,18 +116,9 @@ namespace llvm {
|
||||
///
|
||||
/// @param Symbol - The symbol being assigned to.
|
||||
/// @param Value - The value for the symbol.
|
||||
/// @param MakeAbsolute - If true, then the symbol should be given the
|
||||
/// absolute value of @param Value, even if @param Value would be
|
||||
/// relocatable expression. This corresponds to the ".set" directive.
|
||||
virtual void EmitAssignment(MCSymbol *Symbol, const MCValue &Value,
|
||||
bool MakeAbsolute = false) = 0;
|
||||
virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) = 0;
|
||||
|
||||
/// EmitSymbolAttribute - Add the given @param Attribute to @param Symbol.
|
||||
//
|
||||
// FIXME: This doesn't make much sense, could we just have attributes be on
|
||||
// the symbol and make the printer smart enough to add the right symbols?
|
||||
// This should work as long as the order of attributes in the file doesn't
|
||||
// matter.
|
||||
virtual void EmitSymbolAttribute(MCSymbol *Symbol,
|
||||
SymbolAttr Attribute) = 0;
|
||||
|
||||
@@ -139,38 +128,30 @@ namespace llvm {
|
||||
/// @param DescValue - The value to set into the n_desc field.
|
||||
virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) = 0;
|
||||
|
||||
/// EmitLocalSymbol - Emit a local symbol of @param Value to @param Symbol.
|
||||
///
|
||||
/// @param Symbol - The local symbol being created.
|
||||
/// @param Value - The value for the symbol.
|
||||
virtual void EmitLocalSymbol(MCSymbol *Symbol, const MCValue &Value) = 0;
|
||||
|
||||
/// EmitCommonSymbol - Emit a common or local common symbol of @param Size
|
||||
/// with the @param Pow2Alignment if non-zero.
|
||||
/// EmitCommonSymbol - Emit a common or local common symbol.
|
||||
///
|
||||
/// @param Symbol - The common symbol to emit.
|
||||
/// @param Size - The size of the common symbol.
|
||||
/// @param Pow2Alignment - The alignment of the common symbol if non-zero.
|
||||
/// @param IsLocal - If true, then the symbol is to be a local common
|
||||
/// @param ByteAlignment - The alignment of the symbol if
|
||||
/// non-zero. This must be a power of 2 on some targets.
|
||||
virtual void EmitCommonSymbol(MCSymbol *Symbol, unsigned Size,
|
||||
unsigned Pow2Alignment, bool IsLocal) = 0;
|
||||
unsigned ByteAlignment) = 0;
|
||||
|
||||
/// EmitZerofill - Emit a the zerofill section and possiblity a symbol, if
|
||||
/// @param Symbol is non-NULL, for @param Size and with the @param
|
||||
/// Pow2Alignment if non-zero.
|
||||
/// EmitZerofill - Emit a the zerofill section and an option symbol.
|
||||
///
|
||||
/// @param Section - The zerofill section to create and or to put the symbol
|
||||
/// @param Symbol - The zerofill symbol to emit, if non-NULL.
|
||||
/// @param Size - The size of the zerofill symbol.
|
||||
/// @param Pow2Alignment - The alignment of the zerofill symbol if non-zero.
|
||||
virtual void EmitZerofill(MCSection *Section, MCSymbol *Symbol = 0,
|
||||
unsigned Size = 0,unsigned Pow2Alignment = 0) = 0;
|
||||
/// @param ByteAlignment - The alignment of the zerofill symbol if
|
||||
/// non-zero. This must be a power of 2 on some targets.
|
||||
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
|
||||
unsigned Size = 0,unsigned ByteAlignment = 0) = 0;
|
||||
|
||||
/// @}
|
||||
/// @name Generating Data
|
||||
/// @{
|
||||
|
||||
/// EmitBytes - Emit the bytes in @param Data into the output.
|
||||
/// EmitBytes - Emit the bytes in \arg Data into the output.
|
||||
///
|
||||
/// This is used to implement assembler directives such as .byte, .ascii,
|
||||
/// etc.
|
||||
@@ -185,7 +166,7 @@ namespace llvm {
|
||||
/// @param Value - The value to emit.
|
||||
/// @param Size - The size of the integer (in bytes) to emit. This must
|
||||
/// match a native machine width.
|
||||
virtual void EmitValue(const MCValue &Value, unsigned Size) = 0;
|
||||
virtual void EmitValue(const MCExpr *Value, unsigned Size) = 0;
|
||||
|
||||
/// EmitValueToAlignment - Emit some number of copies of @param Value until
|
||||
/// the byte alignment @param ByteAlignment is reached.
|
||||
@@ -213,12 +194,10 @@ namespace llvm {
|
||||
///
|
||||
/// This is used to implement assembler directives such as .org.
|
||||
///
|
||||
/// @param Offset - The offset to reach.This may be an expression, but the
|
||||
/// @param Offset - The offset to reach. This may be an expression, but the
|
||||
/// expression must be associated with the current section.
|
||||
/// @param Value - The value to use when filling bytes.
|
||||
//
|
||||
// FIXME: How are we going to signal failures out of this?
|
||||
virtual void EmitValueToOffset(const MCValue &Offset,
|
||||
virtual void EmitValueToOffset(const MCExpr *Offset,
|
||||
unsigned char Value = 0) = 0;
|
||||
|
||||
/// @}
|
||||
@@ -241,7 +220,8 @@ namespace llvm {
|
||||
///
|
||||
/// \arg AP - If given, an AsmPrinter to use for printing instructions.
|
||||
MCStreamer *createAsmStreamer(MCContext &Ctx, raw_ostream &OS,
|
||||
const MCAsmInfo &MAI, AsmPrinter *AP = 0);
|
||||
const MCAsmInfo &MAI, AsmPrinter *AP = 0,
|
||||
MCCodeEmitter *CE = 0);
|
||||
|
||||
// FIXME: These two may end up getting rolled into a single
|
||||
// createObjectStreamer interface, which implements the assembler backend, and
|
||||
@@ -249,7 +229,8 @@ namespace llvm {
|
||||
|
||||
/// createMachOStream - Create a machine code streamer which will generative
|
||||
/// Mach-O format object files.
|
||||
MCStreamer *createMachOStreamer(MCContext &Ctx, raw_ostream &OS);
|
||||
MCStreamer *createMachOStreamer(MCContext &Ctx, raw_ostream &OS,
|
||||
MCCodeEmitter *CE = 0);
|
||||
|
||||
/// createELFStreamer - Create a machine code streamer which will generative
|
||||
/// ELF format object files.
|
||||
|
||||
@@ -63,9 +63,21 @@ namespace llvm {
|
||||
/// @name Symbol Type
|
||||
/// @{
|
||||
|
||||
/// isTemporary - Check if this is an assembler temporary symbol.
|
||||
bool isTemporary() const {
|
||||
return IsTemporary;
|
||||
}
|
||||
|
||||
/// isDefined - Check if this symbol is defined (i.e., it has an address).
|
||||
///
|
||||
/// Defined symbols are either absolute or in some section.
|
||||
bool isDefined() const {
|
||||
return Section != 0;
|
||||
}
|
||||
|
||||
/// isUndefined - Check if this symbol undefined (i.e., implicitly defined).
|
||||
bool isUndefined() const {
|
||||
return Section == 0;
|
||||
return !isDefined();
|
||||
}
|
||||
|
||||
/// isAbsolute - Check if this this is an absolute symbol.
|
||||
|
||||
@@ -33,13 +33,13 @@ class raw_ostream;
|
||||
/// Note that this class must remain a simple POD value class, because we need
|
||||
/// it to live in unions etc.
|
||||
class MCValue {
|
||||
MCSymbol *SymA, *SymB;
|
||||
const MCSymbol *SymA, *SymB;
|
||||
int64_t Cst;
|
||||
public:
|
||||
|
||||
int64_t getConstant() const { return Cst; }
|
||||
MCSymbol *getSymA() const { return SymA; }
|
||||
MCSymbol *getSymB() const { return SymB; }
|
||||
const MCSymbol *getSymA() const { return SymA; }
|
||||
const MCSymbol *getSymB() const { return SymB; }
|
||||
|
||||
/// isAbsolute - Is this an absolute (as opposed to relocatable) value.
|
||||
bool isAbsolute() const { return !SymA && !SymB; }
|
||||
@@ -60,7 +60,8 @@ public:
|
||||
/// dump - Print the value to stderr.
|
||||
void dump() const;
|
||||
|
||||
static MCValue get(MCSymbol *SymA, MCSymbol *SymB = 0, int64_t Val = 0) {
|
||||
static MCValue get(const MCSymbol *SymA, const MCSymbol *SymB = 0,
|
||||
int64_t Val = 0) {
|
||||
MCValue R;
|
||||
assert((!SymB || SymA) && "Invalid relocatable MCValue!");
|
||||
R.Cst = Val;
|
||||
|
||||
@@ -110,7 +110,6 @@ class MDNode : public MetadataBase {
|
||||
unsigned getNumOperands() { return User::getNumOperands(); }
|
||||
|
||||
SmallVector<WeakVH, 4> Node;
|
||||
|
||||
friend struct ConstantCreator<MDNode, Type, std::vector<Value*> >;
|
||||
protected:
|
||||
explicit MDNode(LLVMContext &C, Value*const* Vals, unsigned NumVals);
|
||||
|
||||
@@ -190,14 +190,11 @@ struct RegisterPass : public PassInfo {
|
||||
/// a nice name with the interface.
|
||||
///
|
||||
class RegisterAGBase : public PassInfo {
|
||||
PassInfo *InterfaceInfo;
|
||||
const PassInfo *ImplementationInfo;
|
||||
bool isDefaultImplementation;
|
||||
protected:
|
||||
explicit RegisterAGBase(const char *Name,
|
||||
intptr_t InterfaceID,
|
||||
intptr_t PassID = 0,
|
||||
bool isDefault = false);
|
||||
RegisterAGBase(const char *Name,
|
||||
intptr_t InterfaceID,
|
||||
intptr_t PassID = 0,
|
||||
bool isDefault = false);
|
||||
};
|
||||
|
||||
template<typename Interface, bool Default = false>
|
||||
|
||||
@@ -18,17 +18,17 @@
|
||||
#include "llvm/ADT/GraphTraits.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/InstrTypes.h"
|
||||
#include "llvm/ADT/iterator.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
//===----------------------------------------------------------------------===//
|
||||
// BasicBlock pred_iterator definition
|
||||
//===--------------------------------------------------------------------===//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
template <class _Ptr, class _USE_iterator> // Predecessor Iterator
|
||||
class PredIterator : public forward_iterator<_Ptr, ptrdiff_t> {
|
||||
typedef forward_iterator<_Ptr, ptrdiff_t> super;
|
||||
class PredIterator : public std::iterator<std::forward_iterator_tag,
|
||||
_Ptr, ptrdiff_t> {
|
||||
typedef std::iterator<std::forward_iterator_tag, _Ptr, ptrdiff_t> super;
|
||||
_USE_iterator It;
|
||||
public:
|
||||
typedef PredIterator<_Ptr,_USE_iterator> _Self;
|
||||
@@ -80,15 +80,16 @@ inline pred_const_iterator pred_end(const BasicBlock *BB) {
|
||||
|
||||
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
//===----------------------------------------------------------------------===//
|
||||
// BasicBlock succ_iterator definition
|
||||
//===--------------------------------------------------------------------===//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
template <class Term_, class BB_> // Successor Iterator
|
||||
class SuccIterator : public bidirectional_iterator<BB_, ptrdiff_t> {
|
||||
class SuccIterator : public std::iterator<std::bidirectional_iterator_tag,
|
||||
BB_, ptrdiff_t> {
|
||||
const Term_ Term;
|
||||
unsigned idx;
|
||||
typedef bidirectional_iterator<BB_, ptrdiff_t> super;
|
||||
typedef std::iterator<std::bidirectional_iterator_tag, BB_, ptrdiff_t> super;
|
||||
public:
|
||||
typedef SuccIterator<Term_, BB_> _Self;
|
||||
typedef typename super::pointer pointer;
|
||||
|
||||
@@ -19,19 +19,19 @@
|
||||
#include <vector>
|
||||
|
||||
namespace llvm {
|
||||
class GlobalVariable;
|
||||
class MDNode;
|
||||
|
||||
/// DebugLocTuple - Debug location tuple of filename id, line and column.
|
||||
///
|
||||
struct DebugLocTuple {
|
||||
GlobalVariable *CompileUnit;
|
||||
MDNode *CompileUnit;
|
||||
unsigned Line, Col;
|
||||
|
||||
DebugLocTuple()
|
||||
: CompileUnit(0), Line(~0U), Col(~0U) {};
|
||||
|
||||
DebugLocTuple(GlobalVariable *v, unsigned l, unsigned c)
|
||||
: CompileUnit(v), Line(l), Col(c) {};
|
||||
DebugLocTuple(MDNode *n, unsigned l, unsigned c)
|
||||
: CompileUnit(n), Line(l), Col(c) {};
|
||||
|
||||
bool operator==(const DebugLocTuple &DLT) const {
|
||||
return CompileUnit == DLT.CompileUnit &&
|
||||
@@ -69,10 +69,10 @@ namespace llvm {
|
||||
return DebugLocTuple(0, ~0U, ~0U);
|
||||
}
|
||||
static inline DebugLocTuple getTombstoneKey() {
|
||||
return DebugLocTuple((GlobalVariable*)~1U, ~1U, ~1U);
|
||||
return DebugLocTuple((MDNode*)~1U, ~1U, ~1U);
|
||||
}
|
||||
static unsigned getHashValue(const DebugLocTuple &Val) {
|
||||
return DenseMapInfo<GlobalVariable*>::getHashValue(Val.CompileUnit) ^
|
||||
return DenseMapInfo<MDNode*>::getHashValue(Val.CompileUnit) ^
|
||||
DenseMapInfo<unsigned>::getHashValue(Val.Line) ^
|
||||
DenseMapInfo<unsigned>::getHashValue(Val.Col);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,9 @@
|
||||
namespace llvm {
|
||||
template<typename ItTy = User::const_op_iterator>
|
||||
class generic_gep_type_iterator
|
||||
: public forward_iterator<const Type *, ptrdiff_t> {
|
||||
typedef forward_iterator<const Type*, ptrdiff_t> super;
|
||||
: public std::iterator<std::forward_iterator_tag, const Type *, ptrdiff_t> {
|
||||
typedef std::iterator<std::forward_iterator_tag,
|
||||
const Type *, ptrdiff_t> super;
|
||||
|
||||
ItTy OpIt;
|
||||
const Type *CurTy;
|
||||
|
||||
@@ -274,7 +274,7 @@ sys::Path WriteGraph(const GraphType &G, const std::string &Name,
|
||||
errs() << "Writing '" << Filename.str() << "'... ";
|
||||
|
||||
std::string ErrorInfo;
|
||||
raw_fd_ostream O(Filename.c_str(), ErrorInfo, raw_fd_ostream::F_Force);
|
||||
raw_fd_ostream O(Filename.c_str(), ErrorInfo);
|
||||
|
||||
if (ErrorInfo.empty()) {
|
||||
WriteGraph(O, G, ShortNames, Name, Title);
|
||||
|
||||
@@ -26,34 +26,53 @@
|
||||
|
||||
namespace llvm {
|
||||
|
||||
/// IRBuilderDefaultInserter - This provides the default implementation of the
|
||||
/// IRBuilder 'InsertHelper' method that is called whenever an instruction is
|
||||
/// created by IRBuilder and needs to be inserted. By default, this inserts the
|
||||
/// instruction at the insertion point.
|
||||
template <bool preserveNames = true>
|
||||
class IRBuilderDefaultInserter {
|
||||
protected:
|
||||
void InsertHelper(Instruction *I, const Twine &Name,
|
||||
BasicBlock *BB, BasicBlock::iterator InsertPt) const {
|
||||
if (BB) BB->getInstList().insert(InsertPt, I);
|
||||
if (preserveNames)
|
||||
I->setName(Name);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/// IRBuilder - This provides a uniform API for creating instructions and
|
||||
/// inserting them into a basic block: either at the end of a BasicBlock, or
|
||||
/// at a specific iterator location in a block.
|
||||
///
|
||||
/// Note that the builder does not expose the full generality of LLVM
|
||||
/// instructions. For example, it cannot be used to create instructions with
|
||||
/// arbitrary names (specifically, names with nul characters in them) - It only
|
||||
/// supports nul-terminated C strings. For fully generic names, use
|
||||
/// I->setName(). For access to extra instruction properties, use the mutators
|
||||
/// instructions. For access to extra instruction properties, use the mutators
|
||||
/// (e.g. setVolatile) on the instructions after they have been created.
|
||||
/// The first template argument handles whether or not to preserve names in the
|
||||
/// final instruction output. This defaults to on. The second template argument
|
||||
/// specifies a class to use for creating constants. This defaults to creating
|
||||
/// minimally folded constants.
|
||||
template <bool preserveNames=true, typename T = ConstantFolder> class IRBuilder{
|
||||
/// minimally folded constants. The fourth template argument allows clients to
|
||||
/// specify custom insertion hooks that are called on every newly created
|
||||
/// insertion.
|
||||
template<bool preserveNames = true, typename T = ConstantFolder,
|
||||
typename Inserter = IRBuilderDefaultInserter<preserveNames> >
|
||||
class IRBuilder : public Inserter {
|
||||
BasicBlock *BB;
|
||||
BasicBlock::iterator InsertPt;
|
||||
LLVMContext &Context;
|
||||
T Folder;
|
||||
public:
|
||||
IRBuilder(LLVMContext &C, const T& F) :
|
||||
Context(C), Folder(F) { ClearInsertionPoint(); }
|
||||
IRBuilder(LLVMContext &C, const T &F, const Inserter &I = Inserter())
|
||||
: Inserter(I), Context(C), Folder(F) {
|
||||
ClearInsertionPoint();
|
||||
}
|
||||
|
||||
explicit IRBuilder(LLVMContext &C) : Context(C), Folder(C) {
|
||||
ClearInsertionPoint();
|
||||
}
|
||||
|
||||
explicit IRBuilder(BasicBlock *TheBB, const T& F)
|
||||
explicit IRBuilder(BasicBlock *TheBB, const T &F)
|
||||
: Context(TheBB->getContext()), Folder(F) {
|
||||
SetInsertPoint(TheBB);
|
||||
}
|
||||
@@ -74,7 +93,7 @@ public:
|
||||
}
|
||||
|
||||
/// getFolder - Get the constant folder being used.
|
||||
const T& getFolder() { return Folder; }
|
||||
const T &getFolder() { return Folder; }
|
||||
|
||||
/// isNamePreserving - Return true if this builder is configured to actually
|
||||
/// add the requested names to IR created through it.
|
||||
@@ -111,19 +130,10 @@ public:
|
||||
/// Insert - Insert and return the specified instruction.
|
||||
template<typename InstTy>
|
||||
InstTy *Insert(InstTy *I, const Twine &Name = "") const {
|
||||
InsertHelper(I, Name);
|
||||
this->InsertHelper(I, Name, BB, InsertPt);
|
||||
return I;
|
||||
}
|
||||
|
||||
/// InsertHelper - Insert the specified instruction at the specified insertion
|
||||
/// point. This is split out of Insert so that it isn't duplicated for every
|
||||
/// template instantiation.
|
||||
void InsertHelper(Instruction *I, const Twine &Name) const {
|
||||
if (BB) BB->getInstList().insert(InsertPt, I);
|
||||
if (preserveNames)
|
||||
I->setName(Name);
|
||||
}
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
// Type creation methods
|
||||
//===--------------------------------------------------------------------===//
|
||||
@@ -406,8 +416,7 @@ public:
|
||||
LoadInst *CreateLoad(Value *Ptr, const Twine &Name = "") {
|
||||
return Insert(new LoadInst(Ptr), Name);
|
||||
}
|
||||
LoadInst *CreateLoad(Value *Ptr, bool isVolatile,
|
||||
const Twine &Name = "") {
|
||||
LoadInst *CreateLoad(Value *Ptr, bool isVolatile, const Twine &Name = "") {
|
||||
return Insert(new LoadInst(Ptr, 0, isVolatile), Name);
|
||||
}
|
||||
StoreInst *CreateStore(Value *Val, Value *Ptr, bool isVolatile = false) {
|
||||
@@ -744,14 +753,14 @@ public:
|
||||
if (Constant *LC = dyn_cast<Constant>(LHS))
|
||||
if (Constant *RC = dyn_cast<Constant>(RHS))
|
||||
return Folder.CreateICmp(P, LC, RC);
|
||||
return Insert(new ICmpInst(Context, P, LHS, RHS), Name);
|
||||
return Insert(new ICmpInst(P, LHS, RHS), Name);
|
||||
}
|
||||
Value *CreateFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS,
|
||||
const Twine &Name = "") {
|
||||
if (Constant *LC = dyn_cast<Constant>(LHS))
|
||||
if (Constant *RC = dyn_cast<Constant>(RHS))
|
||||
return Folder.CreateFCmp(P, LC, RC);
|
||||
return Insert(new FCmpInst(Context, P, LHS, RHS), Name);
|
||||
return Insert(new FCmpInst(P, LHS, RHS), Name);
|
||||
}
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
@@ -861,8 +870,7 @@ public:
|
||||
const Twine &Name = "") {
|
||||
if (Constant *AggC = dyn_cast<Constant>(Agg))
|
||||
if (Constant *ValC = dyn_cast<Constant>(Val))
|
||||
return Folder.CreateInsertValue(AggC, ValC,
|
||||
IdxBegin, IdxEnd - IdxBegin);
|
||||
return Folder.CreateInsertValue(AggC, ValC, IdxBegin, IdxEnd-IdxBegin);
|
||||
return Insert(InsertValueInst::Create(Agg, Val, IdxBegin, IdxEnd), Name);
|
||||
}
|
||||
|
||||
|
||||
@@ -435,6 +435,13 @@ inline uint64_t RoundUpToAlignment(uint64_t Value, uint64_t Align) {
|
||||
return ((Value + Align - 1) / Align) * Align;
|
||||
}
|
||||
|
||||
/// OffsetToAlignment - Return the offset to the next integer (mod 2**64) that
|
||||
/// is greater than or equal to \arg Value and is a multiple of \arg
|
||||
/// Align. Align must be non-zero.
|
||||
inline uint64_t OffsetToAlignment(uint64_t Value, uint64_t Align) {
|
||||
return RoundUpToAlignment(Value, Align) - Value;
|
||||
}
|
||||
|
||||
/// abs64 - absolute value of a 64-bit int. Not all environments support
|
||||
/// "abs" on whatever their name for the 64-bit int type is. The absolute
|
||||
/// value of the largest negative number is undefined, as with "abs".
|
||||
|
||||
64
libclamav/c++/llvm/include/llvm/Support/Regex.h
Normal file
64
libclamav/c++/llvm/include/llvm/Support/Regex.h
Normal file
@@ -0,0 +1,64 @@
|
||||
//===-- Regex.h - Regular Expression matcher implementation -*- C++ -*-----===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements a POSIX regular expression matcher.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
|
||||
struct llvm_regex;
|
||||
namespace llvm {
|
||||
class Regex {
|
||||
public:
|
||||
enum {
|
||||
/// Compile with support for subgroup matches, this is just to make
|
||||
/// constructs like Regex("...", 0) more readable as Regex("...", Sub).
|
||||
Sub=0,
|
||||
/// Compile for matching that ignores upper/lower case distinctions.
|
||||
IgnoreCase=1,
|
||||
/// Compile for matching that need only report success or failure,
|
||||
/// not what was matched.
|
||||
NoSub=2,
|
||||
/// Compile for newline-sensitive matching. With this flag '[^' bracket
|
||||
/// expressions and '.' never match newline. A ^ anchor matches the
|
||||
/// null string after any newline in the string in addition to its normal
|
||||
/// function, and the $ anchor matches the null string before any
|
||||
/// newline in the string in addition to its normal function.
|
||||
Newline=4
|
||||
};
|
||||
|
||||
/// Compiles the given POSIX Extended Regular Expression \arg Regex.
|
||||
/// This implementation supports regexes and matching strings with embedded
|
||||
/// NUL characters.
|
||||
Regex(const StringRef &Regex, unsigned Flags=NoSub);
|
||||
~Regex();
|
||||
|
||||
/// isValid - returns the error encountered during regex compilation, or
|
||||
/// matching, if any.
|
||||
bool isValid(std::string &Error);
|
||||
|
||||
/// matches - Match the regex against a given \arg String.
|
||||
///
|
||||
/// \param Matches - If given, on a succesful match this will be filled in
|
||||
/// with references to the matched group expressions (inside \arg String),
|
||||
/// the first group is always the entire pattern.
|
||||
/// By default the regex is compiled with NoSub, which disables support for
|
||||
/// Matches.
|
||||
/// For this feature to be enabled you must construct the regex using
|
||||
/// Regex("...", Regex::Sub) constructor.
|
||||
|
||||
bool match(const StringRef &String, SmallVectorImpl<StringRef> *Matches=0);
|
||||
private:
|
||||
struct llvm_regex *preg;
|
||||
int error;
|
||||
bool sub;
|
||||
};
|
||||
}
|
||||
@@ -328,18 +328,17 @@ class raw_fd_ostream : public raw_ostream {
|
||||
public:
|
||||
|
||||
enum {
|
||||
/// F_Force - When opening a file, this flag makes raw_fd_ostream overwrite
|
||||
/// a file if it already exists instead of emitting an error. This may not
|
||||
/// be specified with F_Append.
|
||||
F_Force = 1,
|
||||
/// F_Excl - When opening a file, this flag makes raw_fd_ostream
|
||||
/// report an error if the file already exists.
|
||||
F_Excl = 1,
|
||||
|
||||
/// F_Append - When opening a file, if it already exists append to the
|
||||
/// existing file instead of returning an error. This may not be specified
|
||||
/// with F_Force.
|
||||
/// with F_Excl.
|
||||
F_Append = 2,
|
||||
|
||||
/// F_Binary - The file should be opened in binary mode on platforms that
|
||||
/// support this distinction.
|
||||
/// make this distinction.
|
||||
F_Binary = 4
|
||||
};
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
namespace llvm {
|
||||
class AsmPrinter;
|
||||
class MCAsmParser;
|
||||
class MCCodeEmitter;
|
||||
class Module;
|
||||
class MCAsmInfo;
|
||||
class TargetAsmParser;
|
||||
@@ -57,6 +58,9 @@ namespace llvm {
|
||||
bool VerboseAsm);
|
||||
typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T,
|
||||
MCAsmParser &P);
|
||||
typedef MCCodeEmitter *(*CodeEmitterCtorTy)(const Target &T,
|
||||
TargetMachine &TM);
|
||||
|
||||
private:
|
||||
/// Next - The next registered target in the linked list, maintained by the
|
||||
/// TargetRegistry.
|
||||
@@ -89,7 +93,14 @@ namespace llvm {
|
||||
/// if registered.
|
||||
AsmParserCtorTy AsmParserCtorFn;
|
||||
|
||||
/// CodeEmitterCtorFn - Construction function for this target's CodeEmitter,
|
||||
/// if registered.
|
||||
CodeEmitterCtorTy CodeEmitterCtorFn;
|
||||
|
||||
public:
|
||||
/// @name Target Information
|
||||
/// @{
|
||||
|
||||
// getNext - Return the next registered target.
|
||||
const Target *getNext() const { return Next; }
|
||||
|
||||
@@ -99,6 +110,11 @@ namespace llvm {
|
||||
/// getShortDescription - Get a short description of the target.
|
||||
const char *getShortDescription() const { return ShortDesc; }
|
||||
|
||||
/// @}
|
||||
/// @name Feature Predicates
|
||||
/// @{
|
||||
|
||||
/// hasJIT - Check if this targets supports the just-in-time compilation.
|
||||
bool hasJIT() const { return HasJIT; }
|
||||
|
||||
/// hasTargetMachine - Check if this target supports code generation.
|
||||
@@ -110,6 +126,12 @@ namespace llvm {
|
||||
/// hasAsmParser - Check if this target supports .s parsing.
|
||||
bool hasAsmParser() const { return AsmParserCtorFn != 0; }
|
||||
|
||||
/// hasCodeEmitter - Check if this target supports instruction encoding.
|
||||
bool hasCodeEmitter() const { return CodeEmitterCtorFn != 0; }
|
||||
|
||||
/// @}
|
||||
/// @name Feature Constructors
|
||||
/// @{
|
||||
|
||||
/// createAsmInfo - Create a MCAsmInfo implementation for the specified
|
||||
/// target triple.
|
||||
@@ -155,6 +177,15 @@ namespace llvm {
|
||||
return 0;
|
||||
return AsmParserCtorFn(*this, Parser);
|
||||
}
|
||||
|
||||
/// createCodeEmitter - Create a target specific code emitter.
|
||||
MCCodeEmitter *createCodeEmitter(TargetMachine &TM) const {
|
||||
if (!CodeEmitterCtorFn)
|
||||
return 0;
|
||||
return CodeEmitterCtorFn(*this, TM);
|
||||
}
|
||||
|
||||
/// @}
|
||||
};
|
||||
|
||||
/// TargetRegistry - Generic interface to target specific features.
|
||||
@@ -303,6 +334,20 @@ namespace llvm {
|
||||
T.AsmParserCtorFn = Fn;
|
||||
}
|
||||
|
||||
/// RegisterCodeEmitter - Register a MCCodeEmitter implementation for the
|
||||
/// given target.
|
||||
///
|
||||
/// Clients are responsible for ensuring that registration doesn't occur
|
||||
/// while another thread is attempting to access the registry. Typically
|
||||
/// this is done by initializing all targets at program startup.
|
||||
///
|
||||
/// @param T - The target being registered.
|
||||
/// @param Fn - A function to construct an AsmPrinter for the target.
|
||||
static void RegisterCodeEmitter(Target &T, Target::CodeEmitterCtorTy Fn) {
|
||||
if (!T.CodeEmitterCtorFn)
|
||||
T.CodeEmitterCtorFn = Fn;
|
||||
}
|
||||
|
||||
/// @}
|
||||
};
|
||||
|
||||
@@ -431,6 +476,26 @@ namespace llvm {
|
||||
}
|
||||
};
|
||||
|
||||
/// RegisterCodeEmitter - Helper template for registering a target specific
|
||||
/// machine code emitter, for use in the target initialization
|
||||
/// function. Usage:
|
||||
///
|
||||
/// extern "C" void LLVMInitializeFooCodeEmitter() {
|
||||
/// extern Target TheFooTarget;
|
||||
/// RegisterCodeEmitter<FooCodeEmitter> X(TheFooTarget);
|
||||
/// }
|
||||
template<class CodeEmitterImpl>
|
||||
struct RegisterCodeEmitter {
|
||||
RegisterCodeEmitter(Target &T) {
|
||||
TargetRegistry::RegisterCodeEmitter(T, &Allocator);
|
||||
}
|
||||
|
||||
private:
|
||||
static MCCodeEmitter *Allocator(const Target &T, TargetMachine &TM) {
|
||||
return new CodeEmitterImpl(T, TM);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -14,16 +14,17 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef INLINER_H
|
||||
#define INLINER_H
|
||||
#ifndef LLVM_TRANSFORMS_IPO_INLINERPASS_H
|
||||
#define LLVM_TRANSFORMS_IPO_INLINERPASS_H
|
||||
|
||||
#include "llvm/CallGraphSCCPass.h"
|
||||
#include "llvm/Transforms/Utils/InlineCost.h"
|
||||
|
||||
|
||||
namespace llvm {
|
||||
class CallSite;
|
||||
class TargetData;
|
||||
class InlineCost;
|
||||
template<class PtrType, unsigned SmallSize>
|
||||
class SmallPtrSet;
|
||||
|
||||
/// Inliner - This class contains all of the helper code which is used to
|
||||
/// perform the inlining operations that do not depend on the policy.
|
||||
@@ -39,17 +40,12 @@ struct Inliner : public CallGraphSCCPass {
|
||||
|
||||
// Main run interface method, this implements the interface required by the
|
||||
// Pass class.
|
||||
virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC);
|
||||
virtual bool runOnSCC(std::vector<CallGraphNode *> &SCC);
|
||||
|
||||
// doFinalization - Remove now-dead linkonce functions at the end of
|
||||
// processing to avoid breaking the SCC traversal.
|
||||
virtual bool doFinalization(CallGraph &CG);
|
||||
|
||||
// InlineCallIfPossible
|
||||
bool InlineCallIfPossible(CallSite CS, CallGraph &CG,
|
||||
const SmallPtrSet<Function*, 8> &SCCFunctions,
|
||||
const TargetData *TD);
|
||||
|
||||
/// This method returns the value specified by the -inline-threshold value,
|
||||
/// specified on the command line. This is typically not directly needed.
|
||||
///
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#ifndef LLVM_TRANSFORMS_UTILS_CLONING_H
|
||||
#define LLVM_TRANSFORMS_UTILS_CLONING_H
|
||||
|
||||
#include <vector>
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
|
||||
namespace llvm {
|
||||
@@ -39,6 +38,8 @@ class TargetData;
|
||||
class Loop;
|
||||
class LoopInfo;
|
||||
class LLVMContext;
|
||||
class AllocaInst;
|
||||
template <typename T> class SmallVectorImpl;
|
||||
|
||||
/// CloneModule - Return an exact copy of the specified module
|
||||
///
|
||||
@@ -104,9 +105,9 @@ BasicBlock *CloneBasicBlock(const BasicBlock *BB,
|
||||
ClonedCodeInfo *CodeInfo = 0);
|
||||
|
||||
|
||||
/// CloneLoop - Clone Loop. Clone dominator info for loop insiders. Populate ValueMap
|
||||
/// using old blocks to new blocks mapping.
|
||||
Loop *CloneLoop(Loop *L, LPPassManager *LPM, LoopInfo *LI,
|
||||
/// CloneLoop - Clone Loop. Clone dominator info for loop insiders. Populate
|
||||
/// ValueMap using old blocks to new blocks mapping.
|
||||
Loop *CloneLoop(Loop *L, LPPassManager *LPM, LoopInfo *LI,
|
||||
DenseMap<const Value *, Value *> &ValueMap, Pass *P);
|
||||
|
||||
/// CloneFunction - Return a copy of the specified function, but without
|
||||
@@ -137,7 +138,7 @@ inline Function *CloneFunction(const Function *F, ClonedCodeInfo *CodeInfo = 0){
|
||||
///
|
||||
void CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
|
||||
DenseMap<const Value*, Value*> &ValueMap,
|
||||
std::vector<ReturnInst*> &Returns,
|
||||
SmallVectorImpl<ReturnInst*> &Returns,
|
||||
const char *NameSuffix = "",
|
||||
ClonedCodeInfo *CodeInfo = 0);
|
||||
|
||||
@@ -150,25 +151,11 @@ void CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
|
||||
/// used for things like CloneFunction or CloneModule.
|
||||
void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
|
||||
DenseMap<const Value*, Value*> &ValueMap,
|
||||
std::vector<ReturnInst*> &Returns,
|
||||
SmallVectorImpl<ReturnInst*> &Returns,
|
||||
const char *NameSuffix = "",
|
||||
ClonedCodeInfo *CodeInfo = 0,
|
||||
const TargetData *TD = 0);
|
||||
|
||||
|
||||
/// CloneTraceInto - Clone T into NewFunc. Original<->clone mapping is
|
||||
/// saved in ValueMap.
|
||||
///
|
||||
void CloneTraceInto(Function *NewFunc, Trace &T,
|
||||
DenseMap<const Value*, Value*> &ValueMap,
|
||||
const char *NameSuffix);
|
||||
|
||||
/// CloneTrace - Returns a copy of the specified trace.
|
||||
/// It takes a vector of basic blocks clones the basic blocks, removes internal
|
||||
/// phi nodes, adds it to the same function as the original (although there is
|
||||
/// no jump to it) and returns the new vector of basic blocks.
|
||||
std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace);
|
||||
|
||||
/// InlineFunction - This function inlines the called function into the basic
|
||||
/// block of the caller. This returns false if it is not possible to inline
|
||||
/// this call. The program is still in a well defined state if this occurs
|
||||
@@ -182,9 +169,15 @@ std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace);
|
||||
/// If a non-null callgraph pointer is provided, these functions update the
|
||||
/// CallGraph to represent the program after inlining.
|
||||
///
|
||||
bool InlineFunction(CallInst *C, CallGraph *CG = 0, const TargetData *TD = 0);
|
||||
bool InlineFunction(InvokeInst *II, CallGraph *CG = 0, const TargetData *TD =0);
|
||||
bool InlineFunction(CallSite CS, CallGraph *CG = 0, const TargetData *TD = 0);
|
||||
/// If StaticAllocas is non-null, InlineFunction populates it with all of the
|
||||
/// static allocas that it inlines into the caller.
|
||||
///
|
||||
bool InlineFunction(CallInst *C, CallGraph *CG = 0, const TargetData *TD = 0,
|
||||
SmallVectorImpl<AllocaInst*> *StaticAllocas = 0);
|
||||
bool InlineFunction(InvokeInst *II, CallGraph *CG = 0, const TargetData *TD = 0,
|
||||
SmallVectorImpl<AllocaInst*> *StaticAllocas = 0);
|
||||
bool InlineFunction(CallSite CS, CallGraph *CG = 0, const TargetData *TD = 0,
|
||||
SmallVectorImpl<AllocaInst*> *StaticAllocas = 0);
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user