platform/upstream/llvm.git
12 years agoAdd permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs and...
Nick Kledzik [Wed, 20 Jun 2012 00:28:54 +0000 (00:28 +0000)]
Add permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs and add unit test. Unix is implemented.  Windows side needs to be implemented.

llvm-svn: 158770

12 years agoDon't assert when given an empty range.
Kaelyn Uhrain [Wed, 20 Jun 2012 00:16:40 +0000 (00:16 +0000)]
Don't assert when given an empty range.

llvm::RawMemoryObject handles empty ranges just fine, and the assert can
be triggered in the wild by e.g. invoking clang with a file that
included an empty pre-compiled header file when clang has been built
with assertions enabled. Without assertions enabled, clang will properly
report that the empty file is not a valid PCH.

llvm-svn: 158769

12 years agoDo a second lookup for type_info in the global namespace in microsoft mode. PR13153.
Nico Weber [Tue, 19 Jun 2012 23:58:27 +0000 (23:58 +0000)]
Do a second lookup for type_info in the global namespace in microsoft mode. PR13153.

llvm-svn: 158768

12 years agoReapply r158700 and fixup patches, minus one hunk that slipped through and
Alexis Hunt [Tue, 19 Jun 2012 23:57:03 +0000 (23:57 +0000)]
Reapply r158700 and fixup patches, minus one hunk that slipped through and
caused a crash in an obscure case. On the plus side, it caused me to catch
another bug by inspection.

llvm-svn: 158767

12 years agoAdd regunit liveness support to LiveIntervals::handleMove().
Jakob Stoklund Olesen [Tue, 19 Jun 2012 23:50:18 +0000 (23:50 +0000)]
Add regunit liveness support to LiveIntervals::handleMove().

When LiveIntervals is tracking fixed interference in regunits, make sure
to update those intervals as well. Currently guarded by -live-regunits.

llvm-svn: 158766

12 years agoAlphabetize.
Bill Wendling [Tue, 19 Jun 2012 23:47:58 +0000 (23:47 +0000)]
Alphabetize.

llvm-svn: 158764

12 years agoDo not crash when we dynamic cast a final type to void*.
Alexis Hunt [Tue, 19 Jun 2012 23:44:55 +0000 (23:44 +0000)]
Do not crash when we dynamic cast a final type to void*.

llvm-svn: 158763

12 years agoTidy up.
Chad Rosier [Tue, 19 Jun 2012 23:37:57 +0000 (23:37 +0000)]
Tidy up.

llvm-svn: 158762

12 years agoThread Safety Analysis: Move some warnings on thread safety
DeLesley Hutchins [Tue, 19 Jun 2012 23:25:19 +0000 (23:25 +0000)]
Thread Safety Analysis:  Move some warnings on thread safety
attributes into the ThreadSafetyAttributes group, where the other
warnings currently live.

llvm-svn: 158761

12 years agoExtend the support for cl-std to include 1.2.
Tanya Lattner [Tue, 19 Jun 2012 23:09:52 +0000 (23:09 +0000)]
Extend the support for cl-std to include 1.2.
Add error checking for the static qualifier which is now allowed in certain situations for OpenCL 1.2. Use the CL version to turn on this feature.
Added test case for 1.2 static storage class feature.

llvm-svn: 158759

12 years agoAdd an ensureMaxAlignment() function to MachineFrameInfo (analogous to
Chad Rosier [Tue, 19 Jun 2012 22:59:12 +0000 (22:59 +0000)]
Add an ensureMaxAlignment() function to MachineFrameInfo (analogous to
ensureAlignment() in MachineFunction).  Also, drop setMaxAlignment() in
favor of this new function.  This creates a main entry point to setting
MaxAlignment, which will be helpful for future work.  No functionality
change intended.

llvm-svn: 158758

12 years agoAdd DAG-combines for aggressive FMA formation.
Lang Hames [Tue, 19 Jun 2012 22:51:23 +0000 (22:51 +0000)]
Add DAG-combines for aggressive FMA formation.

This patch adds DAG combines to form FMAs from pairs of FADD + FMUL or
FSUB + FMUL. The combines are performed when:
(a) Either
      AllowExcessFPPrecision option (-enable-excess-fp-precision for llc)
        OR
      UnsafeFPMath option (-enable-unsafe-fp-math)
    are set, and
(b) TargetLoweringInfo::isFMAFasterThanMulAndAdd(VT) is true for the type of
    the FADD/FSUB, and
(c) The FMUL only has one user (the FADD/FSUB).

If your target has fast FMA instructions you can make use of these combines by
overriding TargetLoweringInfo::isFMAFasterThanMulAndAdd(VT) to return true for
types supported by your FMA instruction, and adding patterns to match ISD::FMA
to your FMA instructions.

llvm-svn: 158757

12 years agoobjective-c: warn when autosynthesizing a property which has same
Fariborz Jahanian [Tue, 19 Jun 2012 22:51:22 +0000 (22:51 +0000)]
objective-c: warn when autosynthesizing a property which has same
name as an existing ivar since this is common source of error
when people remove @synthesize to take advantage of autosynthesis.
// rdar://11671080

llvm-svn: 158756

12 years ago80 col.
Jakob Stoklund Olesen [Tue, 19 Jun 2012 22:50:53 +0000 (22:50 +0000)]
80 col.

llvm-svn: 158755

12 years agoTypo. Patch by Cameron McInally <cameron.mcinally@nyu.edu>.
Chad Rosier [Tue, 19 Jun 2012 22:28:18 +0000 (22:28 +0000)]
Typo. Patch by Cameron McInally <cameron.mcinally@nyu.edu>.

llvm-svn: 158754

12 years agoAdd Projects.rst to the toctree.
Bill Wendling [Tue, 19 Jun 2012 22:25:41 +0000 (22:25 +0000)]
Add Projects.rst to the toctree.

llvm-svn: 158753

12 years agoUse correct capitalization.
Bill Wendling [Tue, 19 Jun 2012 22:25:17 +0000 (22:25 +0000)]
Use correct capitalization.

llvm-svn: 158752

12 years agoChnage VerifyWatchpointIDs() from a static function to a class function to be called...
Johnny Chen [Tue, 19 Jun 2012 22:12:58 +0000 (22:12 +0000)]
Chnage VerifyWatchpointIDs() from a static function to a class function to be called from other source files.

llvm-svn: 158751

12 years agoReapplying the changes from r158717 as they were rolled back to avoid merge conflicts...
Aaron Ballman [Tue, 19 Jun 2012 22:09:27 +0000 (22:09 +0000)]
Reapplying the changes from r158717 as they were rolled back to avoid merge conflicts from a separate problematic patch.

llvm-svn: 158750

12 years agoRevert r158700 and dependent patches r158716, r158717, and r158731.
Jakob Stoklund Olesen [Tue, 19 Jun 2012 21:48:43 +0000 (21:48 +0000)]
Revert r158700 and dependent patches r158716, r158717, and r158731.

The original r158700 caused crashes in the gcc test suite,
g++.abi/vtable3a.C among others. It also caused failures in the libc++
test suite.

llvm-svn: 158749

12 years agoAdd a triple.
Jakob Stoklund Olesen [Tue, 19 Jun 2012 21:46:25 +0000 (21:46 +0000)]
Add a triple.

The test was failing on Linux because of asm syntax differences.

llvm-svn: 158748

12 years agoFix -Wc++11-narrowing warnings for narrowing negative values to larger unsigned
Richard Smith [Tue, 19 Jun 2012 21:28:35 +0000 (21:28 +0000)]
Fix -Wc++11-narrowing warnings for narrowing negative values to larger unsigned
types to actually includes the value, rather than saying <uninitialized>.

llvm-svn: 158745

12 years agoEnable -Wnull-conversion for non-integral target types (eg: double).
David Blaikie [Tue, 19 Jun 2012 21:19:06 +0000 (21:19 +0000)]
Enable -Wnull-conversion for non-integral target types (eg: double).

llvm-svn: 158744

12 years agoImplement PPCInstrInfo::isCoalescableExtInstr().
Jakob Stoklund Olesen [Tue, 19 Jun 2012 21:14:34 +0000 (21:14 +0000)]
Implement PPCInstrInfo::isCoalescableExtInstr().

The PPC::EXTSW instruction preserves the low 32 bits of its input, just
like some of the x86 instructions. Use it to reduce register pressure
when the low 32 bits have multiple uses.

This requires a small change to PeepholeOptimizer since EXTSW takes a
64-bit input register.

This is related to PR5997.

llvm-svn: 158743

12 years agoStyle: Don't reuse variables for multiple purposes.
Jakob Stoklund Olesen [Tue, 19 Jun 2012 21:10:18 +0000 (21:10 +0000)]
Style: Don't reuse variables for multiple purposes.

No functional change.

llvm-svn: 158742

12 years agoDocumentation cleanup: escape "::", and other minor reformatting
James Dennett [Tue, 19 Jun 2012 21:05:49 +0000 (21:05 +0000)]
Documentation cleanup: escape "::", and other minor reformatting

llvm-svn: 158741

12 years agoDocumentation cleanup: add \verbatim markup for grammar productions
James Dennett [Tue, 19 Jun 2012 21:04:25 +0000 (21:04 +0000)]
Documentation cleanup: add \verbatim markup for grammar productions

llvm-svn: 158740

12 years agoDocumentation cleanup: fixing file headers to use Doxygen \file markup while
James Dennett [Tue, 19 Jun 2012 21:02:26 +0000 (21:02 +0000)]
Documentation cleanup: fixing file headers to use Doxygen \file markup while
also being sufficiently conformant to LLVM's coding standards.

llvm-svn: 158739

12 years agoobjc-arc: captured block variable accessed in its block literal
Fariborz Jahanian [Tue, 19 Jun 2012 20:53:26 +0000 (20:53 +0000)]
objc-arc: captured block variable accessed in its block literal
initializer need be null initialized before initializer takes
hold, just like any other initialized retainable object pointer.
// rdar://11016025

llvm-svn: 158738

12 years agoTest suite cleanup: use Python API to remove files as part of cleanup instead of...
Johnny Chen [Tue, 19 Jun 2012 20:29:50 +0000 (20:29 +0000)]
Test suite cleanup: use Python API to remove files as part of cleanup instead of running OS commands.

llvm-svn: 158737

12 years agoAdjust scan-build to enable color output for xterm-256color.
Ted Kremenek [Tue, 19 Jun 2012 19:27:28 +0000 (19:27 +0000)]
Adjust scan-build to enable color output for xterm-256color.

llvm-svn: 158735

12 years ago[driver] Per Bob's suggestion, emphasize the file dumps.
Chad Rosier [Tue, 19 Jun 2012 18:39:21 +0000 (18:39 +0000)]
[driver] Per Bob's suggestion, emphasize the file dumps.
rdar://11684107

llvm-svn: 158734

12 years agoRemove some debugging code that snuck into r158691.
Kaelyn Uhrain [Tue, 19 Jun 2012 18:38:00 +0000 (18:38 +0000)]
Remove some debugging code that snuck into r158691.

llvm-svn: 158733

12 years agoRevert predefined decl tracking.
Meador Inge [Tue, 19 Jun 2012 18:17:30 +0000 (18:17 +0000)]
Revert predefined decl tracking.

r158085 added some logic to track predefined declarations.  The main reason we
had predefined declarations in the input was because the __builtin_va_list
declarations were injected into the preprocessor input.  As of r158592 we
explicitly build the __builtin_va_list declarations.  Therefore the predefined
decl tracking is no longer needed.

llvm-svn: 158732

12 years agoRemove redundant uses of SmallString
Alexis Hunt [Tue, 19 Jun 2012 18:12:18 +0000 (18:12 +0000)]
Remove redundant uses of SmallString

llvm-svn: 158731

12 years agoNew test tool: obj2yaml
Marshall Clow [Tue, 19 Jun 2012 18:02:35 +0000 (18:02 +0000)]
New test tool: obj2yaml

llvm-svn: 158730

12 years ago[driver] Print the compiler version before the diagnostic messages.
Chad Rosier [Tue, 19 Jun 2012 17:51:34 +0000 (17:51 +0000)]
[driver] Print the compiler version before the diagnostic messages.

llvm-svn: 158729

12 years agoIndent coding examples.
Bill Wendling [Tue, 19 Jun 2012 17:48:06 +0000 (17:48 +0000)]
Indent coding examples.

llvm-svn: 158728

12 years ago[driver] Make the crash diagnostic message more visable. Bug reports are being
Chad Rosier [Tue, 19 Jun 2012 17:48:02 +0000 (17:48 +0000)]
[driver] Make the crash diagnostic message more visable.  Bug reports are being
filed, but still missing the preprocessed source and associated run script.
rdar://11684107

llvm-svn: 158727

12 years agoRemove bad HTML tags. Add missing :.
Bill Wendling [Tue, 19 Jun 2012 17:43:57 +0000 (17:43 +0000)]
Remove bad HTML tags. Add missing :.

llvm-svn: 158726

12 years agoFix PR13148, an inf-loop in StringMap.
Chandler Carruth [Tue, 19 Jun 2012 17:40:35 +0000 (17:40 +0000)]
Fix PR13148, an inf-loop in StringMap.

StringMap suffered from the same bug as DenseMap: when you explicitly
construct it with a small number of buckets, you can arrange for the
tombstone-based growth path to be followed when the number of buckets
was less than '8'. In that case, even with a full map, it would compare
'0' as not less than '0', and refuse to grow the table, leading to
inf-loops trying to find an empty bucket on the next insertion. The fix
is very simple: use '<=' as the comparison. The same fix was applied to
DenseMap as well during its recent refactoring.

Thanks to Alex Bolz for the great report and test case. =]

llvm-svn: 158725

12 years agoRemove some superfluous SCOPED_TRACEs from this unit test.
Chandler Carruth [Tue, 19 Jun 2012 17:40:29 +0000 (17:40 +0000)]
Remove some superfluous SCOPED_TRACEs from this unit test.

GoogleTest already prints errors with all the information about which
test case contained the error.

llvm-svn: 158724

12 years agoEmit TableGen's header comment with C-style comments, so it can be used from C89...
Benjamin Kramer [Tue, 19 Jun 2012 17:04:16 +0000 (17:04 +0000)]
Emit TableGen's header comment with C-style comments, so it can be used from C89 code.

Should silence warnings when compiling the X86 disassembler.

llvm-svn: 158723

12 years agoHave ARM ELF use correct reloc for "b" instr.
Jan Wen Voung [Tue, 19 Jun 2012 16:03:02 +0000 (16:03 +0000)]
Have ARM ELF use correct reloc for "b" instr.

The condition code didn't actually matter for arm "b" instructions,
unlike "bl".  It should just use the R_ARM_JUMP24 reloc.

llvm-svn: 158722

12 years agoMark most PPC register classes to avoid write-after-write.
Hal Finkel [Tue, 19 Jun 2012 13:57:17 +0000 (13:57 +0000)]
Mark most PPC register classes to avoid write-after-write.

For processors with the G5-like instruction-grouping scheme, this helps avoid
early group termination due to a write-after-write dependency within the group.
It should also help on pipelined embedded cores.

On POWER7, over the test suite, this gives an average 0.5% speedup. The largest
speedups are:

SingleSource/Benchmarks/Stanford/Quicksort - 33%
MultiSource/Applications/d/make_dparser - 21%
MultiSource/Benchmarks/FreeBench/analyzer/analyzer - 12%
MultiSource/Benchmarks/MiBench/telecomm-FFT/telecomm-fft - 12%

Largest slowdowns:

SingleSource/Benchmarks/Stanford/Bubblesort - 23%
MultiSource/Benchmarks/Prolangs-C++/city/city - 21%
MultiSource/Benchmarks/BitBench/uuencode/uuencode - 16%
MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec/mpeg2decode - 13%

llvm-svn: 158719

12 years agoUpdating the credits after r158717
Aaron Ballman [Tue, 19 Jun 2012 13:52:33 +0000 (13:52 +0000)]
Updating the credits after r158717

llvm-svn: 158718

12 years agoImproves parsing and semantic analysis for MS __declspec attributes. This includes...
Aaron Ballman [Tue, 19 Jun 2012 13:49:26 +0000 (13:49 +0000)]
Improves parsing and semantic analysis for MS __declspec attributes.  This includes support for the align (which fixes PR12631).

llvm-svn: 158717

12 years agoStop abusing StringRef. Fixes the Windows build.
Alexis Hunt [Tue, 19 Jun 2012 13:36:02 +0000 (13:36 +0000)]
Stop abusing StringRef. Fixes the Windows build.

I've also removed the duplicate check for PARSED_ATTR since it seems
unnecessary, and would have made the code more complicated.

llvm-svn: 158716

12 years agoPut flag names on one line.
Bill Wendling [Tue, 19 Jun 2012 09:29:05 +0000 (09:29 +0000)]
Put flag names on one line.

llvm-svn: 158715

12 years agoFix italicized text.
Bill Wendling [Tue, 19 Jun 2012 09:27:54 +0000 (09:27 +0000)]
Fix italicized text.

llvm-svn: 158714

12 years agoUse correct URL.
Bill Wendling [Tue, 19 Jun 2012 09:26:15 +0000 (09:26 +0000)]
Use correct URL.

llvm-svn: 158713

12 years agoFix numbering of list items.
Bill Wendling [Tue, 19 Jun 2012 09:25:04 +0000 (09:25 +0000)]
Fix numbering of list items.

llvm-svn: 158712

12 years agoFix some Sphinx mistakes.
Bill Wendling [Tue, 19 Jun 2012 09:23:23 +0000 (09:23 +0000)]
Fix some Sphinx mistakes.

llvm-svn: 158711

12 years ago[Sanitizer] Renaming: SNPrintf -> internal_snprintf (and move it to sanitizer libc)
Alexey Samsonov [Tue, 19 Jun 2012 09:21:57 +0000 (09:21 +0000)]
[Sanitizer] Renaming: SNPrintf -> internal_snprintf (and move it to sanitizer libc)

llvm-svn: 158710

12 years agoFirst attempt at Sphinx. Convert the Projects.html file to Sphinx format.
Bill Wendling [Tue, 19 Jun 2012 09:18:34 +0000 (09:18 +0000)]
First attempt at Sphinx. Convert the Projects.html file to Sphinx format.

llvm-svn: 158709

12 years ago[TSan] Add a comment that tsan_flags.h may be included in the user code, and therefor...
Alexey Samsonov [Tue, 19 Jun 2012 08:57:53 +0000 (08:57 +0000)]
[TSan] Add a comment that tsan_flags.h may be included in the user code, and therefore shouldn't include other headers from TSan or common sanitizer runtime. User may need tsan_flags.h to provide its implementation of __tsan::OverrideFlags

llvm-svn: 158708

12 years ago[Sanitizer] State that sanitizer_libc.h header can be included in the user code ...
Alexey Samsonov [Tue, 19 Jun 2012 08:52:02 +0000 (08:52 +0000)]
[Sanitizer] State that sanitizer_libc.h header can be included in the user code (and therefore it shouldn't include other sanitizer runtime headers).

llvm-svn: 158707

12 years ago[Sanitizer] use fully qualified type for placement new replacement
Alexey Samsonov [Tue, 19 Jun 2012 07:40:45 +0000 (07:40 +0000)]
[Sanitizer] use fully qualified type for placement new replacement

llvm-svn: 158706

12 years ago[TSan] silence -Winternal-linkage-in-inlinewarning which is produced for gtest code
Alexey Samsonov [Tue, 19 Jun 2012 07:38:11 +0000 (07:38 +0000)]
[TSan] silence -Winternal-linkage-in-inlinewarning which is produced for gtest code

llvm-svn: 158705

12 years ago[Support/PathV2] Fix out of bounds access in identify_magic when the file is empty.
Michael J. Spencer [Tue, 19 Jun 2012 05:29:57 +0000 (05:29 +0000)]
[Support/PathV2] Fix out of bounds access in identify_magic when the file is empty.

llvm-svn: 158704

12 years ago[analyzer] Allow pointers to escape into NSPointerArray.
Anna Zaks [Tue, 19 Jun 2012 05:10:32 +0000 (05:10 +0000)]
[analyzer] Allow pointers to escape into NSPointerArray.
(Fixes radar://11691035 PR13140)

llvm-svn: 158703

12 years agoMake MipsLongBranch::runOnMachineFunction return true.
Akira Hatanaka [Tue, 19 Jun 2012 03:45:29 +0000 (03:45 +0000)]
Make MipsLongBranch::runOnMachineFunction return true.

llvm-svn: 158702

12 years agoUse MachineBasicBlock::instr_iterator instead of MachineBasicBlock::iterator in
Akira Hatanaka [Tue, 19 Jun 2012 03:39:45 +0000 (03:39 +0000)]
Use MachineBasicBlock::instr_iterator instead of MachineBasicBlock::iterator in
MipsCodeEmitter.cpp.

llvm-svn: 158701

12 years agoImprove the specification of spellings in Attr.td.
Alexis Hunt [Tue, 19 Jun 2012 03:39:03 +0000 (03:39 +0000)]
Improve the specification of spellings in Attr.td.

Note that this is mostly a structural patch that handles the change from the old
spelling style to the new one. One consequence of this is that all AT_foo_bar
enum values have changed to not be based off of the first spelling, but rather
off of the class name, so they are now AT_FooBar and the like (a straw poll on
IRC showed support for this). Apologies for code churn.

Most attributes have GNU spellings as a temporary solution until everything else
is sorted out (such as a Keyword spelling, which I intend to add if someone else
doesn't beat me to it). This is definitely a WIP.

I've also killed BaseCheckAttr since it was unused, and I had to go through
every attribute anyway.

llvm-svn: 158700

12 years agoFix the location of the fixit for -Wnewline-eof.
Jordan Rose [Tue, 19 Jun 2012 03:09:38 +0000 (03:09 +0000)]
Fix the location of the fixit for -Wnewline-eof.

It turns out SourceManager treating the "one-past-the-end" location as invalid,
but then failing to set the invalid flag properly.

llvm-svn: 158699

12 years agoAdd support for generating reg+reg preinc stores on PPC.
Hal Finkel [Tue, 19 Jun 2012 02:34:32 +0000 (02:34 +0000)]
Add support for generating reg+reg preinc stores on PPC.

PPC will now generate STWUX and friends.

llvm-svn: 158698

12 years ago[objcmt] When checking whether the subscripting methods are declared use
Argyrios Kyrtzidis [Tue, 19 Jun 2012 02:22:02 +0000 (02:22 +0000)]
[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

12 years agoreally add a triple :-(
Rafael Espindola [Tue, 19 Jun 2012 02:17:35 +0000 (02:17 +0000)]
really add a triple :-(

llvm-svn: 158696

12 years agoAdd a triple to the test.
Rafael Espindola [Tue, 19 Jun 2012 01:42:34 +0000 (01:42 +0000)]
Add a triple to the test.

llvm-svn: 158695

12 years agoAdd a -fuse-init-array option to cc1 and map to the UseInitArray target
Rafael Espindola [Tue, 19 Jun 2012 01:26:10 +0000 (01:26 +0000)]
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

12 years agordar://problem/11649610
Johnny Chen [Tue, 19 Jun 2012 00:56:55 +0000 (00:56 +0000)]
rdar://problem/11649610
lldb confused by single quote in executable path

Also add a test case.

llvm-svn: 158693

12 years agoMove the support for using .init_array from ARM to the generic
Rafael Espindola [Tue, 19 Jun 2012 00:48:28 +0000 (00:48 +0000)]
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

12 years agoImprove the error message when a function overload candidate is rejected
Kaelyn Uhrain [Tue, 19 Jun 2012 00:37:47 +0000 (00:37 +0000)]
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

12 years agoSink definition of IBOutlet, IBOutletCollection, and IBAction into
Ted Kremenek [Tue, 19 Jun 2012 00:37:39 +0000 (00:37 +0000)]
Sink definition of IBOutlet, IBOutletCollection, and IBAction into
the compiler predefines buffer.  These are essentially part of
the Objective-C language.

llvm-svn: 158690

12 years agoChange -Winternal-linkage-in-inline from ExtWarn to Warning in C++.
Jordan Rose [Mon, 18 Jun 2012 23:58:49 +0000 (23:58 +0000)]
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

12 years agorevert r158660, since Chris has some issues with this patch (namely using code to...
Nuno Lopes [Mon, 18 Jun 2012 23:34:26 +0000 (23:34 +0000)]
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

12 years agoXFAIL linker-opts.c on win32 now that it doesn't pretend that link.exe is ld.
Michael J. Spencer [Mon, 18 Jun 2012 23:00:44 +0000 (23:00 +0000)]
XFAIL linker-opts.c on win32 now that it doesn't pretend that link.exe is ld.

llvm-svn: 158687

12 years agoAdd language std for OpenCL 1.1 and 1.2.
Tanya Lattner [Mon, 18 Jun 2012 22:55:02 +0000 (22:55 +0000)]
Add language std for OpenCL 1.1 and 1.2.

llvm-svn: 158686

12 years agoDon't copy a potentially-uninitialized variable.
David Blaikie [Mon, 18 Jun 2012 22:31:28 +0000 (22:31 +0000)]
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

12 years agoARM: use NOEN loads and stores if possible when handling struct byval.
Manman Ren [Mon, 18 Jun 2012 22:23:48 +0000 (22:23 +0000)]
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

12 years agoSupport -Winternal-linkage-in-inline in C++ code.
Jordan Rose [Mon, 18 Jun 2012 22:09:19 +0000 (22:09 +0000)]
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

12 years agoAdd new tool 'diag-build' for showing enabled warnings in a project.
Jordan Rose [Mon, 18 Jun 2012 21:31:37 +0000 (21:31 +0000)]
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

12 years ago[analyzer] Add a comment: why we treat array compound literals as lvalues.
Jordan Rose [Mon, 18 Jun 2012 21:31:27 +0000 (21:31 +0000)]
[analyzer] Add a comment: why we treat array compound literals as lvalues.

llvm-svn: 158681

12 years agoAllow up to 64 functional units per processor itinerary.
Hal Finkel [Mon, 18 Jun 2012 21:08:18 +0000 (21:08 +0000)]
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

12 years agoFix Sphinx warning. Patch by Sean Silva
Nick Kledzik [Mon, 18 Jun 2012 20:24:47 +0000 (20:24 +0000)]
Fix Sphinx warning.  Patch by Sean Silva

llvm-svn: 158678

12 years ago[docs] Port FAQ over to Sphinx.
Michael J. Spencer [Mon, 18 Jun 2012 20:21:38 +0000 (20:21 +0000)]
[docs] Port FAQ over to Sphinx.

Patch by Mikael Lyngvig!

llvm-svn: 158677

12 years agoMove a few static functions from DiagnosticRenderer.cpp into SourceManager.
Matt Beaumont-Gay [Mon, 18 Jun 2012 20:12:05 +0000 (20:12 +0000)]
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

12 years agoAdded accessors for getting coff_relocation info
Marshall Clow [Mon, 18 Jun 2012 19:47:16 +0000 (19:47 +0000)]
Added accessors for getting coff_relocation info

llvm-svn: 158675

12 years agoARM: Define generic HINT instruction.
Jim Grosbach [Mon, 18 Jun 2012 19:45:50 +0000 (19:45 +0000)]
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

12 years agoTableGen: AsmMatcher missing-features list minimization.
Jim Grosbach [Mon, 18 Jun 2012 19:45:46 +0000 (19:45 +0000)]
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

12 years agoAdd mipsel-* to the list of targets recognized by configure script.
Simon Atanasyan [Mon, 18 Jun 2012 19:06:25 +0000 (19:06 +0000)]
Add mipsel-* to the list of targets recognized by configure script.

llvm-svn: 158670

12 years agoDeclare some variables unsigned to avoid signed vs unsigned mismatches.
Joerg Sonnenberger [Mon, 18 Jun 2012 18:51:13 +0000 (18:51 +0000)]
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

12 years agoDocumentation cleanup:
James Dennett [Mon, 18 Jun 2012 18:42:20 +0000 (18:42 +0000)]
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

12 years agoAllow internal decls in inline functions if the function is in the main file.
Jordan Rose [Mon, 18 Jun 2012 17:49:58 +0000 (17:49 +0000)]
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

12 years agodocument _has_feature(objc_default_synthesize_properties).
Fariborz Jahanian [Mon, 18 Jun 2012 17:13:17 +0000 (17:13 +0000)]
document _has_feature(objc_default_synthesize_properties).
// rdar://11676972

llvm-svn: 158665

12 years ago[VS Toolchain] Correctly forward -l linker inputs to link.exe.
Michael J. Spencer [Mon, 18 Jun 2012 16:56:04 +0000 (16:56 +0000)]
[VS Toolchain] Correctly forward -l linker inputs to link.exe.

Patch by Nikola Smiljanic!

llvm-svn: 158664

12 years agofix PR13071 / rdar://problem/11634669 :
Nuno Lopes [Mon, 18 Jun 2012 16:39:04 +0000 (16:39 +0000)]
fix PR13071 / rdar://problem/11634669 :
crash on invalid function decl with alloc_size attribute

llvm-svn: 158663

12 years agoalloc_size attribute: there's nothing wrong with alloc_size(1,1). It just means the...
Nuno Lopes [Mon, 18 Jun 2012 16:27:56 +0000 (16:27 +0000)]
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

12 years agoHandle C++11 attribute namespaces automatically.
Alexis Hunt [Mon, 18 Jun 2012 16:13:52 +0000 (16:13 +0000)]
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

12 years agoadd the 'alloc' metadata node to represent the size of offset of buffers pointed...
Nuno Lopes [Mon, 18 Jun 2012 16:04:04 +0000 (16:04 +0000)]
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