oota-llvm.git
14 years agoMC/Mach-O: Initial x86_64 support.
Daniel Dunbar [Sat, 13 Mar 2010 22:10:17 +0000 (22:10 +0000)]
MC/Mach-O: Initial x86_64 support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98454 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomacho-dump: Basic Mach 64 support.
Daniel Dunbar [Sat, 13 Mar 2010 22:10:11 +0000 (22:10 +0000)]
macho-dump: Basic Mach 64 support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98453 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoeliminate the now-unneeded context argument of MBB::getSymbol()
Chris Lattner [Sat, 13 Mar 2010 21:04:28 +0000 (21:04 +0000)]
eliminate the now-unneeded context argument of MBB::getSymbol()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98451 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorearrange MCContext ownership. Before LLVMTargetMachine created it
Chris Lattner [Sat, 13 Mar 2010 20:55:24 +0000 (20:55 +0000)]
rearrange MCContext ownership.  Before LLVMTargetMachine created it
and passing off ownership to AsmPrinter.  Now MachineModuleInfo
creates it and owns it by value.  This allows us to use MCSymbols
more consistently throughout the rest of the code generator, and
simplifies a bit of code.  This also allows MachineFunction to
keep an MCContext reference handy, and cleans up the TargetRegistry
interfaces for AsmPrinters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98450 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake lit pay attention to --vg for unittests too.
Jeffrey Yasskin [Sat, 13 Mar 2010 20:45:41 +0000 (20:45 +0000)]
Make lit pay attention to --vg for unittests too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98449 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAllow types that have been forwarded to to be freed.
Jeffrey Yasskin [Sat, 13 Mar 2010 20:09:55 +0000 (20:09 +0000)]
Allow types that have been forwarded to to be freed.

Tested: make check-lit && valgrind --dsymutil=yes --leak-check=full unittests/ExecutionEngine/JIT/Debug/JITTests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98447 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach this test not to leak. Also, clean up all the cast<BinaryOperator> cruft.
Nick Lewycky [Sat, 13 Mar 2010 19:58:26 +0000 (19:58 +0000)]
Teach this test not to leak. Also, clean up all the cast<BinaryOperator> cruft.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98446 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agollvm-mc: Delete output files on error.
Daniel Dunbar [Sat, 13 Mar 2010 19:31:47 +0000 (19:31 +0000)]
llvm-mc: Delete output files on error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98445 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/X86_64: Fix matching of leaq.
Daniel Dunbar [Sat, 13 Mar 2010 19:31:44 +0000 (19:31 +0000)]
MC/X86_64: Fix matching of leaq.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98444 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/X86_64: Fix matching of callq.
Daniel Dunbar [Sat, 13 Mar 2010 19:31:38 +0000 (19:31 +0000)]
MC/X86_64: Fix matching of callq.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98443 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a hack to allow parsing negative minint. rdar://7751341
Chris Lattner [Sat, 13 Mar 2010 19:25:13 +0000 (19:25 +0000)]
add a hack to allow parsing negative minint. rdar://7751341

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98442 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd builder support for mcsymbol operands.
Chris Lattner [Sat, 13 Mar 2010 08:16:25 +0000 (08:16 +0000)]
add builder support for mcsymbol operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98434 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd support for MCSymbols as operands to MachineInstrs.
Chris Lattner [Sat, 13 Mar 2010 08:14:18 +0000 (08:14 +0000)]
add support for MCSymbols as operands to MachineInstrs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98433 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosimplify EmitFrameMoves to take BaseLabel in as a symbol
Chris Lattner [Sat, 13 Mar 2010 08:05:25 +0000 (08:05 +0000)]
simplify EmitFrameMoves to take BaseLabel in as a symbol
instead of as a stem+idx pair, simplify the "is a new
location" check to use symbol comparison.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98432 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosimplify some overly general code. The stack always grows down on x86.
Chris Lattner [Sat, 13 Mar 2010 08:04:35 +0000 (08:04 +0000)]
simplify some overly general code.  The stack always grows down on x86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98431 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix another warning. There is a functionality change but I believe it's correct.
Benjamin Kramer [Sat, 13 Mar 2010 07:50:22 +0000 (07:50 +0000)]
Fix another warning. There is a functionality change but I believe it's correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98430 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofactor some labels, simplify some code.
Chris Lattner [Sat, 13 Mar 2010 07:40:56 +0000 (07:40 +0000)]
factor some labels, simplify some code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98429 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd some parens and silence a warning.
Benjamin Kramer [Sat, 13 Mar 2010 07:40:34 +0000 (07:40 +0000)]
Add some parens and silence a warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98428 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAttempt to appease the arm-linux buildbot by fixing the JIT encodings for new
Bob Wilson [Sat, 13 Mar 2010 07:34:35 +0000 (07:34 +0000)]
Attempt to appease the arm-linux buildbot by fixing the JIT encodings for new
base register updating load/store-multiple instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98427 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agovarious cleanups.
Chris Lattner [Sat, 13 Mar 2010 07:26:18 +0000 (07:26 +0000)]
various cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98426 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/Mach-O: PCrel relocations weren't using the right base address, they are
Daniel Dunbar [Sat, 13 Mar 2010 02:38:00 +0000 (02:38 +0000)]
MC/Mach-O: PCrel relocations weren't using the right base address, they are
relative to the fragment address, not its offset. This was masked by the text
section normally being at address 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98420 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agollvm-mc: Support -n, useful for comparing -integrated-as output since the
Daniel Dunbar [Sat, 13 Mar 2010 02:20:57 +0000 (02:20 +0000)]
llvm-mc: Support -n, useful for comparing -integrated-as output since the
compiler may not lead with the text section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98418 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agollvm-mc: Support -arch as a simplified form of -triple.
Daniel Dunbar [Sat, 13 Mar 2010 02:20:38 +0000 (02:20 +0000)]
llvm-mc: Support -arch as a simplified form of -triple.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98417 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a typo in ValueTracking that's causing instcombine to delete needed shift instruc...
Evan Cheng [Sat, 13 Mar 2010 02:20:29 +0000 (02:20 +0000)]
Fix a typo in ValueTracking that's causing instcombine to delete needed shift instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98416 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoreimplement the string pool used for inlined function
Chris Lattner [Sat, 13 Mar 2010 02:17:42 +0000 (02:17 +0000)]
reimplement the string pool used for inlined function
entries to not thrash std::strings and MCSymbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98415 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove the last memory leak from the VMCore unit tests.
Jeffrey Yasskin [Sat, 13 Mar 2010 02:15:08 +0000 (02:15 +0000)]
Remove the last memory leak from the VMCore unit tests.

Tested: valgrind --leak-check=full unittests/VMCore/Debug/VMCoreTests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98414 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoswitch to the text section at the start of the .s file for darwin/x86
Chris Lattner [Sat, 13 Mar 2010 02:10:00 +0000 (02:10 +0000)]
switch to the text section at the start of the .s file for darwin/x86
targets.  This is a temporary hack for the .o file writer that Daniel
wants :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98413 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove a memory leak from MetadataTest.
Jeffrey Yasskin [Sat, 13 Mar 2010 01:39:20 +0000 (01:39 +0000)]
Remove a memory leak from MetadataTest.

Tested: valgrind --leak-check=full unittests/VMCore/Debug/VMCoreTests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98412 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove a memory leak from VerifierTest.
Jeffrey Yasskin [Sat, 13 Mar 2010 01:34:56 +0000 (01:34 +0000)]
Remove a memory leak from VerifierTest.

Tested: valgrind --leak-check=full unittests/VMCore/Debug/VMCoreTests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98411 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDelete MDNodes when LLVMContext is destroyed. Previous attempts: r97918, r97788.
Jeffrey Yasskin [Sat, 13 Mar 2010 01:26:15 +0000 (01:26 +0000)]
Delete MDNodes when LLVMContext is destroyed.  Previous attempts: r97918, r97788.

Tested: clang debug bootstrap, llvm-gcc bootstrap, `make check-lit`
after configuring with --with-llvmgccdir (and this did run the
FrontendC* tests this time)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98410 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange ARM ld/st multiple instructions to have variant instructions for
Bob Wilson [Sat, 13 Mar 2010 01:08:20 +0000 (01:08 +0000)]
Change ARM ld/st multiple instructions to have variant instructions for
writebacks to the address register.  This gets rid of the hack that the
first register on the list was the magic writeback register operand.  There
was an implicit constraint that if that operand was not reg0 it had to match
the base register operand.  The post-RA scheduler's antidependency breaker
did not understand that constraint and sometimes changed one without the
other.  This also fixes Radar 7495976 and should help the verifier work
better for ARM code.

There are now new ld/st instructions explicit writeback operands and explicit
constraints that tie those registers together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98409 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDo not ignore arg_size() impact while counting bb instructions.
Devang Patel [Sat, 13 Mar 2010 01:05:02 +0000 (01:05 +0000)]
Do not  ignore arg_size() impact while counting bb instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98408 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/X86: Add temporary hack to match shrl $1,%eax correctly, to support testing
Daniel Dunbar [Sat, 13 Mar 2010 00:47:29 +0000 (00:47 +0000)]
MC/X86: Add temporary hack to match shrl $1,%eax correctly, to support testing
other functionality on 403.gcc compiled at -O0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98405 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/X86: Add an XFAIL test where we aren't matching the correct instruction
Daniel Dunbar [Sat, 13 Mar 2010 00:47:25 +0000 (00:47 +0000)]
MC/X86: Add an XFAIL test where we aren't matching the correct instruction
because we don't understand how the specific instruction is doing sign
extension.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98404 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove extra parameter.
Devang Patel [Sat, 13 Mar 2010 00:45:31 +0000 (00:45 +0000)]
Remove extra parameter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98403 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCombine the code to build VLDM and VSTM instructions, since they are
Bob Wilson [Sat, 13 Mar 2010 00:43:32 +0000 (00:43 +0000)]
Combine the code to build VLDM and VSTM instructions, since they are
mostly the same.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98402 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDo not overestimate code size reduction in presense of debug info.
Devang Patel [Sat, 13 Mar 2010 00:10:20 +0000 (00:10 +0000)]
Do not overestimate code size reduction in presense of debug info.
Use CodeMetrics.analyzeBasicBlock() to estimate BB size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98401 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTidy up. No functional changes.
Bob Wilson [Fri, 12 Mar 2010 22:50:09 +0000 (22:50 +0000)]
Tidy up.  No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98398 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/Mach-O: Implement initial support for relaxation.
Daniel Dunbar [Fri, 12 Mar 2010 22:07:14 +0000 (22:07 +0000)]
MC/Mach-O: Implement initial support for relaxation.
 - The implementation is currently very brain dead and inefficient, but I have a
   clear plan on how to fix it.

 - The good news is, it works and correctly assembles 403.gcc (when built with
   Clang, at '-Os', '-Os -g', and '-O3'). Even better, at '-Os' and '-Os -g',
   the resulting binary is exactly equivalent to that when built with the system
   assembler. So it probably works! :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98396 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove obsolete comments. VLDM is implemented in ARMInstrVFP.td.
Bob Wilson [Fri, 12 Mar 2010 22:00:08 +0000 (22:00 +0000)]
Remove obsolete comments.  VLDM is implemented in ARMInstrVFP.td.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98395 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix LLVM build when the user specifies CPPFLAGS on the make command line.
Jeffrey Yasskin [Fri, 12 Mar 2010 21:42:14 +0000 (21:42 +0000)]
Fix LLVM build when the user specifies CPPFLAGS on the make command line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98394 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoremove gone method, grr symlinks.
Chris Lattner [Fri, 12 Mar 2010 21:30:49 +0000 (21:30 +0000)]
remove gone method, grr symlinks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98392 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoremove special case code that isn't needed anymore.
Chris Lattner [Fri, 12 Mar 2010 21:21:19 +0000 (21:21 +0000)]
remove special case code that isn't needed anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98391 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoinline GetGlobalValueSymbol into the rest its callers and
Chris Lattner [Fri, 12 Mar 2010 21:19:23 +0000 (21:19 +0000)]
inline GetGlobalValueSymbol into the rest its callers and
remove it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98390 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoinline the now-trivial implementation of GetGlobalValueSymbol into
Chris Lattner [Fri, 12 Mar 2010 21:09:07 +0000 (21:09 +0000)]
inline the now-trivial implementation of GetGlobalValueSymbol into
some of its callers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98388 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoeliminate the X86 version of GetGlobalValueSymbol, allowing
Chris Lattner [Fri, 12 Mar 2010 21:06:41 +0000 (21:06 +0000)]
eliminate the X86 version of GetGlobalValueSymbol, allowing
it to be non-virtual and soon disappear.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98387 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoprune #includes, this file should be removed pending hte cygwin stub issue being...
Chris Lattner [Fri, 12 Mar 2010 21:04:31 +0000 (21:04 +0000)]
prune #includes, this file should be removed pending hte cygwin stub issue being resolved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98386 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomove fastcall/stdcall mangling up into Mangler.
Chris Lattner [Fri, 12 Mar 2010 21:03:47 +0000 (21:03 +0000)]
move fastcall/stdcall mangling up into Mangler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98384 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC: Factor out MCAssembler::EvaluateFixup, and simplify.
Daniel Dunbar [Fri, 12 Mar 2010 21:00:49 +0000 (21:00 +0000)]
MC: Factor out MCAssembler::EvaluateFixup, and simplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98381 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC: Constify MCAsmLayout argument to MCExpr::EvaluteAs...
Daniel Dunbar [Fri, 12 Mar 2010 21:00:45 +0000 (21:00 +0000)]
MC: Constify MCAsmLayout argument to MCExpr::EvaluteAs...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98380 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC: Add MCAssembler::addFixup, which enforces that fixups are added in order.
Daniel Dunbar [Fri, 12 Mar 2010 21:00:38 +0000 (21:00 +0000)]
MC: Add MCAssembler::addFixup, which enforces that fixups are added in order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98379 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agogive Mangler access to TargetData.
Chris Lattner [Fri, 12 Mar 2010 20:47:28 +0000 (20:47 +0000)]
give Mangler access to TargetData.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98378 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomake DecorateCygMingName a static method.
Chris Lattner [Fri, 12 Mar 2010 20:43:52 +0000 (20:43 +0000)]
make DecorateCygMingName a static method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98377 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a virtual destructor and give vtable a home.
Benjamin Kramer [Fri, 12 Mar 2010 20:41:29 +0000 (20:41 +0000)]
Add a virtual destructor and give vtable a home.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98376 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agominor tidying, only do work if a function is
Chris Lattner [Fri, 12 Mar 2010 19:48:03 +0000 (19:48 +0000)]
minor tidying, only do work if a function is
actually X86_StdCall or X86_FastCall.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98374 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoeliminate the string form of DecorateCygMingName
Chris Lattner [Fri, 12 Mar 2010 19:42:40 +0000 (19:42 +0000)]
eliminate the string form of DecorateCygMingName

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98373 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoremove the FnArgWords cache to make way for future changes.
Chris Lattner [Fri, 12 Mar 2010 19:31:03 +0000 (19:31 +0000)]
remove the FnArgWords cache to make way for future changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98372 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a beta-test for placing the LSDA into the TEXT section on X86.
Bill Wendling [Fri, 12 Mar 2010 19:20:40 +0000 (19:20 +0000)]
Add a beta-test for placing the LSDA into the TEXT section on X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98370 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix llc crash on invalid input.
Devang Patel [Fri, 12 Mar 2010 19:18:30 +0000 (19:18 +0000)]
Fix llc crash on invalid input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98369 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove some dead code. This method only gets called on
Chris Lattner [Fri, 12 Mar 2010 19:14:18 +0000 (19:14 +0000)]
Remove some dead code.  This method only gets called on
definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98368 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agouse Mang->getSymbol instead of duplicating the logic, reduce indentation.
Chris Lattner [Fri, 12 Mar 2010 19:04:14 +0000 (19:04 +0000)]
use Mang->getSymbol instead of duplicating the logic, reduce indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98367 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofinally give Mangler a getSymbol method, which returns an MCSymbol
Chris Lattner [Fri, 12 Mar 2010 18:55:20 +0000 (18:55 +0000)]
finally give Mangler a getSymbol method, which returns an MCSymbol
for a global instead of messing around with string buffers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98366 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoremove dead code.
Chris Lattner [Fri, 12 Mar 2010 18:49:32 +0000 (18:49 +0000)]
remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98365 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosimplify code to use OutContext.GetOrCreateTemporarySymbol with
Chris Lattner [Fri, 12 Mar 2010 18:47:50 +0000 (18:47 +0000)]
simplify code to use OutContext.GetOrCreateTemporarySymbol with
no arguments instead of having to come up with a unique name.
This also makes the code less fragile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98364 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomake the mangler take an MCContext instead of an MAI.
Chris Lattner [Fri, 12 Mar 2010 18:44:54 +0000 (18:44 +0000)]
make the mangler take an MCContext instead of an MAI.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98363 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoremove MAI argument from createAsmStreamer since it
Chris Lattner [Fri, 12 Mar 2010 18:28:53 +0000 (18:28 +0000)]
remove MAI argument from createAsmStreamer since it
can get it from the context now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98361 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix a bug emitting .secrel32 that I introduced, PR6587, patch
Chris Lattner [Fri, 12 Mar 2010 18:10:35 +0000 (18:10 +0000)]
fix a bug emitting .secrel32 that I introduced, PR6587, patch
by A.Mazur!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98360 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen constant folding GEP of GEP, do not crash if an index of
Duncan Sands [Fri, 12 Mar 2010 17:55:20 +0000 (17:55 +0000)]
When constant folding GEP of GEP, do not crash if an index of
the inner GEP is not a ConstantInt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98359 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFree DbgScopes in DwarfDebug::endFunction(). Also increased the const-ness of
Jeffrey Yasskin [Fri, 12 Mar 2010 17:45:06 +0000 (17:45 +0000)]
Free DbgScopes in DwarfDebug::endFunction().  Also increased the const-ness of
several fields to make it easier to figure out where bugs might be creeping in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98358 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert turning copysignl into a COPYSIGN node for the moment:
Duncan Sands [Fri, 12 Mar 2010 17:41:34 +0000 (17:41 +0000)]
Revert turning copysignl into a COPYSIGN node for the moment:
ppc calls copysignl with a 128 bit ppc long double, resulting
in a node that the type legalizer doesn't know how to expand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98357 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove superfluous NULL assignment
Kovarththanan Rajaratnam [Fri, 12 Mar 2010 14:17:24 +0000 (14:17 +0000)]
Remove superfluous NULL assignment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98350 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse StringRef::substr instead of std::string::substr to avoid using a free'd
Benjamin Kramer [Fri, 12 Mar 2010 13:54:59 +0000 (13:54 +0000)]
Use StringRef::substr instead of std::string::substr to avoid using a free'd
string temporary. This should fix PR6590.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98349 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoNow that it's supported, turn copysignl into a COPYSIGN node.
Duncan Sands [Fri, 12 Mar 2010 12:13:59 +0000 (12:13 +0000)]
Now that it's supported, turn copysignl into a COPYSIGN node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98348 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR6522: implement copysign expansion for x86 long double
Duncan Sands [Fri, 12 Mar 2010 11:45:06 +0000 (11:45 +0000)]
Fix PR6522: implement copysign expansion for x86 long double
(it seems that FreeBSD doesn't have copysignl).  Done by
removing a bunch of assumptions from the code.  This may also
help with sparc 128 bit floats.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98346 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFactor checked library call optimization into a common helper class and use it
Benjamin Kramer [Fri, 12 Mar 2010 09:27:41 +0000 (09:27 +0000)]
Factor checked library call optimization into a common helper class and use it
to unify the almost identical code in CodeGenPrepare and InstCombineCalls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98338 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix PR6577, a bug in sdbuilder lowering select instructions
Chris Lattner [Fri, 12 Mar 2010 07:15:36 +0000 (07:15 +0000)]
fix PR6577, a bug in sdbuilder lowering select instructions
whose true value was not Val#0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98336 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoupdate mkpatch for MC, patch by Aaron Gray
Chris Lattner [Fri, 12 Mar 2010 06:32:12 +0000 (06:32 +0000)]
update mkpatch for MC, patch by Aaron Gray

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98334 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThe same situation that effected ARM effects PPC with regards to placing the
Bill Wendling [Fri, 12 Mar 2010 02:00:43 +0000 (02:00 +0000)]
The same situation that effected ARM effects PPC with regards to placing the
LSDA into the TEXT section. We need to generate non-lazy pointers to it on
Mach-O. However, the object the NLP points to may be local to the translation
unit. If so, then the NLP needs to have the value of that object specified
instead of "0", which the linker interprets as "external".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98325 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomake TargetLoweringObjectFile::getExprForDwarfReference
Chris Lattner [Fri, 12 Mar 2010 01:56:43 +0000 (01:56 +0000)]
make TargetLoweringObjectFile::getExprForDwarfReference
just make unnamed temp symbols instead of having to come
up with its own names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98324 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThere is no need to create specification DIE for definitions at DIFile level.
Devang Patel [Thu, 11 Mar 2010 23:44:52 +0000 (23:44 +0000)]
There is no need to create specification DIE for definitions at DIFile level.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98302 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC-ize PPC's asm printing of stubs.
Bill Wendling [Thu, 11 Mar 2010 23:39:44 +0000 (23:39 +0000)]
MC-ize PPC's asm printing of stubs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98300 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhoops this already existed.
Nate Begeman [Thu, 11 Mar 2010 23:21:19 +0000 (23:21 +0000)]
Whoops this already existed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98297 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a handful of additional useful pass manager things to the C API
Nate Begeman [Thu, 11 Mar 2010 23:06:07 +0000 (23:06 +0000)]
Add a handful of additional useful pass manager things to the C API

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98296 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoExtract methods from LocalRewriter::RewriteMBB bringing it down to 666 lines.
Jakob Stoklund Olesen [Thu, 11 Mar 2010 23:04:34 +0000 (23:04 +0000)]
Extract methods from LocalRewriter::RewriteMBB bringing it down to 666 lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98295 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoenhance MCContext::GetOrCreateTemporarySymbol() to create a new symbol
Chris Lattner [Thu, 11 Mar 2010 22:56:10 +0000 (22:56 +0000)]
enhance MCContext::GetOrCreateTemporarySymbol() to create a new symbol
with an arbitrary unique name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98294 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agochange MCContext to always have an MCAsmInfo.
Chris Lattner [Thu, 11 Mar 2010 22:53:35 +0000 (22:53 +0000)]
change MCContext to always have an MCAsmInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98293 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix a fixme in TargetLoweringObjectFile::getExprForDwarfReference
Chris Lattner [Thu, 11 Mar 2010 21:55:20 +0000 (21:55 +0000)]
fix a fixme in TargetLoweringObjectFile::getExprForDwarfReference
where we used ot create an MCSymbol for ".".  Now emit an assembler
temporary label and reference it instead of "." textually.

rdar://7739457

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98292 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove getWidenVectorType, which is no longer used.
Dan Gohman [Thu, 11 Mar 2010 21:39:57 +0000 (21:39 +0000)]
Remove getWidenVectorType, which is no longer used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98289 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoempty symbols aren't possible, the mcsymbol ctor aborts on them.
Chris Lattner [Thu, 11 Mar 2010 21:38:58 +0000 (21:38 +0000)]
empty symbols aren't possible, the mcsymbol ctor aborts on them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98288 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSet the (Format)F filed of t2Int_MemBarrierV7 & t2Int_SyncBarrierV7 to ThumbFrm,
Johnny Chen [Thu, 11 Mar 2010 21:02:50 +0000 (21:02 +0000)]
Set the (Format)F filed of t2Int_MemBarrierV7 & t2Int_SyncBarrierV7 to ThumbFrm,
instead of Pseudo, which helps Thumb decoder to recognize them as Thumb instr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98285 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agostpcpy is so similar to strcpy, it doesn't deserve a complete copy of the __strcpy_ch...
Benjamin Kramer [Thu, 11 Mar 2010 20:45:13 +0000 (20:45 +0000)]
stpcpy is so similar to strcpy, it doesn't deserve a complete copy of the __strcpy_chk -> strcpy code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98284 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorevert r98270.
Bill Wendling [Thu, 11 Mar 2010 19:50:31 +0000 (19:50 +0000)]
revert r98270.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98281 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorename getSymbolForDwarf* to getExprForDwarf* since it returns
Chris Lattner [Thu, 11 Mar 2010 19:41:58 +0000 (19:41 +0000)]
rename getSymbolForDwarf* to getExprForDwarf* since it returns
an MCExpr and not an MCSymbol.  Change it to take an MCStreamer,
which is currently unused.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98278 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIn case of tail call size of Ins and InVals may not match.
Evan Cheng [Thu, 11 Mar 2010 19:38:18 +0000 (19:38 +0000)]
In case of tail call size of Ins and InVals may not match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98277 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoLower stpcpy_chk when possible.
Eric Christopher [Thu, 11 Mar 2010 19:24:34 +0000 (19:24 +0000)]
Lower stpcpy_chk when possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98274 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBad bad bug. x86 force indirect tail call address into eax when it's meant to force...
Evan Cheng [Thu, 11 Mar 2010 18:49:14 +0000 (18:49 +0000)]
Bad bad bug. x86 force indirect tail call address into eax when it's meant to force it into a call preserved register instead. Change it to ecx for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98270 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove dead code. (S|U)MUL_LO is now lowered to LMUL or MACC(S|U)
Richard Osborne [Thu, 11 Mar 2010 18:38:59 +0000 (18:38 +0000)]
Remove dead code. (S|U)MUL_LO is now lowered to LMUL or MACC(S|U)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98269 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid leaking CompileUnits in DwarfDebug.cpp.
Jeffrey Yasskin [Thu, 11 Mar 2010 18:29:55 +0000 (18:29 +0000)]
Avoid leaking CompileUnits in DwarfDebug.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98268 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/Mach-O: Add MCSymbolData::getAddress() utility.
Daniel Dunbar [Thu, 11 Mar 2010 18:22:51 +0000 (18:22 +0000)]
MC/Mach-O: Add MCSymbolData::getAddress() utility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98266 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix typo.
Eric Christopher [Thu, 11 Mar 2010 17:45:38 +0000 (17:45 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98260 91177308-0d34-0410-b5e6-96231b3b80d8