Commit Graph

81917 Commits

Author SHA1 Message Date
John McCall 77e41c1cc6 Don't try to find a scope corresponding to the search DC for an unfound
friend declaration;  this used to be important but is now just a waste of time
plus an unreasonable assertion.  Fixes PR6174.

llvm-svn: 101112
2010-04-13 01:44:10 +00:00
Daniel Dunbar d33749b4a9 VMCore: Add Type::getIntN[Ptr]Ty, which are the obvious generic forms of
Type::getInt{1,8,...}[Ptr]Ty, so code can consistently use the methods on Type
without occasionally needed to call IntegerType::get.

llvm-svn: 101111
2010-04-13 01:39:07 +00:00
Daniel Dunbar e0a355af5d IRBuilder: Add Create{Shl,LShr,And,Or,Xor} methods from uin64_t and APInt constants.
llvm-svn: 101110
2010-04-13 01:38:57 +00:00
Fariborz Jahanian cb21e38dc5 Modify test to be darwin specific.
llvm-svn: 101109
2010-04-13 01:10:57 +00:00
Chris Lattner dc6040b357 add frontend support for -fdata-sections and -ffunction-sections,
patch by Sylvere Teissier!

llvm-svn: 101108
2010-04-13 00:38:24 +00:00
Fariborz Jahanian 08b0f66d2e Add support for objc_copyStruct to enforce
atomicity of aggregate properties in setter/getter
methods. wip.

llvm-svn: 101107
2010-04-13 00:38:05 +00:00
Chris Lattner 5b212a31a2 add llvm codegen support for -ffunction-sections and -fdata-sections,
patch by Sylvere Teissier!

llvm-svn: 101106
2010-04-13 00:36:43 +00:00
Devang Patel 74c10507a6 Fix debug info for cleanup block.
llvm-svn: 101100
2010-04-13 00:08:43 +00:00
Chris Lattner 9d94f04f27 cache the PP's SourceManager.
llvm-svn: 101099
2010-04-13 00:06:42 +00:00
John McCall 212fa2efb7 Diagnose declarations of conversion functions with declarators other than '()'.
llvm-svn: 101098
2010-04-13 00:04:31 +00:00
Chris Lattner 5dbefc6697 make the preprocessor listen to linemarker directives in -E mode,
PR6101.  This is based on a patch and testcase by Jordy Rose!

llvm-svn: 101097
2010-04-13 00:01:41 +00:00
Sean Callanan d75c8a0813 Build system fix to make llvm-mc properly build
after edis.  Really, there ought to be some
mechanism to ensure that PARALLEL_DIRS get built
after DIRS.

llvm-svn: 101095
2010-04-12 23:55:28 +00:00
Douglas Gregor b3cdaee190 Remove some dead FIXMEs
llvm-svn: 101092
2010-04-12 23:52:24 +00:00
Douglas Gregor 2c326bce38 Implement C++ [over.ics.user]p3, which restricts the final conversion
from a conversion function template specialization to one of exact
match rank. We only know how to test this in C++0x with default
function template arguments, but it's also in the C++03 spec. Fixes
PR6285.

llvm-svn: 101089
2010-04-12 23:42:09 +00:00
Douglas Gregor 5c0066f1cf Improve source-location information for C++ conversion functions, by
copying the type location information from the conversion-type-id into
the type location information for the function type. Do something
similar for constructors and destructors, by giving their "void"
return type source-location information.

In all of these cases, we previously left this type-source information
uninitialized, which led to various unfortunate crashes.

We still aren't tracking good source-location information for the
actual names. That's PR6357.

John, please check my sanity on this.

llvm-svn: 101088
2010-04-12 23:19:01 +00:00
Dan Gohman ebbd05f8ce Micro-optimize a few hot spots.
llvm-svn: 101086
2010-04-12 23:08:18 +00:00
Evan Cheng d0d8e3343a Use .set expression for x86 pic jump table reference to reduce assembly relocation. rdar://7738756
llvm-svn: 101085
2010-04-12 23:07:17 +00:00
Chris Lattner 1a9e873bf9 fix a minor bug I noticed while work with Jordy's patch for PR6101,
in an input file like this:

# 42
int x;

we were emitting:

# <something>
 int x;

(with a space before the int) because we weren't clearing the leading 
whitespace flag properly after the \n from the directive was handled.

llvm-svn: 101084
2010-04-12 23:04:41 +00:00
Dan Gohman 11862a6ed3 Add fast paths to ScalarEvolution::getSizeOf and getOffsetOf, as
they're used a lot by getNodeForGEP, which can be called a lot.
This speeds up -iv-users by around 15% on several testcases.

llvm-svn: 101083
2010-04-12 23:03:26 +00:00
Bill Wendling caaf445a01 Third time's a charm...
llvm-svn: 101081
2010-04-12 22:43:21 +00:00
Bill Wendling 4fc5a4d8b8 Genericize the label test.
llvm-svn: 101079
2010-04-12 22:40:37 +00:00
Bill Wendling 4627917b9a Correct test to test what I mean it to test.
llvm-svn: 101077
2010-04-12 22:25:42 +00:00
Bill Wendling b02bbe416f Micro-optimization:
If we have this situation:

    jCC  L1
    jmp  L2
L1:
  ...
L2:
  ...

We can get a small performance boost by emitting this instead:

    jnCC L2
L1:
  ...
L2:
  ...

This testcase shows an example of this:

float func(float x, float y) {
    double product = (double)x * y;
    if (product == 0.0)
        return product;
    return product - 1.0;
}

llvm-svn: 101075
2010-04-12 22:19:57 +00:00
Dan Gohman 3cdcc3f728 Simplify this code.
llvm-svn: 101074
2010-04-12 22:12:29 +00:00
Ted Kremenek e601365de9 Add fixit hint for missing ':' in ternary expressions.
llvm-svn: 101073
2010-04-12 22:10:35 +00:00
Sean Callanan 393c4df342 Build system fixes. llvm-mc depends on
libEnhancedDisassembly, so we now build the
static library in all cases (although the shared
library is only built when requested/possible).

Also, fixed a bug where edis wasn't properly
initializing the targets it uses.

llvm-svn: 101072
2010-04-12 21:55:49 +00:00
Chris Lattner 97a8e43a02 fix PR6814 - Only print [-pedantic] on a diagnostic if -pedantic
actually turned it on.  If a diag is produced by a warning which
is an extension but defaults to on, and has no warning group, don't
print any option info.

llvm-svn: 101071
2010-04-12 21:53:11 +00:00
Ted Kremenek 4ed2925b91 Add 'clang_getCursorLanguage' to return the "language" of the AST element (e.g., distinguish between C and Objective-C language features). Currently this only returns results for declarations.
llvm-svn: 101070
2010-04-12 21:22:16 +00:00
Ted Kremenek 601f6d5b59 Sort exports file.
llvm-svn: 101069
2010-04-12 21:22:10 +00:00
Dan Gohman 4a645b88ef Suppress LinearFunctionTestReplace when the computed backedge-taken
expression is a UDiv and it doesn't appear that the UDiv came from
the user's source.

ScalarEvolution has recently figured out how to compute a tripcount
expression for the inner loop in
SingleSource/Benchmarks/Shootout/sieve.c, using a udiv. Emitting a
udiv instruction dramatically slows down the enclosing loop.

llvm-svn: 101068
2010-04-12 21:13:43 +00:00
Chris Lattner 933f67887f fix PR6660/6168: emit padding as zeros instead of undef. Because
trailing fields may not be represented in initializer lists, they
are being handled as padding and those fields *must* be zero 
initialized.

llvm-svn: 101067
2010-04-12 21:10:05 +00:00
Daniel Dunbar f9c24f8403 IRgen: Factor out ComputeBitFieldInfo.
llvm-svn: 101066
2010-04-12 21:01:28 +00:00
Douglas Gregor 41f9030fb8 Implement C++ [temp.local]p4, which specifies how we eliminate
name-lookup ambiguities when there are multiple base classes that are
all specializations of the same class template. This is part of a
general cleanup for ambiguities in template-name lookup. Fixes
PR6717.

llvm-svn: 101065
2010-04-12 20:54:26 +00:00
Sean Callanan deee643b95 Bug fix: made the enhanced disassembler's link
flags work properly when EDIS_VERSION is defined

llvm-svn: 101063
2010-04-12 20:23:08 +00:00
Sean Callanan b2134e6968 Bug fix: included System/Types.h instead of
inttypes.h to allow building on Windows.

llvm-svn: 101062
2010-04-12 20:21:56 +00:00
Ted Kremenek 39a7665832 Fix null dereference in 'WriteSourceLocation' when the FileEntry is null.
llvm-svn: 101060
2010-04-12 19:54:17 +00:00
Benjamin Kramer 0644145373 Prune includes.
llvm-svn: 101059
2010-04-12 19:45:50 +00:00
Sean Callanan 2d03d3a8a7 Second try at integrating the edis tester. This
time I use the LIBS variable, which is not subject
to a %.a -> -l% transformation, to link llvm-mc
against libEnhancedDisassembly.

llvm-mc -edis works the same as llvm-mc
-disassemble, but outputs tokens and operands.

llvm-svn: 101058
2010-04-12 19:43:00 +00:00
Ted Kremenek de24a940a7 Update doxygen comments about lifetime requirements of CXUnsaveFile data arguments.
llvm-svn: 101054
2010-04-12 18:47:26 +00:00
Johnny Chen fc93503c59 Fixed a crasher in arm disassembler within ARMInstPrinter.cpp after calling
ARM_AM::getSoImmVal(V) with a legitimate so_imm value: #245 rotate right by 2.
Introduce ARM_AM::getSOImmValOneOrNoRotate(unsigned Arg) which is called from
ARMInstPrinter.cpp's printSOImm() function, replacing ARM_AM::getSOImmVal(V).

[12:44:43] johnny:/Volumes/data/llvm/git/trunk (local-trunk) $ gdb Debug/bin/llvm-mc
GNU gdb 6.3.50-20050815 (Apple version gdb-1346) (Fri Sep 18 20:40:51 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ... done

(gdb) set args  -triple=arm-apple-darwin9 -debug-only=arm-disassembler --disassemble
(gdb) r
Starting program: /Volumes/data/llvm/git/trunk/Debug/bin/llvm-mc -triple=arm-apple-darwin9 -debug-only=arm-disassembler --disassemble
Reading symbols for shared libraries ++. done
0xf5 0x71 0xf0 0x53
Opcode=201 Name=MVNi Format=ARM_FORMAT_DPFRM(4)
 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0 
-------------------------------------------------------------------------------------------------
| 0: 1: 0: 1| 0: 0: 1: 1| 1: 1: 1: 1| 0: 0: 0: 0| 0: 1: 1: 1| 0: 0: 0: 1| 1: 1: 1: 1| 0: 1: 0: 1|
-------------------------------------------------------------------------------------------------

	mvnpls	r7, Assertion failed: (V != -1 && "Not a valid so_imm value!"), function printSOImm, file ARMInstPrinter.cpp, line 229.

Program received signal SIGABRT, Aborted.
0x00007fff88c65886 in __kill ()
(gdb) bt
#0  0x00007fff88c65886 in __kill ()
#1  0x00007fff88d05eae in abort ()
#2  0x00007fff88cf2ef0 in __assert_rtn ()
#3  0x000000010020e422 in printSOImm (O=@0x1010bdf80, V=-1, VerboseAsm=false, MAI=0x1020106d0) at ARMInstPrinter.cpp:229
#4  0x000000010020e5fe in llvm::ARMInstPrinter::printSOImmOperand (this=0x1020107e0, MI=0x7fff5fbfee70, OpNum=1, O=@0x1010bdf80) at ARMInstPrinter.cpp:254
#5  0x00000001001ffbc0 in llvm::ARMInstPrinter::printInstruction (this=0x1020107e0, MI=0x7fff5fbfee70, O=@0x1010bdf80) at ARMGenAsmWriter.inc:3236
#6  0x000000010020c27c in llvm::ARMInstPrinter::printInst (this=0x1020107e0, MI=0x7fff5fbfee70, O=@0x1010bdf80) at ARMInstPrinter.cpp:182
#7  0x000000010003cbff in PrintInsts (DisAsm=@0x10200f4e0, Printer=@0x1020107e0, Bytes=@0x7fff5fbff060, SM=@0x7fff5fbff078) at Disassembler.cpp:65
#8  0x000000010003c8b4 in llvm::Disassembler::disassemble (T=@0x1010c13c0, Triple=@0x1010b6798, Buffer=@0x102010690) at Disassembler.cpp:153
#9  0x000000010004095c in DisassembleInput (ProgName=0x7fff5fbff3f0 "/Volumes/data/llvm/git/trunk/Debug/bin/llvm-mc") at llvm-mc.cpp:347
#10 0x000000010003eefb in main (argc=4, argv=0x7fff5fbff298) at llvm-mc.cpp:374
(gdb) q
The program is running.  Exit anyway? (y or n) y
[13:36:26] johnny:/Volumes/data/llvm/git/trunk (local-trunk) $ 

llvm-svn: 101053
2010-04-12 18:46:53 +00:00
Fariborz Jahanian 5a8c2034a4 Add some API code for future work.
llvm-svn: 101052
2010-04-12 18:18:10 +00:00
Daniel Dunbar b97bff9aa9 IRgen: Add CGRecordLayout::dump, and dump (irgen) record layouts as part of -fdump-record-layouts.
llvm-svn: 101051
2010-04-12 18:14:18 +00:00
Chris Lattner 509a32da75 fix PR6819
llvm-svn: 101050
2010-04-12 17:25:51 +00:00
Chris Lattner 5ff40fc7ab tighten the check for cast of super to avoid rejecting valid code,
rdar://7853261

llvm-svn: 101048
2010-04-12 17:09:27 +00:00
Douglas Gregor b93b606759 When creating the implicitly-declared special member functions, be
sure to introduce them into the current Scope (when we have one) in
addition to the DeclContext for the class, so that they can be found
by name lookup for inline members of the class. Fixes PR6570.

llvm-svn: 101047
2010-04-12 17:09:20 +00:00
Chris Lattner 08e774b7ef fix rdar://7852959 - Use of super within a block is actually ok.
(aka, Fariborz was right ;-)

llvm-svn: 101046
2010-04-12 17:03:29 +00:00
Fariborz Jahanian 5ea6bdd0ea Issue warning when 'weak_import' attribute is applied on a class only
when it is not supported in versions of MacOs.

llvm-svn: 101044
2010-04-12 16:57:31 +00:00
Dan Gohman e4148978b8 Remove a #include.
llvm-svn: 101043
2010-04-12 16:26:03 +00:00
Douglas Gregor 61c1ac2e5c Remove the blanket statement about Clang not supporting access control. It does now
llvm-svn: 101041
2010-04-12 16:01:38 +00:00
Douglas Gregor ce40e2ef8a Fix a crash-on-invalid involving name lookup of tag names, where we
ended up finding a function template that we didn't expect. Recover
more gracefully, and fix a similar issue for class templates.

llvm-svn: 101040
2010-04-12 16:00:01 +00:00