Commit Graph

76898 Commits

Author SHA1 Message Date
John McCall 1f6386b79b Avoid some unnecessary copying of unresolved lookup results.
llvm-svn: 94531
2010-01-26 07:37:41 +00:00
John McCall 8fe6808de0 Handle redeclarations found by ADL deterministically and reasonably.
This solution relies on an O(n) scan of redeclarations, which means it might
scale poorly in crazy cases with tons of redeclarations brought in by a ton
of distinct associated namespaces.  I believe that avoiding this
is not worth the common-case cost.

llvm-svn: 94530
2010-01-26 07:16:45 +00:00
Chris Lattner 547c761dd6 eliminate the TargetLowering::UsesGlobalOffsetTable bool, which is
subsumed by TargetLowering::getJumpTableEncoding().  Change uses of
it to be more specific.

llvm-svn: 94529
2010-01-26 06:53:37 +00:00
Chris Lattner 4db603f93b Now that printPICJumpTableSetLabel is not overloaded,
inline it into its only caller, allowing us to simplify it
and hoist bits out of the loop.

llvm-svn: 94528
2010-01-26 06:42:44 +00:00
Chandler Carruth 72343706c1 Correctly treat 64 bit integers specified via the mode attribute as the 'long'
type when that type is 64 bits wide, and the 'long long' type when 'long' is
only 32 bits wide. This fixes PR6108.

Also adds a bunch of test cases to ensure proper conversion between equally
sized standard types and mode-specified types on both 32 and 64 bit targets.

llvm-svn: 94527
2010-01-26 06:39:24 +00:00
Chris Lattner 8a785d7a67 Move getJTISymbol from MachineJumpTableInfo to MachineFunction,
which is more convenient, and change getPICJumpTableRelocBaseExpr
to take a MachineFunction to match.

Next, move the X86 code that create a PICBase symbol to
X86TargetLowering::getPICBaseSymbol from 
X86MCInstLower::GetPICBaseSymbol, which was an asmprinter specific 
library.  This eliminates a 'gross hack', and allows us to
implement X86ISelLowering::getPICJumpTableRelocBaseExpr which now
calls it.

This in turn allows us to eliminate the 
X86AsmPrinter::printPICJumpTableSetLabel method, which was the
only overload of printPICJumpTableSetLabel.

llvm-svn: 94526
2010-01-26 06:28:43 +00:00
Anders Carlsson d6b21e4842 If a global variable has an initializer with side effects, it can never be deferred (even if it's in an anonymous namespace).
llvm-svn: 94525
2010-01-26 06:15:16 +00:00
John McCall 91f61fc921 Allow ADL to find functions imported by using decls. Leave wordy comment
about interaction between ADL and default arguments.  Shrug shoulders, commit.

llvm-svn: 94524
2010-01-26 06:04:06 +00:00
Chris Lattner 273735bc5a add a new MachineJumpTableInfo::getJTISymbol method,
use it to implement the default TargetLowering::getPICJumpTableRelocBaseExpr

llvm-svn: 94523
2010-01-26 05:58:28 +00:00
Chandler Carruth 0354bf4405 Remove a few more references to index-test; this was killed in r94210.
llvm-svn: 94522
2010-01-26 05:36:44 +00:00
Chris Lattner 8a6c1eaabb stub out a new target hook, need some refactoring before I can
implement it.

llvm-svn: 94521
2010-01-26 05:30:30 +00:00
Anders Carlsson 0b5f1ddf0a Fix another debug info crash with virtual bases.
llvm-svn: 94520
2010-01-26 05:26:39 +00:00
Anders Carlsson 17ed0496c5 Fix the test I broke, and also fix a crash when declaring a virtual destructor. Add debug info support for pure virtual member functions.
llvm-svn: 94519
2010-01-26 05:19:50 +00:00
Chris Lattner cc0f734cd0 simplify asmprinter: only emit .set directives when entries have
EK_LabelDifference32 kind and the target has .set support.  Simplify
X86AsmPrinter::printPICJumpTableSetLabel to make use of recent helpers.

llvm-svn: 94518
2010-01-26 05:15:20 +00:00
Chris Lattner 279de3ef64 rename printPICJumpTableEntry -> EmitJumpTableEntry,
make it private and non-virtual.  It handles the non-pic
case too, so just use it, simplifying EmitJumpTableInfo.

llvm-svn: 94517
2010-01-26 05:10:10 +00:00
Chris Lattner 4bfbe93437 implement X86 @GOTOFF jump table entries with the new EK_Custom32
jump table entry kind, instead of overloading 
AsmPrinter::printPICJumpTableEntry.

This has a pretty horrible and inefficient FIXME around how @GOTOFF
is currently smashed into the mcsymbol name, but otherwise this is
much cleaner.

llvm-svn: 94516
2010-01-26 05:02:42 +00:00
Chris Lattner d051af7551 add a new MachineBasicBlock::getSymbol method, replacing
the AsmPrinter::GetMBBSymbol.

llvm-svn: 94515
2010-01-26 04:55:51 +00:00
Lang Hames 090c7e82dd New PBQP solver.
* Fixed a reduction bug which occasionally led to infinite-cost (invalid)
  register allocation solutions despite the existence finite-cost solutions.
* Significantly reduced memory usage (>50% reduction).
* Simplified a lot of the solver code.

llvm-svn: 94514
2010-01-26 04:49:58 +00:00
Anders Carlsson b85f0ab976 Factor creating the DISubprogram for a member function out into a separate function.
llvm-svn: 94513
2010-01-26 04:49:33 +00:00
Dan Gohman 51aaf02821 Fix the the ceiling-division used in computing the MaxBECount so that it doesn't
have trouble with an intermediate add overflowing. Also, be more conservative
about the case where the induction variable in an SLT loop exit can step past
the RHS of the SLT and overflow in a single step.

Make getSignedRange more aggressive, to recover for some common cases which
the above fixes pessimized.

This addresses rdar://7561161.

llvm-svn: 94512
2010-01-26 04:40:18 +00:00
Anders Carlsson c1821155bf Simplify CGDebugInfo::CollectCXXMemberFunctions a little. More to come.
llvm-svn: 94511
2010-01-26 04:40:11 +00:00
Chris Lattner 170442fa12 don't bother setting the AsmPrinter::MF ivar, now that
AsmPrinter::SetupMachineFunction sets it.  Note that systemz
and msp430 didn't.  Yay for reduced inconsistency! :)

llvm-svn: 94510
2010-01-26 04:38:11 +00:00
Chris Lattner 6715952c25 make MachineFunction keep track of its ID and make
MachineFunctionAnalysis dole them out, instead of having
AsmPrinter do both.  Have the AsmPrinter::SetupMachineFunction
method set the 'AsmPrinter::MF' variable.

llvm-svn: 94509
2010-01-26 04:35:26 +00:00
Chris Lattner f8f8ba8a47 this hook should be const.
llvm-svn: 94508
2010-01-26 04:19:00 +00:00
Dan Gohman 5325efc5af Add a comment about a missed opportunity.
llvm-svn: 94507
2010-01-26 04:13:15 +00:00
Dan Gohman 837ada7692 Print empty and full sets specially.
llvm-svn: 94506
2010-01-26 04:12:55 +00:00
Chris Lattner 5fc4160ea3 Add support for target-specific 32-bit custom-lowered
jump table entries.

llvm-svn: 94505
2010-01-26 04:05:28 +00:00
Anders Carlsson 20bbbd489b Make sure to always mark a global variable as not being constant if it has a C++ initializer.
llvm-svn: 94504
2010-01-26 04:02:23 +00:00
Daniel Dunbar 19afd61201 Simplify.
llvm-svn: 94503
2010-01-26 03:56:40 +00:00
Daniel Dunbar a8d7385d99 Unbreak MSVC/CMake build.
llvm-svn: 94502
2010-01-26 03:56:22 +00:00
Chris Lattner 7a2607026b make jit jump table emission be based on the EntryKind instead of magic variables.
JITInfo::getPICJumpTableEntry can probably be removed now, but I don't plan to do 
this.

llvm-svn: 94501
2010-01-26 03:47:15 +00:00
Chris Lattner a7c116016e switch jump table entry emission to be based on EntryKind
instead of magic variables.

llvm-svn: 94500
2010-01-26 03:43:22 +00:00
Mike Stump 77537b136e Be sure to track the non-virtual part of the vcall offset in complex
multiple inheritance cases.  WIP.

This fixes 20% of the outstanding problems found by the randomized
tester.

llvm-svn: 94499
2010-01-26 03:42:22 +00:00
John McCall 4c4c1dfc2b Preserve access bits through overload resolution much better. Some
general refactoring in operator resolution.

llvm-svn: 94498
2010-01-26 03:27:55 +00:00
Douglas Gregor 47751d6c21 Introduce clang_getInstantiationLocationOffset(), which decomposes a
source location in file + offset.

llvm-svn: 94497
2010-01-26 03:07:15 +00:00
Victor Hernandez cd94410152 In mem2reg, for all alloca/stores that get promoted where the alloca has an associated llvm.dbg.declare instrinsic, insert an llvm.dbg.var intrinsic before each store.
llvm-svn: 94493
2010-01-26 02:42:15 +00:00
Victor Hernandez 7e8ce9afbc Add MDNode::getIfExists(), an efficient way to determine if a value is used by metadata (since metadata does not appear in a value's use list)
llvm-svn: 94492
2010-01-26 02:36:35 +00:00
Victor Hernandez 907bdbb6be Assert when debug intrinsic insert functions are passed empty arguments
llvm-svn: 94491
2010-01-26 02:07:38 +00:00
Evan Cheng 555f61bf58 Implement cond ? -1 : 0 with sbb.
llvm-svn: 94490
2010-01-26 02:00:44 +00:00
Dale Johannesen 0563fe3445 Accept immediate as value of a dbg_value.
llvm-svn: 94489
2010-01-26 01:54:26 +00:00
Daniel Dunbar d54669d30b Driver/Darwin: Honor IPHONEOS_DEPLOYMENT_TARGET.
llvm-svn: 94488
2010-01-26 01:45:19 +00:00
Daniel Dunbar d86666ffd7 Driver/Darwin: Stuff iPhoneOS into environment portion of the (llvm/clang) triple instead of keying off architecture. Also, fix version define to properly include the revision/micro component of the version number.
llvm-svn: 94487
2010-01-26 01:44:04 +00:00
John McCall b89836b6db Pass access specifiers around in overload resolution.
llvm-svn: 94485
2010-01-26 01:37:31 +00:00
Jeffrey Yasskin 9f4d96ccc7 Re-enable unit tests disabled in r94164 by telling GTest about the
lack of RTTI.

llvm-svn: 94484
2010-01-26 01:26:46 +00:00
Sean Callanan eb182e9c88 Added the implementation of the Intel-specific
TargetAsmLexer.

llvm-svn: 94482
2010-01-26 01:00:10 +00:00
Fariborz Jahanian 7b99f27392 Fix a regression caused by my rewriting of cast of ivar
access (was radar 7575882).

llvm-svn: 94481
2010-01-26 00:29:22 +00:00
Dale Johannesen d5575f29f1 Generate DEBUG_VALUE comments on x86. The (limited)
dbg.declare's we currently generate go through both
register allocators without perturbing the results.

llvm-svn: 94480
2010-01-26 00:09:58 +00:00
Sean Callanan ad857fc070 Added the TargetAsmLexer implementation for AT&T syntax.
llvm-svn: 94479
2010-01-26 00:08:25 +00:00
Mike Stump 90181eb294 Fixup a missing vcall entry. WIP.
llvm-svn: 94478
2010-01-26 00:05:04 +00:00
Dale Johannesen e5a4134d11 use findDebugLoc in more places.
llvm-svn: 94477
2010-01-26 00:03:12 +00:00