Commit Graph

129107 Commits

Author SHA1 Message Date
Hal Finkel 1cc27e44a4 Add support for generating reg+reg preinc stores on PPC.
PPC will now generate STWUX and friends.

llvm-svn: 158698
2012-06-19 02:34:32 +00:00
Argyrios Kyrtzidis a3fcbeb908 [objcmt] When checking whether the subscripting methods are declared use
ObjCInterfaceDec::lookupInstanceMethod to make sure we check categories as well
and update related tests.

rdar://11695288

llvm-svn: 158697
2012-06-19 02:22:02 +00:00
Rafael Espindola 31567515ed really add a triple :-(
llvm-svn: 158696
2012-06-19 02:17:35 +00:00
Rafael Espindola f2ae4075c8 Add a triple to the test.
llvm-svn: 158695
2012-06-19 01:42:34 +00:00
Rafael Espindola 66aa045fd9 Add a -fuse-init-array option to cc1 and map to the UseInitArray target
option. On the driver, check if we are using libraries from gcc 4.7 or newer
and if so pass -fuse-init-array to the frontend.
The crtbegin*.o files in gcc 4.7 no longer call the constructors listed in
.ctors, so we have to use .init_array.

llvm-svn: 158694
2012-06-19 01:26:10 +00:00
Johnny Chen 9a63cfaf8d rdar://problem/11649610
lldb confused by single quote in executable path

Also add a test case.

llvm-svn: 158693
2012-06-19 00:56:55 +00:00
Rafael Espindola ca3e0ee8b3 Move the support for using .init_array from ARM to the generic
TargetLoweringObjectFileELF. Use this to support it on X86. Unlike ARM,
on X86 it is not easy to find out if .init_array should be used or not, so
the decision is made via TargetOptions and defaults to off.

Add a command line option to llc that enables it.

llvm-svn: 158692
2012-06-19 00:48:28 +00:00
Kaelyn Uhrain 9ea8f7e6c5 Improve the error message when a function overload candidate is rejected
because it expects a reference and receives a non-l-value.

For example, given:

  int foo(int &);
  template<int x> void b() { foo(x); }

clang will now print "expects an l-value for 1st argument" instead of
"no known conversion from 'int' to 'int &' for 1st argument". The change
in wording (and associated code to detect the case) was prompted by
comment #5 in PR3104, and should be the last bit of work needed for the
bug.

llvm-svn: 158691
2012-06-19 00:37:47 +00:00
Ted Kremenek 9dcc0325de Sink definition of IBOutlet, IBOutletCollection, and IBAction into
the compiler predefines buffer.  These are essentially part of
the Objective-C language.

llvm-svn: 158690
2012-06-19 00:37:39 +00:00
Jordan Rose 8cea63c5cd Change -Winternal-linkage-in-inline from ExtWarn to Warning in C++.
Per post-commit review, it's not appropriate to use ExtWarn in C++, because
we can't prove that the inline function will actually be defined in more than
one place (and thus we can't prove that this violates the ODR).

This removes the warning entirely from uses in the main source file in C++.

llvm-svn: 158689
2012-06-18 23:58:49 +00:00
Nuno Lopes f9abcb7ba9 revert r158660, since Chris has some issues with this patch (namely using code to reprent information only used by the compiler)
Original commit msg:
add the 'alloc' metadata node to represent the size of offset of buffers pointed to by pointers.
This metadata can be attached to any instruction returning a pointer

llvm-svn: 158688
2012-06-18 23:34:26 +00:00
Michael J. Spencer c6ad2c4f03 XFAIL linker-opts.c on win32 now that it doesn't pretend that link.exe is ld.
llvm-svn: 158687
2012-06-18 23:00:44 +00:00
Tanya Lattner 794250474b Add language std for OpenCL 1.1 and 1.2.
llvm-svn: 158686
2012-06-18 22:55:02 +00:00
David Blaikie 2417379c63 Don't copy a potentially-uninitialized variable.
Based on review discussion of r158638 with Chandler Carruth, Tobias von Koch, and Duncan Sands and a -Wmaybe-uninitialized warning from GCC.

llvm-svn: 158685
2012-06-18 22:31:28 +00:00
Manman Ren 6e1fd46fdf ARM: use NOEN loads and stores if possible when handling struct byval.
This change is to be enabled in clang.

rdar://9877866

llvm-svn: 158684
2012-06-18 22:23:48 +00:00
Jordan Rose 28cd12f265 Support -Winternal-linkage-in-inline in C++ code.
This includes treating anonymous namespaces like internal linkage, and allowing
const variables to be used even if internal. The whole thing's been broken out
into a separate function to avoid nested ifs.

llvm-svn: 158683
2012-06-18 22:09:19 +00:00
Jordan Rose 2fa69ef934 Add new tool 'diag-build' for showing enabled warnings in a project.
diag-build acts as a wrapper for 'diagtool show-enabled', in the same way
that scan-build acts as a wrapper for the static analyzer. The common case is
simple: use 'diag-build make' or 'diag-build xcodebuild' to list the warnings
enabled for the first compilation command we see. Other build systems require
you to manually specify "dry-run" and "use $CC and $CXX"; if there is a build
system you are interested in, please add it to the switch statement.

diag-build is fairly stupid right now, but it serves its basic purpose.
Hopefully it can grow to meet any additional requirements.

llvm-svn: 158682
2012-06-18 21:31:37 +00:00
Jordan Rose 832c2134a9 [analyzer] Add a comment: why we treat array compound literals as lvalues.
llvm-svn: 158681
2012-06-18 21:31:27 +00:00
Hal Finkel 8eac009633 Allow up to 64 functional units per processor itinerary.
This patch changes the type used to hold the FU bitset from unsigned to uint64_t.
This will be needed for some upcoming PowerPC itineraries.

llvm-svn: 158679
2012-06-18 21:08:18 +00:00
Nick Kledzik 920ceddf80 Fix Sphinx warning. Patch by Sean Silva
llvm-svn: 158678
2012-06-18 20:24:47 +00:00
Michael J. Spencer 626a4ecf3a [docs] Port FAQ over to Sphinx.
Patch by Mikael Lyngvig!

llvm-svn: 158677
2012-06-18 20:21:38 +00:00
Matt Beaumont-Gay 50911a9d60 Move a few static functions from DiagnosticRenderer.cpp into SourceManager.
This simplifies the code a little bit, since these functions all took a
SourceManager parameter and called a bunch of methods on it, and makes
the functions available to other users.

llvm-svn: 158676
2012-06-18 20:12:05 +00:00
Marshall Clow d3e2a76ca4 Added accessors for getting coff_relocation info
llvm-svn: 158675
2012-06-18 19:47:16 +00:00
Jim Grosbach cb540f5cff ARM: Define generic HINT instruction.
The NOP, WFE, WFI, SEV and YIELD instructions are all hints w/
a different immediate value in bits [7,0]. Define a generic HINT
instruction and refactor NOP, WFI, WFI, SEV and YIELD to be
assembly aliases of that.

rdar://11600518

llvm-svn: 158674
2012-06-18 19:45:50 +00:00
Jim Grosbach 9ec06a15d6 TableGen: AsmMatcher missing-features list minimization.
When returning a 'cannot match due to missing CPU features' error code,
if there are multiple potential matches with different feature sets,
return the smallest set of missing features from the alternatives as
that's most likely to be the one that's desired.

llvm-svn: 158673
2012-06-18 19:45:46 +00:00
Simon Atanasyan 15c4aed428 Add mipsel-* to the list of targets recognized by configure script.
llvm-svn: 158670
2012-06-18 19:06:25 +00:00
Joerg Sonnenberger 8524f0ba2f Declare some variables unsigned to avoid signed vs unsigned mismatches.
This exploits the relative order of the arguments and/or checks already
made in the functions.

llvm-svn: 158669
2012-06-18 18:51:13 +00:00
James Dennett 7b33767275 Documentation cleanup:
* Escaped "::" where needed to prevent Doxygen trying to make links;
* Updated one mention of C++0x to refer to C++11;
* Fixed a \brief summary to make it somewhat concise.

llvm-svn: 158667
2012-06-18 18:42:20 +00:00
Jordan Rose edff020011 Allow internal decls in inline functions if the function is in the main file.
This handles the very common case of people writing inline functions in their
main source files and not tagging them as inline. These cases should still
behave as the user intended. (The diagnostic is still emitted as an extension.)

I'm reworking this code anyway to account for C++'s equivalent restriction in
[basic.def.odr]p6, but this should get some bots back to green.

llvm-svn: 158666
2012-06-18 17:49:58 +00:00
Fariborz Jahanian 9563a053de document _has_feature(objc_default_synthesize_properties).
// rdar://11676972

llvm-svn: 158665
2012-06-18 17:13:17 +00:00
Michael J. Spencer e2f493604a [VS Toolchain] Correctly forward -l linker inputs to link.exe.
Patch by Nikola Smiljanic!

llvm-svn: 158664
2012-06-18 16:56:04 +00:00
Nuno Lopes e881ce2ef6 fix PR13071 / rdar://problem/11634669 :
crash on invalid function decl with alloc_size attribute

llvm-svn: 158663
2012-06-18 16:39:04 +00:00
Nuno Lopes e44e93aa6b alloc_size attribute: there's nothing wrong with alloc_size(1,1). It just means the function allocates x^2 bytes. GCC also accepts this syntax
llvm-svn: 158662
2012-06-18 16:27:56 +00:00
Alexis Hunt a0e54d453b Handle C++11 attribute namespaces automatically.
Now, as long as the 'Namespaces' variable is correct inside Attr.td, the
generated code will correctly admit a C++11 attribute only when it has the
appropriate namespace(s).

llvm-svn: 158661
2012-06-18 16:13:52 +00:00
Nuno Lopes b7c941bad9 add the 'alloc' metadata node to represent the size of offset of buffers pointed to by pointers.
This metadata can be attached to any instruction returning a pointer

llvm-svn: 158660
2012-06-18 16:04:04 +00:00
Joel Jones 3237ce737e This change handles a another case for generating the bic instruction
when a compile time constant is known.  This occurs when implicitly zero 
extending function arguments from 16 bits to 32 bits.  The 8 bit case doesn't
need to be handled, as the 8 bit constants are encoded directly, thereby
not needing a separate load instruction to form the constant into a register.

<rdar://problem/11481151>

llvm-svn: 158659
2012-06-18 14:51:32 +00:00
Alexey Samsonov 8516014790 [Sanitizer] add internal_strncmp to sanitizer libc
llvm-svn: 158658
2012-06-18 14:34:59 +00:00
Alexey Samsonov cf7d233ac0 [TSan] kill some linux-specific code in favor of code in common runtime: reuse wrappers for mmap routines, ProcessMaps iterator, thread stack calculation
llvm-svn: 158657
2012-06-18 09:42:39 +00:00
Chandler Carruth a1da0bf5ef Add a regression test for the bug exposed by r158087, which has been
temporarily reverted.

This test is annoyingly overspecified, but I don't know of another way
to thoroughly test the saving and restoring of the registers. While this
will have to be adjusted even with the issue fixed in order to re-apply
r158087, those adjustments should very clearly indicate that it is still
correct (%esp getting restored prior to pops), whereas without it, this
case can easily slip under the radar.

Still, any suggestions for improvements are very welcome.

All credit to Matt Beaumont-Gay for reducing this out of an insane
Address Sanitizer crash to a reasonably small seg-faulting C program
when built with -mstackrealign. I just reduced it to IR, which was much
simpler. =]

llvm-svn: 158656
2012-06-18 09:15:04 +00:00
Alexey Samsonov 58a3c58ec9 [Sanitizer] move different wrappers from TSan to common sanitizer runtime
llvm-svn: 158655
2012-06-18 08:44:30 +00:00
Chandler Carruth 2cc11fd8c7 Temporarily revert r158087.
This patch causes problems when both dynamic stack realignment and
dynamic allocas combine in the same function. With this patch, we no
longer build the epilog correctly, and silently restore registers from
the wrong position in the stack.

Thanks to Matt for tracking this down, and getting at least an initial
test case to Chad. I'm going to try to check a variation of that test
case in so we can easily track the fixes required.

llvm-svn: 158654
2012-06-18 07:03:12 +00:00
Michael J. Spencer f97bd8c9cb [MSExtensions] Add support for __forceinline.
__forceinline is a combination of the inline keyword and __attribute__((always_inline))

llvm-svn: 158653
2012-06-18 07:00:48 +00:00
Richard Smith 7b3f322517 Extend the error recovery for a template-argument-list terminated by '>>' to
also deal with '>>>' (in CUDA), '>=', and '>>='. Fix the FixItHints logic to
deal with cases where the token is followed by an adjacent '=', '==', '>=',
'>>=', or '>>>' token, where a naive fix-it would result in a differing token
stream on a re-lex.

llvm-svn: 158652
2012-06-18 06:11:04 +00:00
Joerg Sonnenberger 5c98e1fb24 Don't warn about address-to-member used as part of initialisation, if
the member expression is in parentheses.

llvm-svn: 158651
2012-06-17 23:10:39 +00:00
NAKAMURA Takumi e0d4a7c5be TableGen.cmake: Fix to work without LLVM_COMMON_DEPENDS.
llvm-svn: 158650
2012-06-17 15:41:56 +00:00
NAKAMURA Takumi f32f4f46b4 diagtool/CMakeLists.txt: Add missing tblgen'd dependency, ClangDiagnosticIndexName.
llvm-svn: 158649
2012-06-17 15:41:44 +00:00
Benjamin Kramer a520de10c9 For reasons I can't fathom MSVC supports ULL but not LLU suffixes on long long integer literals.
llvm-svn: 158648
2012-06-17 14:53:53 +00:00
Benjamin Kramer 6bc197e4cd Add missing unittest files to the cmake build.
llvm-svn: 158647
2012-06-17 14:42:49 +00:00
Benjamin Kramer ae7f793785 Remove SmallMap unittests, unbreaking the build.
I don't know how useful these are for SmallDenseMap, I'll leave that decision to Chandler.

llvm-svn: 158646
2012-06-17 12:46:18 +00:00
Benjamin Kramer 23a9c3e090 Bring the return value of SmallVector::insert in line with std::vector::insert.
It always returns the iterator for the first inserted element, or the passed in
iterator if the inserted range was empty. Flesh out the unit test more and fix
all the cases it uncovered so far.

llvm-svn: 158645
2012-06-17 12:46:13 +00:00