summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/AsmWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a 4x slowdown in llc -asm-verbose caused by the use ofDan Gohman2009-08-131-18/+27
| | | | | | | | | | | | WriteAsOperand in more places. Now that more things are using WriteAsOperand, its behavior of constructing a TypePrinting object and populating it with strings for all the numbered types in the Module on each call is a significant bottleneck. Fancier solutions could be pursued here, but for now, just bypass the TypePrinting overhead in obvious cases. llvm-svn: 78906
* Change the indentation for LLVM Assembly files from 1 tab to 2 spaces.Dan Gohman2009-08-131-4/+4
| | | | | | | This is vaguely consistent with LLVM's own source code, but more importantly it lets more lines stay within 80 columns. llvm-svn: 78879
* Now that numbered types have their number printed, it's no longerDan Gohman2009-08-121-18/+12
| | | | | | | | | interesting to print the number in a comment. Numbered instructions don't need their number in a comment either. Also, tidy up newline printing. llvm-svn: 78865
* Extend the AsmWriter to print unnamed numbered types as "%0 = type ..."Dan Gohman2009-08-121-6/+4
| | | | | | | and unnamed numbered global variables as "@0 = global ...". Extend the AsmParser to recognize these forms. llvm-svn: 78859
* Make AsmWriter more careful with formatted_raw_ostream so thatDan Gohman2009-08-121-14/+22
| | | | | | | | | | | | it doesn't leave the underlying stream in unbuffered mode when the stream was originally buffered. Also, change WriteAsOperand back to plain raw_ostream. This lets it work for either formatted_raw_ostream or plain raw_ostream, so that it doesn't have to force a buffer flush on a plain raw_ostream. llvm-svn: 78837
* Make LLVM Assembly dramatically easier to read by aligning the comments,Dan Gohman2009-08-121-24/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | using formatted_raw_ostream's PadToColumn. Before: bb1: ; preds = %bb %2 = sext i32 %i.01 to i64 ; <i64> [#uses=1] %3 = getelementptr double* %p, i64 %2 ; <double*> [#uses=1] %4 = load double* %3, align 8 ; <double> [#uses=1] %5 = fmul double %4, 1.100000e+00 ; <double> [#uses=1] %6 = sext i32 %i.01 to i64 ; <i64> [#uses=1] %7 = getelementptr double* %p, i64 %6 ; <double*> [#uses=1] After: bb1: ; preds = %bb %2 = sext i32 %i.01 to i64 ; <i64> [#uses=1] %3 = getelementptr double* %p, i64 %2 ; <double*> [#uses=1] %4 = load double* %3, align 8 ; <double> [#uses=1] %5 = fmul double %4, 1.100000e+00 ; <double> [#uses=1] %6 = sext i32 %i.01 to i64 ; <i64> [#uses=1] %7 = getelementptr double* %p, i64 %6 ; <double*> [#uses=1] Several tests required whitespace adjustments. llvm-svn: 78816
* Fix printing of Alloca instructions with null operands.Dan Gohman2009-07-311-1/+1
| | | | llvm-svn: 77697
* Check null NameMDNode elements.Devang Patel2009-07-301-4/+8
| | | | llvm-svn: 77559
* print single NamedMDNode.Devang Patel2009-07-301-3/+45
| | | | llvm-svn: 77549
* Print named metadata.Devang Patel2009-07-291-0/+25
| | | | llvm-svn: 77513
* Rename MDNode.h header. It defines MDnode and other metadata classes.Devang Patel2009-07-281-1/+1
| | | | | | New name is Metadata.h. llvm-svn: 77370
* Add a new keyword 'inbounds' for use with getelementptr. See theDan Gohman2009-07-271-0/+3
| | | | | | LangRef.html changes for details. llvm-svn: 77259
* Initialize mdnNext.Devang Patel2009-07-271-1/+1
| | | | llvm-svn: 77229
* Change the assembly syntax for nsw, nuw, and exact, putting themDan Gohman2009-07-271-7/+7
| | | | | | | after their associated opcodes rather than before. This makes them a little easier to read. llvm-svn: 77194
* Remove Value::{isName, getNameRef}.Daniel Dunbar2009-07-251-24/+17
| | | | | | Also, change MDString to use a StringRef. llvm-svn: 77098
* Convert a few more things to use raw_ostream.Dan Gohman2009-07-251-2/+1
| | | | llvm-svn: 77039
* MDStringDevang Patel2009-07-231-2/+2
| | | | | | | - Rename member function size(). New name is length(). - Store string beginning and length. Earlier it used to store string end. llvm-svn: 76841
* Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into ↵Devang Patel2009-07-231-0/+5
| | | | | | METADATA_BLOCK in bitcode file. llvm-svn: 76834
* Rename the new unsigned and signed keywords to nuw and nsw,Dan Gohman2009-07-221-2/+2
| | | | | | which stand for no-unsigned-wrap and no-signed-wrap. llvm-svn: 76810
* Do not print "metadata" twice while printing MDString.Devang Patel2009-07-221-2/+0
| | | | | | This fixes unittest failure. llvm-svn: 76764
* Introduce MetadataBase, a base class for MDString and MDNode.Devang Patel2009-07-221-8/+17
| | | | | | | Derive MDString directly from MetadataBase. Introduce new bitcode block to hold metadata. llvm-svn: 76759
* Assembly and Bitcode support for unsigned/signed overflow flags andDan Gohman2009-07-201-0/+18
| | | | | | exact sdiv flags. llvm-svn: 76475
* Add plumbing for the `linker_private' linkage type. This type is meant forBill Wendling2009-07-201-12/+13
| | | | | | | | | "private" symbols which the assember shouldn't strip, but which the linker may remove after evaluation. This is mostly useful for Objective-C metadata. This is plumbing, so we don't have a use of it yet. More to come, etc. llvm-svn: 76385
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-6/+6
| | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
* Change printInstruction to not print a trailing newline. Value::dumpDan Gohman2009-07-131-2/+3
| | | | | | | always adds a newline, so this fixes Value::dump printing an extra blank line. llvm-svn: 75481
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-5/+5
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
* Drop "constant" from Devang Patel2009-07-081-1/+1
| | | | | | !0 = constant metadata !{...} llvm-svn: 75057
* Update SLotTracker to handle MDNode slots.Devang Patel2009-07-081-90/+134
| | | | | | Simplify MDNode printing. llvm-svn: 75053
* Implement changes from Chris's feedback.Torok Edwin2009-07-081-1/+2
| | | | | | Finish converting lib/Target. llvm-svn: 75043
* Start converting to new error handling API.Torok Edwin2009-07-081-2/+2
| | | | | | | cerr+abort -> llvm_report_error assert(0)+abort -> LLVM_UNREACHABLE (assert(0)+llvm_unreachable-> abort() included) llvm-svn: 75018
* Fix metadata unittestsDevang Patel2009-07-011-3/+15
| | | | llvm-svn: 74638
* Do not print stranded metadata.Devang Patel2009-07-011-1/+2
| | | | llvm-svn: 74632
* Support stand alone metadata syntax.Devang Patel2009-07-011-21/+69
| | | | | | | !0 = constant metadata !{i32 21, i32 22} @llvm.blah = constant metadata !{i32 1000, i16 200, metadata !0} llvm-svn: 74630
* Address review comments: add 3 ARM calling conventions.Anton Korobeynikov2009-06-161-2/+11
| | | | | | | Dispatch C calling conv. to one of these conventions based on target triple and subtarget features. llvm-svn: 73530
* Give embedded metadata its own type instead of relying on EmptyStructTy.Nick Lewycky2009-05-301-0/+1
| | | | llvm-svn: 72610
* Make MDNode use CallbackVH. Also change MDNode to store Value* instead ofNick Lewycky2009-05-101-4/+11
| | | | | | | Constant* in preperation of a future change to support holding non-Constants in an MDNode. llvm-svn: 71407
* Allow aliasee to be a GEP or bitcast instead of just a bitcast.Chris Lattner2009-04-251-6/+6
| | | | | | | | | | | The real fix for this whole mess is to require the operand of the alias to be a *GlobalValue* (not a general constant, including constant exprs) but allow the operand and the alias type to be unrelated. This fixes PR4066 llvm-svn: 70079
* Don't discard an AssemblyAnnotationWriter when writing GlobalValues,Dan Gohman2009-04-201-1/+1
| | | | | | | which include Functions, where it can be quite useful to use an AssemblyAnnotationWriter. llvm-svn: 69598
* Add a new "available_externally" linkage type. This is intendedChris Lattner2009-04-131-0/+3
| | | | | | | | to support C99 inline, GNU extern inline, etc. Related bugzilla's include PR3517, PR3100, & PR2933. Nothing uses this yet, but it appears to work. llvm-svn: 68940
* Remove bogus include.Nick Lewycky2009-04-041-1/+0
| | | | llvm-svn: 68421
* Add support for embedded metadata to LLVM. This introduces two new types ofNick Lewycky2009-04-041-2/+23
| | | | | | | | Constant, MDString and MDNode which can only be used by globals with a name that starts with "llvm." or as arguments to a function with the same naming restriction. llvm-svn: 68420
* Fix internal representation of fp80 to be theDale Johannesen2009-03-231-2/+22
| | | | | | | | | | same as a normal i80 {low64, high16} rather than its own {high64, low16}. A depressing number of places know about this; I think I got them all. Bitcode readers and writers convert back to the old form to avoid breaking compatibility. llvm-svn: 67562
* Now that errs() is properly non-buffered, there's no need toDan Gohman2009-03-231-3/+2
| | | | | | explicitly flush it. llvm-svn: 67526
* Fix a couple glaring whitespace issues. This file isn't internally consistentNick Lewycky2009-03-191-2/+2
| | | | | | either. llvm-svn: 67288
* Remove obviously redundant call.Nick Lewycky2009-03-151-1/+1
| | | | llvm-svn: 67023
* Revert r66920. It was causing failures in the self-hosting buildbot (in releaseBill Wendling2009-03-131-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mode). Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/dg.exp ... FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes > /dev/null 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 6 bugpoint 0x00000004 start + 18446744073709543220 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 6 bugpoint 0x00000006 start + 18446744073709543222 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes --- Reverse-merging (from foreign repository) r66920 into '.': U include/llvm/Support/CallSite.h U include/llvm/Instructions.h U lib/Analysis/IPA/GlobalsModRef.cpp U lib/Analysis/IPA/Andersens.cpp U lib/Bitcode/Writer/BitcodeWriter.cpp U lib/VMCore/Instructions.cpp U lib/VMCore/Verifier.cpp U lib/VMCore/AsmWriter.cpp U lib/Transforms/Utils/LowerInvoke.cpp U lib/Transforms/Scalar/SimplifyCFGPass.cpp U lib/Transforms/IPO/PruneEH.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp llvm-svn: 66953
* Second installment of "BasicBlock operands to the back"Gabor Greif2009-03-131-3/+4
| | | | | | | | | | | | | | | | | | changes. For InvokeInst now all arguments begin at op_begin(). The Callee, Cont and Fail are now faster to get by access relative to op_end(). This patch introduces some temporary uglyness in CallSite. Next I'll bring CallInst up to a similar scheme and then the uglyness will magically vanish. This patch also exposes all the reliance of the libraries on InvokeInst's operand ordering. I am thinking of taking care of that too. llvm-svn: 66920
* It makes no sense to have a ODR version of commonDuncan Sands2009-03-111-2/+1
| | | | | | linkage, so remove it. llvm-svn: 66690
* Remove the one-definition-rule version of extern_weakDuncan Sands2009-03-111-2/+1
| | | | | | | linkage: this linkage type only applies to declarations, but ODR is only relevant to globals with definitions. llvm-svn: 66650
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-071-10/+14
| | | | | | | | | | | | | | | | | | | | | and extern_weak_odr. These are the same as the non-odr versions, except that they indicate that the global will only be overridden by an *equivalent* global. In C, a function with weak linkage can be overridden by a function which behaves completely differently. This means that IP passes have to skip weak functions, since any deductions made from the function definition might be wrong, since the definition could be replaced by something completely different at link time. This is not allowed in C++, thanks to the ODR (One-Definition-Rule): if a function is replaced by another at link-time, then the new function must be the same as the original function. If a language knows that a function or other global can only be overridden by an equivalent global, it can give it the weak_odr linkage type, and the optimizers will understand that it is alright to make deductions based on the function body. The code generators on the other hand map weak and weak_odr linkage to the same thing. llvm-svn: 66339
OpenPOWER on IntegriCloud