Commit Graph

101984 Commits

Author SHA1 Message Date
Johnny Chen 5f45f6c014 Change the CFLAGS variable assignment operator to ?= (conditional variable assignment operator).
This allows us to override CFLAGS on the command line:

$ CFLAGS='-arch $(ARCH) -gdwarf-2 -O0' ./dotest.py -C clang -A i386 -v objc-optimized

Session logs for test failures/errors will go into directory '2011-03-04-10_33_57'
Command invoked: python ./dotest.py -C clang -A i386 -v objc-optimized
----------------------------------------------------------------------
Collected 2 tests

1: test_break_with_dsym (TestObjcOptimized.ObjcOptimizedTestCase)
   Test 'expr member' continues to work for optimized build. ... ok
2: test_break_with_dwarf (TestObjcOptimized.ObjcOptimizedTestCase)
   Test 'expr member' continues to work for optimized build. ... ok

----------------------------------------------------------------------
Ran 2 tests in 1.902s

OK
$

llvm-svn: 127011
2011-03-04 18:31:00 +00:00
Benjamin Kramer acf0842088 raw_ostream: If writing a string that is larger than the buffer, write it directly instead of doing many buffer-sized writes.
This caps the number of write(2) calls per string to a maximum of 2.

llvm-svn: 127010
2011-03-04 18:18:16 +00:00
Johnny Chen 3b83d63a17 Add TestObjcOptimized.py under the objc-optimized directory to
test that objective-c expression parser continues to work for optimized build.

Radar filed:
# rdar://problem/9087739
# test failure: objc_optimized does not work for "-C clang -A i386"

llvm-svn: 127009
2011-03-04 18:17:49 +00:00
Jakob Stoklund Olesen a1363fac05 Deferred SlotIndex renumbering was a good idea but never used.
llvm-svn: 127008
2011-03-04 18:08:32 +00:00
Jakob Stoklund Olesen b88f6adf0f Add SlotIndex statistics.
llvm-svn: 127007
2011-03-04 18:08:29 +00:00
Jakob Stoklund Olesen d4f788952d Tweak debug output. No functional changes.
llvm-svn: 127006
2011-03-04 18:08:26 +00:00
Bruno Cardoso Lopes db93ddb41b Fixes addc pattern when immediate cannot be represented with 16-bit. Patch by Akira Hatanaka
llvm-svn: 127005
2011-03-04 17:59:18 +00:00
Douglas Gregor fd7c225530 Make sure to put template parameters into their owning template's
DeclContext once we've created it. This mirrors what we do for
function parameters, where the parameters start out with
translation-unit context and then are adopted by the appropriate
DeclContext when it is created. Also give template parameters public
access and make sure that they don't show up for the purposes of name
lookup.

Fixes PR9400, a regression introduced by r126920, which implemented
substitution of default template arguments provided in template
template parameters (C++ core issue 150).

How on earth could the DeclContext of a template parameter affect the
handling of default template arguments?

I'm so glad you asked! The link is
Sema::getTemplateInstantiationArgs(), which determines the outer
template argument lists that correspond to a given declaration. When
we're instantiating a default template argument for a template
template parameter within the body of a template definition (not it's
instantiation, per core issue 150), we weren't getting any outer
template arguments because the context of the template template
parameter was the translation unit. Now that the context of the
template template parameter is its owning template, we get the
template arguments from the injected-class-name of the owning
template, so substitution works as it should.

llvm-svn: 127004
2011-03-04 17:52:15 +00:00
Bruno Cardoso Lopes ed874eff93 Remove (hopefully) all trailing whitespaces from the mips backend. Patch by Hatanaka, Akira
llvm-svn: 127003
2011-03-04 17:51:39 +00:00
Abramo Bagnara b9893d66bc Fixed source range for function template specializations.
template <class T> void foo();
template <> void foo<int>(); /* Spec 1 */
template <> void foo<int>(); /* Spec 2 */

If we look at the main location of the first explicit specialization (Spec 1) it can be seen that it points to the name of the *second* explicit specialization (Spec 2), which is a redeclaration of Spec1.
Hence, the source range obtained for Spec1 is not only inaccurate, but also invalid (the end location comes before the start location).

llvm-svn: 127002
2011-03-04 17:20:30 +00:00
Duncan Sands 6bd1044222 Revert commit 126684 "Use the correct shift amount type". It is only the correct
type after type legalization has completed.  Before then it may simply not be big
enough to hold the shift amount, particularly on x86 which uses a very small type
for shifts (this issue broke stuff in the past which is why LegalizeTypes carefully
uses a large type for shift amounts).

llvm-svn: 127000
2011-03-04 14:28:59 +00:00
Abramo Bagnara a0935267dc Fixed source range for ClassTemplateSpecializationDecl.
llvm-svn: 126999
2011-03-04 14:20:30 +00:00
Kalle Raiskila a1d947dd14 Allow vector shifts (shl,lshr,ashr) on SPU.
There was a previous implementation with patterns that would 
have matched e.g. 
	shl <v4i32> <i32>,
but this is not valid LLVM IR so they never were selected.

llvm-svn: 126998
2011-03-04 13:19:18 +00:00
Benjamin Kramer 024e619f2a Move private structs into anonymous namespaces.
llvm-svn: 126997
2011-03-04 13:12:48 +00:00
Abramo Bagnara 23485e04be Improved TemplateTypeParmDecl end location.
llvm-svn: 126996
2011-03-04 12:42:03 +00:00
Kalle Raiskila 3531e9b0d9 Allow load from constant on SPU.
A 'load <4 x i32>* null' crashes llc before this fix.

llvm-svn: 126995
2011-03-04 12:00:11 +00:00
Abramo Bagnara e15d553663 Fixed end location of NonTypeTemplateParamDecl.
llvm-svn: 126994
2011-03-04 11:03:48 +00:00
Abramo Bagnara 36a95be4ea Fixed end location of FriendDecl.
llvm-svn: 126993
2011-03-04 10:59:18 +00:00
John McCall 8bc6d5b919 Don't consider visibility from template parameter lists if we're
computing for a nested decl with explicit visibility.  This is all part
of the general philosophy of explicit visibility attributes, where
any information that was obviously available at the attribute site
should probably be ignored.  Fixes PR9371.

llvm-svn: 126992
2011-03-04 10:39:25 +00:00
Nick Lewycky 8e3a79da9f Fold "icmp pred (srem X, Y), Y" like we do for urem. Handle signed comparisons
in the urem case, though not the other way around. This is enough to get #3 from
PR9343!

llvm-svn: 126991
2011-03-04 10:06:52 +00:00
John McCall 74186ab391 Access ivars with inbounds GEPs, even in -fwrapv. It's unlikely that
this can have any optimization effect, given the opacity of objects pointers,
but you never know.

llvm-svn: 126990
2011-03-04 08:25:59 +00:00
John McCall 6647584951 Let's do super message sends with static allocas instead of dynamic ones.
llvm-svn: 126989
2011-03-04 08:00:29 +00:00
Nick Lewycky 3cec6f5563 Teach instruction simplify to use constant ranges to solve problems of the form
"icmp pred %X, CI" and a number of examples where "%X = binop %Y, CI2".

Some of these cases (div and rem) used to make it through opt -O2, but the
others are probably now making code elsewhere redundant (probably instcombine).

llvm-svn: 126988
2011-03-04 07:00:57 +00:00
Eli Friedman 5aa4c68eca Followup to r126970: add 64-bit encoding tests for str with reg operand.
llvm-svn: 126987
2011-03-04 04:06:47 +00:00
John McCall 4223a9ee7a Make AttributedTypes for GC-qualified types and fix some miscellaneous
bugs with such types.  Not sure this is quite how I want the desugaring
and a.k.a. logic to go, but it suffices.

llvm-svn: 126986
2011-03-04 04:00:19 +00:00
Jakob Stoklund Olesen e2017b6f2e DenseMap<uintptr_t,...> doesn't allow all values as keys.
Avoid colliding with the sentinels, hopefully unbreaking
llvm-gcc-x86_64-linux-selfhost.

llvm-svn: 126982
2011-03-04 02:48:56 +00:00
Andrew Trick c88b7ecb88 Minor pre-RA-sched fixes and cleanup.
Fix the PendingQueue, then disable it because it's not required for
the current schedulers' heuristics.
Fix the logic for the unused list-ilp scheduler.

llvm-svn: 126981
2011-03-04 02:03:45 +00:00
Johnny Chen 60a084a24d Add objc source file and Makefile. Test case to follow.
llvm-svn: 126980
2011-03-04 01:54:19 +00:00
Johnny Chen e0ec9ea5ce Add the ability for the test suite to specify a list of compilers and a list of architectures
on the command line.  For example, use '-A x86_64^i386' to launch the inferior use both x86_64
and i386.

This is an example of building the debuggee using both clang and gcc compiers:

[17:30:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -C clang^gcc -v -f SourceManagerTestCase.test_modify_source_file_while_debugging

Session logs for test failures/errors will go into directory '2011-03-03-17_31_39'
Command invoked: python ./dotest.py -C clang^gcc -v -f SourceManagerTestCase.test_modify_source_file_while_debugging

Configuration:  compiler=clang
----------------------------------------------------------------------
Collected 1 test

1: test_modify_source_file_while_debugging (TestSourceManager.SourceManagerTestCase)
   Modify a source file while debugging the executable. ... Command 'run' failed!

original content: #include <stdio.h>

int main(int argc, char const *argv[]) {
    printf("Hello world.\n"); // Set break point at this line.
    return 0;
}

new content: #include <stdio.h>

int main(int argc, char const *argv[]) {
    printf("Hello lldb.\n"); // Set break point at this line.
    return 0;
}

os.path.getmtime() after writing new content: 1299202305.0
content restored to: #include <stdio.h>

int main(int argc, char const *argv[]) {
    printf("Hello world.\n"); // Set break point at this line.
    return 0;
}

os.path.getmtime() after restore: 1299202307.0
ok

----------------------------------------------------------------------
Ran 1 test in 8.259s

OK

Configuration:  compiler=gcc
----------------------------------------------------------------------
Collected 1 test

1: test_modify_source_file_while_debugging (TestSourceManager.SourceManagerTestCase)
   Modify a source file while debugging the executable. ... original content: #include <stdio.h>

int main(int argc, char const *argv[]) {
    printf("Hello world.\n"); // Set break point at this line.
    return 0;
}

new content: #include <stdio.h>

int main(int argc, char const *argv[]) {
    printf("Hello lldb.\n"); // Set break point at this line.
    return 0;
}

os.path.getmtime() after writing new content: 1299202307.0
content restored to: #include <stdio.h>

int main(int argc, char const *argv[]) {
    printf("Hello world.\n"); // Set break point at this line.
    return 0;
}

os.path.getmtime() after restore: 1299202309.0
ok

----------------------------------------------------------------------
Ran 1 test in 2.301s

OK
[17:31:49] johnny:/Volumes/data/lldb/svn/trunk/test $ 

llvm-svn: 126979
2011-03-04 01:35:22 +00:00
Devang Patel 213264c03d Add ArrayRef variant.
llvm-svn: 126978
2011-03-04 01:20:33 +00:00
Ted Kremenek be52871b1a Correctly handle nested switch statements in CFGBuilder when on switch statement has a condition that evaluates to a constant.
llvm-svn: 126977
2011-03-04 01:03:41 +00:00
Jakob Stoklund Olesen c332e727b4 Precompute block frequencies, pow() isn't free.
llvm-svn: 126975
2011-03-04 00:58:40 +00:00
James McIlree 9631aae211 Expose ConnectRemote API through SBTarget and SBProcess.
Patch verified by Greg Clayton prior to checkin.

llvm-svn: 126974
2011-03-04 00:31:13 +00:00
Sean Callanan 54366f12cb Fixed a bug in the expression parser where the 'this'
or 'self' variable was not properly read if the compiler
optimized it into a register.

llvm-svn: 126973
2011-03-04 00:23:47 +00:00
Jakob Stoklund Olesen 1a69e23300 Use an IndexedMap instead of a DenseMap for the live-out cache.
This speeds up updateSSA() so it only accounts for 5% of the live range
splitting time.

llvm-svn: 126972
2011-03-04 00:15:36 +00:00
Eli Friedman f63614a982 PR9377: Handle x86 str with register operand in a way consistent with gas.
llvm-svn: 126970
2011-03-04 00:10:17 +00:00
Bill Wendling f3658f3872 There are times when the landing pad won't have a call to 'eh.selector' in
it. It's been assumed up til now that it would be in its immediate
successor. However, this isn't necessarily the case. It could be in one of its
successor's successors.

Modify the code to more thoroughly check for an 'eh.selector' call in
successors. It only looks at a successor if we get there as a result of an
unconditional branch.

Testcase ObjC/exceptions-4.m in r126968.

llvm-svn: 126969
2011-03-03 23:14:05 +00:00
Bob Wilson f5d23beff7 PR8053: Fix encoding of S bit in some ARM instructions.
Patch by Zonr Chang!

llvm-svn: 126967
2011-03-03 23:07:15 +00:00
Argyrios Kyrtzidis 7a1778eba1 -Woverloaded-virtual shouldn't warn for static functions. Fixes rdar://9083431 & http://llvm.org/PR9396.
llvm-svn: 126966
2011-03-03 22:58:57 +00:00
Caroline Tice 94f87e37c8 Add code to emulate RFE Arm instruction.
Add new instruction context for RFE instruction.

Add several new helper functions to help emulate RFE instruction
(including CurrentModeIsPrivileged, BadMode, and CPSRWriteByInstr).

llvm-svn: 126965
2011-03-03 22:37:46 +00:00
Eli Friedman d8a555bb3b Revert r123908; the code in question is completely untested and wrong.
llvm-svn: 126964
2011-03-03 22:33:23 +00:00
Joerg Sonnenberger 852ab890b5 Bug#9033: For the ELF assembler output, always quote the section name.
llvm-svn: 126963
2011-03-03 22:31:08 +00:00
Devang Patel 63b3e76370 Fix typo.
llvm-svn: 126962
2011-03-03 21:49:41 +00:00
Douglas Gregor 2b1ca9eaad Fix PR9390 in not one, but two ways:
1) When we do an instantiation of the injected-class-name type,
  provide a proper source location. This is just plain good hygiene.

  2) When we're building a NestedNameSpecifierLoc from a CXXScopeSpec,
  only return an empty NestedNameSpecifierLoc if there's no
  representation.

Both problems contributed to the horrible test case in PR9390 that I
couldn't reduce down to something palatable.

llvm-svn: 126961
2011-03-03 21:48:55 +00:00
Devang Patel 68a1525290 Encode argument numbering in debug info so that code generator can emit them in order.
This fixes few blocks.exp regressions.

llvm-svn: 126960
2011-03-03 20:13:15 +00:00
Devang Patel 34a7ab400e Fix thinko in previous check-in.
Add comment.

llvm-svn: 126959
2011-03-03 20:08:10 +00:00
Devang Patel 4ab660b077 llvm::Function argument count is not a good indicator of how many arugments does the function have at source level. If we need more space, just resize vector conservatively. This vector is only used once per function.
llvm-svn: 126957
2011-03-03 20:02:02 +00:00
Jim Grosbach 7e200664f6 Allow a target to choose whether to prefer the scavenger emergency spill slot
be next to the frame pointer or the stack pointer.

llvm-svn: 126956
2011-03-03 20:01:52 +00:00
Johnny Chen ed4019802d Add TestDisasmAPI.py which exercises the newly added SBFunction/SBSymbol.GetStartAddress(),
among other things:

// When stopped on breakppint 1, we can get the line entry using SBFrame API
// SBFrame.GetLineEntry().  We'll get the start address for the the line entry
// with the SBAddress type, resolve the symbol context using the SBTarget API
// SBTarget.ResolveSymbolContextForAddress() in order to get the SBSymbol.
//
// We then stop at breakpoint 2, get the SBFrame, and the the SBFunction object.
//
// The address from calling GetStartAddress() on the symbol and the function
// should point to the same address, and we also verify that.

And add one utility function disassemble(target, function_or_symbol) to lldbutil.py:

    """Disassemble the function or symbol given a target.

    It returns the disassembly content in a string object.
    """

TestDisasm.py uses the disassemble() function to do disassembly on the SBSymbol, and
then the SBFunction object.

llvm-svn: 126955
2011-03-03 19:14:00 +00:00
Caroline Tice c8d0d3ae0b Add code to emulate UXTH Arm instruction.
llvm-svn: 126954
2011-03-03 18:48:58 +00:00