platform/upstream/llvm.git
11 years agoADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang on stage2, take two. [-Wsign...
NAKAMURA Takumi [Tue, 22 Jan 2013 10:39:31 +0000 (10:39 +0000)]
ADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang on stage2, take two. [-Wsign-compare]

llvm-svn: 173144

11 years ago[ASan] Remove the declarations of pthread_workqueue_t and pthread_workitem_handle_t...
Alexander Potapenko [Tue, 22 Jan 2013 10:32:06 +0000 (10:32 +0000)]
[ASan] Remove the declarations of pthread_workqueue_t and pthread_workitem_handle_t, which are used no more.
Kudos to Jeremy Huddleston Sequoia <jeremyhu@apple.com>

llvm-svn: 173143

11 years agoASan: use Clang -fsanitize-blacklist flag in unit tests (instead of -mllvm)
Alexey Samsonov [Tue, 22 Jan 2013 10:30:17 +0000 (10:30 +0000)]
ASan: use Clang -fsanitize-blacklist flag in unit tests (instead of -mllvm)

llvm-svn: 173142

11 years agoFix missed out llvm-stress after APFloat change.
Tim Northover [Tue, 22 Jan 2013 10:18:26 +0000 (10:18 +0000)]
Fix missed out llvm-stress after APFloat change.

llvm-svn: 173141

11 years ago[ASan] Fix the path to ASan interface in interface_symbols_linux.c
Alexander Potapenko [Tue, 22 Jan 2013 10:13:37 +0000 (10:13 +0000)]
[ASan] Fix the path to ASan interface in interface_symbols_linux.c

llvm-svn: 173140

11 years agoSwitch to APFloat constructor taking fltSemantics.
Tim Northover [Tue, 22 Jan 2013 09:46:51 +0000 (09:46 +0000)]
Switch to APFloat constructor taking fltSemantics.

This change also makes the serialisation store the required semantics,
fixing an issue where PPC128 was always assumed when re-reading a
128-bit value.

llvm-svn: 173139

11 years agoMake APFloat constructor require explicit semantics.
Tim Northover [Tue, 22 Jan 2013 09:46:31 +0000 (09:46 +0000)]
Make APFloat constructor require explicit semantics.

Previously we tried to infer it from the bit width size, with an added
IsIEEE argument for the PPC/IEEE 128-bit case, which had a default
value. This default value allowed bugs to creep in, where it was
inappropriate.

llvm-svn: 173138

11 years ago[ASan] Fixed darwin-sanitizer-ld.c to match the flags after the switch to the dynamic...
Alexander Potapenko [Tue, 22 Jan 2013 09:27:00 +0000 (09:27 +0000)]
[ASan] Fixed darwin-sanitizer-ld.c to match the flags after the switch to the dynamic runtime.

llvm-svn: 173137

11 years ago[ASan] Moved interface_symbols.c to lit_tests/Linux.
Alexander Potapenko [Tue, 22 Jan 2013 09:22:10 +0000 (09:22 +0000)]
[ASan] Moved interface_symbols.c to lit_tests/Linux.
We already have Darwin-specific version of this test.

llvm-svn: 173136

11 years ago[ASan] Link with the dynamic runtime on OS X
Alexander Potapenko [Tue, 22 Jan 2013 09:16:03 +0000 (09:16 +0000)]
[ASan] Link with the dynamic runtime on OS X
This patch changes the behavior of the -fsanitize=address flag, making it use the dynamic runtime library (libclang_rt.asan_osx_dynamic.dylib) instead of the static one. It also drops the CoreFoundation dependency, since the dynamic runtime doesn't need it.

llvm-svn: 173135

11 years ago[ASan] Use dylib interposition to hook memory allocation in the dynamic runtime.
Alexander Potapenko [Tue, 22 Jan 2013 09:14:54 +0000 (09:14 +0000)]
[ASan] Use dylib interposition to hook memory allocation in the dynamic runtime.
This CL drastically simplifies the way we're hooking the memory allocation routines in ASan on Mac by using dylib interposition to replace the main malloc_zone_* functions. This allows us to avoid replacing the default CFAllocator and drop the CF dependency at all.

Committing this patch will result in the static runtime being broken. A follow-up CL will switch ASan to use the dynamic runtime library.

llvm-svn: 173134

11 years agoASan: simplify build rules for unit tests
Alexey Samsonov [Tue, 22 Jan 2013 07:31:28 +0000 (07:31 +0000)]
ASan: simplify build rules for unit tests

llvm-svn: 173133

11 years agoASan: disable flexible mapping and offset on Android. It doesn't work for dynamic...
Alexey Samsonov [Tue, 22 Jan 2013 07:21:24 +0000 (07:21 +0000)]
ASan: disable flexible mapping and offset on Android. It doesn't work for dynamic ASan runtime there

llvm-svn: 173132

11 years ago[asan] split asan_test.cc even more
Kostya Serebryany [Tue, 22 Jan 2013 07:01:47 +0000 (07:01 +0000)]
[asan] split asan_test.cc even more

llvm-svn: 173131

11 years ago[asan] split asan_test.cc more
Kostya Serebryany [Tue, 22 Jan 2013 06:50:42 +0000 (06:50 +0000)]
[asan] split asan_test.cc more

llvm-svn: 173130

11 years ago[asan] split asan_test.cc to speedup parallel build (most important if building with...
Kostya Serebryany [Tue, 22 Jan 2013 06:39:20 +0000 (06:39 +0000)]
[asan] split asan_test.cc to speedup parallel build (most important if building with a debug clang, which takes a couple of minutes on this large file with templates). More splits to follow

llvm-svn: 173129

11 years agoSparseMultiSet.h: Add suggested parentheses.
NAKAMURA Takumi [Tue, 22 Jan 2013 05:41:57 +0000 (05:41 +0000)]
SparseMultiSet.h: Add suggested parentheses.

llvm-svn: 173128

11 years agoADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang (libstdc++-4.5) on stage2...
NAKAMURA Takumi [Tue, 22 Jan 2013 05:30:15 +0000 (05:30 +0000)]
ADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang (libstdc++-4.5) on stage2. [-Wsign-compare]

llvm-svn: 173127

11 years agoThis test is only supposed to test that the objc-arc alias analysis
Michael Gottesman [Tue, 22 Jan 2013 04:41:11 +0000 (04:41 +0000)]
This test is only supposed to test that the objc-arc alias analysis
allows for gvn to perform certain optimizations. Thus the runline should
only contain -objc-arc-aa, not the full -objc-arc.

llvm-svn: 173126

11 years agoit looks like g++ 4.7.2 doesnot like bit fields when the type is a enumeration (Throw...
Shankar Easwaran [Tue, 22 Jan 2013 04:12:03 +0000 (04:12 +0000)]
it looks like g++ 4.7.2 doesnot like bit fields when the type is a enumeration (Throws an error as bit-field with non integral type)

llvm-svn: 173125

11 years agolibclang: Update comment about USEDLIBS in c-*-test/Makefile.
NAKAMURA Takumi [Tue, 22 Jan 2013 04:11:33 +0000 (04:11 +0000)]
libclang: Update comment about USEDLIBS in c-*-test/Makefile.

"Note that 'USEDLIBS' must include all of the core clang libraries when -static is given to linker on cygming."

llvm-svn: 173124

11 years agoErrorOrTest.cpp: Check existence of EXPECT_DEBUG_DEATH. It is not always available.
NAKAMURA Takumi [Tue, 22 Jan 2013 04:02:41 +0000 (04:02 +0000)]
ErrorOrTest.cpp: Check existence of EXPECT_DEBUG_DEATH. It is not always available.

llvm-svn: 173123

11 years agoUse the correct field to copy/dispose a __block variable.
John McCall [Tue, 22 Jan 2013 03:56:22 +0000 (03:56 +0000)]
Use the correct field to copy/dispose a __block variable.

We were previously hard-coding a particular field index.  This was
fine before (because we were obviously guaranteed the presence
of a copy/dispose member) except for (1) alignment padding and
(2) future extensions adding extra members to the header, such
as the extended-layout pointer.

Note that we only introduce the extended-layout pointer in the
presence of structs.  (We also seem to be introducing it even
in the presence of an all-non-object layout, but that's a
different potential issue.)

llvm-svn: 173122

11 years agoclang/test/Index/comment-to-html-xml-conversion.cpp: Mark this as XFAIL:valgrind...
NAKAMURA Takumi [Tue, 22 Jan 2013 03:49:16 +0000 (03:49 +0000)]
clang/test/Index/comment-to-html-xml-conversion.cpp: Mark this as XFAIL:valgrind, for now. Working in progress.

llvm-svn: 173121

11 years ago[MC/Mach-O] Load commands are supposed to 8-byte aligned on 64-bit.
Daniel Dunbar [Tue, 22 Jan 2013 03:42:49 +0000 (03:42 +0000)]
[MC/Mach-O] Load commands are supposed to 8-byte aligned on 64-bit.

llvm-svn: 173120

11 years agolldb.thread is not to be used anymore
Enrico Granata [Tue, 22 Jan 2013 02:32:56 +0000 (02:32 +0000)]
lldb.thread is not to be used anymore

llvm-svn: 173119

11 years agoQuick fix to make LLDB TOT work with Clang TOT.
Sean Callanan [Tue, 22 Jan 2013 02:20:20 +0000 (02:20 +0000)]
Quick fix to make LLDB TOT work with Clang TOT.
Avoids an error about an ambiguous constructor
call.

llvm-svn: 173118

11 years agoAdd {,ELF,MachO}TargetInfo.
Michael J. Spencer [Tue, 22 Jan 2013 02:15:30 +0000 (02:15 +0000)]
Add {,ELF,MachO}TargetInfo.

llvm-svn: 173117

11 years agoclang/test: [CMake] check-clang doesn't require llvm-dis any more.
NAKAMURA Takumi [Tue, 22 Jan 2013 01:52:04 +0000 (01:52 +0000)]
clang/test: [CMake] check-clang doesn't require llvm-dis any more.

llvm-svn: 173116

11 years agoclang/test/CodeGen: Nuke llvm's opt and llvm-dis, and FileCheck-ize two tests. -O1...
NAKAMURA Takumi [Tue, 22 Jan 2013 01:51:59 +0000 (01:51 +0000)]
clang/test/CodeGen: Nuke llvm's opt and llvm-dis, and FileCheck-ize two tests. -O1 is sufficient here.

llvm-svn: 173115

11 years agoclang/test/CodeGen/2006-01-13-StackSave.c: Nuke llvm's opt and llvm-dis, and FileChec...
NAKAMURA Takumi [Tue, 22 Jan 2013 01:51:54 +0000 (01:51 +0000)]
clang/test/CodeGen/2006-01-13-StackSave.c: Nuke llvm's opt and llvm-dis, and FileCheck-ize.

@llvm.stacksave is emitted regardless of "opt -std-compile-opts". We have optimizers' tests in llvm/test/Transforms.

llvm-svn: 173114

11 years agoclang/test/CodeGen/blocks-seq.c: FileCheck-ize.
NAKAMURA Takumi [Tue, 22 Jan 2013 01:51:48 +0000 (01:51 +0000)]
clang/test/CodeGen/blocks-seq.c: FileCheck-ize.

llvm-svn: 173113

11 years ago[CMake] bugpoint-passes should not be built in "all", when LLVM_BUILD_TOOLS is OFF.
NAKAMURA Takumi [Tue, 22 Jan 2013 01:44:00 +0000 (01:44 +0000)]
[CMake] bugpoint-passes should not be built in "all", when LLVM_BUILD_TOOLS is OFF.

llvm-svn: 173112

11 years agoReplacing a "no clue why" comment with the explanation it was demanding
Enrico Granata [Tue, 22 Jan 2013 01:43:59 +0000 (01:43 +0000)]
Replacing a "no clue why" comment with the explanation it was demanding

llvm-svn: 173111

11 years agoRemove target triple from an LSR test.
Andrew Trick [Tue, 22 Jan 2013 00:57:16 +0000 (00:57 +0000)]
Remove target triple from an LSR test.

Manish already fixed this test to work with NoTTI.

llvm-svn: 173110

11 years agoAdd a new method that adds the AttributeSet at the given index. No functional change.
Bill Wendling [Tue, 22 Jan 2013 00:53:12 +0000 (00:53 +0000)]
Add a new method that adds the AttributeSet at the given index. No functional change.

llvm-svn: 173109

11 years agoAdd the attributes that are passed in instead of the ones we're merging into.
Bill Wendling [Tue, 22 Jan 2013 00:41:33 +0000 (00:41 +0000)]
Add the attributes that are passed in instead of the ones we're merging into.

llvm-svn: 173108

11 years agoClear up the documentation for the "container-regs" and "invalidate-regs" key/value...
Greg Clayton [Mon, 21 Jan 2013 23:54:42 +0000 (23:54 +0000)]
Clear up the documentation for the "container-regs" and "invalidate-regs" key/value pair responses for qRegisterInfo with examples of single and multiple registers for each.

llvm-svn: 173107

11 years agoRemove unused method.
Bill Wendling [Mon, 21 Jan 2013 23:41:50 +0000 (23:41 +0000)]
Remove unused method.

llvm-svn: 173106

11 years agoChanged the register number lists for the qRegisterInfo packet response to be raw...
Greg Clayton [Mon, 21 Jan 2013 23:32:42 +0000 (23:32 +0000)]
Changed the register number lists for the qRegisterInfo packet response to be raw hex to match all other register reading and writing APIs.

llvm-svn: 173105

11 years agoAdded all of the 16 and 8 bit register variants for i386.
Greg Clayton [Mon, 21 Jan 2013 23:25:18 +0000 (23:25 +0000)]
Added all of the 16 and 8 bit register variants for i386.

Modified the ARM register context to invalidate r8 - r14 when the CPSR register is modified.

llvm-svn: 173104

11 years agoFix spelling
Joel Jones [Mon, 21 Jan 2013 23:20:47 +0000 (23:20 +0000)]
Fix spelling

llvm-svn: 173103

11 years agoUpdated the LLDB qRegisterInfo documentation to contain information on the new "inval...
Greg Clayton [Mon, 21 Jan 2013 23:18:28 +0000 (23:18 +0000)]
Updated the LLDB qRegisterInfo documentation to contain information on the new "invalidate-regs" and "container-regs" keys that can be returned in response to a qRegisterInfo packet.

llvm-svn: 173102

11 years agoUse AttributeSet instead of Attribute to verify things.
Bill Wendling [Mon, 21 Jan 2013 23:03:18 +0000 (23:03 +0000)]
Use AttributeSet instead of Attribute to verify things.

llvm-svn: 173101

11 years agoRemove "incorrect" aligning of trailing comments.
Daniel Jasper [Mon, 21 Jan 2013 22:49:20 +0000 (22:49 +0000)]
Remove "incorrect" aligning of trailing comments.

We used to align trailing comments belong to different things.
Before:
void f() { // some function..
}
int a;     // some variable..

After:
void f() { // some function..
}
int a; // some variable..

llvm-svn: 173100

11 years agoHave AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.
Bill Wendling [Mon, 21 Jan 2013 22:45:00 +0000 (22:45 +0000)]
Have AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.

This further restricts the use of the Attribute class to the Attribute family of
classes.

llvm-svn: 173099

11 years agoHave AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.
Bill Wendling [Mon, 21 Jan 2013 22:44:49 +0000 (22:44 +0000)]
Have AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.

This further restricts the use of the Attribute class to the Attribute family of
classes.

llvm-svn: 173098

11 years agoobjectiveC: don't warn when in -Wselector mode and
Fariborz Jahanian [Mon, 21 Jan 2013 22:32:29 +0000 (22:32 +0000)]
objectiveC: don't warn when in -Wselector mode and
an unimplemented selector is consumed by
"respondsToSelector:". // rdar://12938616

llvm-svn: 173097

11 years ago<rdar://problem/13020634>
Greg Clayton [Mon, 21 Jan 2013 22:17:50 +0000 (22:17 +0000)]
<rdar://problem/13020634>

Fixed the 32, 16, and 8 bit pseudo regs for x86_64 (real reg of "rax" which subvalues "eax", "ax", etc...) to correctly get updated when stepping. Also fixed it so actual registers can specify what other registers must be invalidated when a register is modified. Previously, only pseudo registers could invalidate other registers.

Modified the LLDB qRegisterInfo extension to the GDB remote interface to support specifying the containing registers with the new "container-regs" key whose value is a comma separated list of register numbers. Also added a "invalidate-regs" key whose value is also a comma separated list of register numbers.

Removed the hack GDBRemoteDynamicRegisterInfo::Addx86_64ConvenienceRegisters() function and modified "debugserver" to specify the registers correctly using the new "container-regs" and "invalidate-regs" keys.

llvm-svn: 173096

11 years agoMake AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.
Bill Wendling [Mon, 21 Jan 2013 21:57:40 +0000 (21:57 +0000)]
Make AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.

This is more code to isolate the use of the Attribute class to that of just
holding one attribute instead of a collection of attributes.

llvm-svn: 173095

11 years agoMake AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.
Bill Wendling [Mon, 21 Jan 2013 21:57:28 +0000 (21:57 +0000)]
Make AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.

This is more code to isolate the use of the Attribute class to that of just
holding one attribute instead of a collection of attributes.

llvm-svn: 173094

11 years agoTransform (sub 0, (zext bool to A)) to (sext bool to A) and
Paul Redmond [Mon, 21 Jan 2013 21:57:20 +0000 (21:57 +0000)]
Transform (sub 0, (zext bool to A)) to (sext bool to A) and
(sub 0, (sext bool to A)) to (zext bool to A).

Patch by Muhammad Ahmad
Reviewed by Duncan Sands

llvm-svn: 173093

11 years agoDocs for SparseMultiSet
Michael Ilseman [Mon, 21 Jan 2013 21:46:32 +0000 (21:46 +0000)]
Docs for SparseMultiSet

llvm-svn: 173092

11 years agoFix some incorrectly named u10 / lu10 instructions.
Richard Osborne [Mon, 21 Jan 2013 21:12:30 +0000 (21:12 +0000)]
Fix some incorrectly named u10 / lu10 instructions.

llvm-svn: 173090

11 years agoRemove unneeded #include.
Jakub Staszak [Mon, 21 Jan 2013 21:02:47 +0000 (21:02 +0000)]
Remove unneeded #include.

llvm-svn: 173088

11 years agoRemove unused multiclass.
Richard Osborne [Mon, 21 Jan 2013 20:50:54 +0000 (20:50 +0000)]
Remove unused multiclass.

llvm-svn: 173087

11 years agoAdd instruction encodings / disassembly support for u6 / lu6 instructions.
Richard Osborne [Mon, 21 Jan 2013 20:44:17 +0000 (20:44 +0000)]
Add instruction encodings / disassembly support for u6 / lu6 instructions.

llvm-svn: 173086

11 years agoAdd instruction encoding / disassembly support for ru6 / lru6 instructions.
Richard Osborne [Mon, 21 Jan 2013 20:42:16 +0000 (20:42 +0000)]
Add instruction encoding / disassembly support for ru6 / lru6 instructions.

llvm-svn: 173085

11 years agoImplement the ATOMIC_*_LOCK_FREE macros.
Howard Hinnant [Mon, 21 Jan 2013 20:39:41 +0000 (20:39 +0000)]
Implement the ATOMIC_*_LOCK_FREE macros.

llvm-svn: 173084

11 years agoUse correct format for the LDAWCP instruction (u6).
Richard Osborne [Mon, 21 Jan 2013 20:32:54 +0000 (20:32 +0000)]
Use correct format for the LDAWCP instruction (u6).

llvm-svn: 173083

11 years agono functionality changes(split WriterELF into multiple files)
Shankar Easwaran [Mon, 21 Jan 2013 20:09:55 +0000 (20:09 +0000)]
no functionality changes(split WriterELF into multiple files)

llvm-svn: 173082

11 years agoGive ModuleFiles an index, so that we can use indexed vectors rather
Douglas Gregor [Mon, 21 Jan 2013 20:07:12 +0000 (20:07 +0000)]
Give ModuleFiles an index, so that we can use indexed vectors rather
than DenseMaps and SmallPtrSets for module-visitation data. ~2.6%
speedup for modules.

llvm-svn: 173081

11 years agoEliminate Sema::CompareProperties(), which was walking over a pile of
Douglas Gregor [Mon, 21 Jan 2013 19:42:21 +0000 (19:42 +0000)]
Eliminate Sema::CompareProperties(), which was walking over a pile of
lexical declarations looking for properties when we could more
efficiently check for property mismatches at property declaration
time. Good for ~1% of -fsyntax-only time when most of the properties
we're checking against come from an AST file.

llvm-svn: 173079

11 years agoFormatter: Set MatchingParen for [], to match <>, (), {}. No functionality change.
Nico Weber [Mon, 21 Jan 2013 19:35:06 +0000 (19:35 +0000)]
Formatter: Set MatchingParen for [], to match <>, (), {}. No functionality change.

llvm-svn: 173078

11 years agoFormatter: Rename LSquare to Left to make parseSquare() more consistent with the...
Nico Weber [Mon, 21 Jan 2013 19:29:31 +0000 (19:29 +0000)]
Formatter: Rename LSquare to Left to make parseSquare() more consistent with the other paren parsing methods.

llvm-svn: 173077

11 years ago<rdar://problem/12437929>
Enrico Granata [Mon, 21 Jan 2013 19:20:50 +0000 (19:20 +0000)]
<rdar://problem/12437929>

Providing a special mode of operator for "memory read -f c-str" which actually works in most common cases
Where the old behavior would provide:
(lldb) mem read --format s `foo`
0x100000f5d: NULL

Now we do:
(lldb) mem read --format s `foo`
0x100000f5d: "hello world"

You can also specify a count and that many strings will be showed starting at the initial address:
(lldb) mem read -c 2 -f c-str `foo`
0x100000f1d: "hello world"
0x100000f29: "short"

llvm-svn: 173076

11 years agoFixes various problems around enum parsing.
Manuel Klimek [Mon, 21 Jan 2013 19:17:52 +0000 (19:17 +0000)]
Fixes various problems around enum parsing.

Very similar to what we do for record definitions:
- tighten down what is an enum definition, so that we don't mistake a
  function for an enum
- allow common idioms around declarations (we'll want to handle that
  more centrally in the future)

We now correctly format:
enum X f() {
  a();
  return 42;
}

llvm-svn: 173075

11 years agor173072 is causing some regressions on big endian hosts, I don't have time to debug it
Chris Lattner [Mon, 21 Jan 2013 19:08:15 +0000 (19:08 +0000)]
r173072 is causing some regressions on big endian hosts, I don't have time to debug it
so revert it for now.

llvm-svn: 173074

11 years agoEliminate the oddly-named Sema::ComparePropertiesInBaseAndSuper, which
Douglas Gregor [Mon, 21 Jan 2013 19:05:22 +0000 (19:05 +0000)]
Eliminate the oddly-named Sema::ComparePropertiesInBaseAndSuper, which
did a redundant traversal of the lexical declarations in the
superclass. Instead, when we declare a new property, look into the
superclass to see whether we're redeclaring the property. Goot for 1%
of -fsyntax-only time on Cocoa.h and a little less than 3% on my
modules test case.

llvm-svn: 173073

11 years agorework the Bitstream reader to actually work a machine word at a time, instead of...
Chris Lattner [Mon, 21 Jan 2013 18:48:26 +0000 (18:48 +0000)]
rework the Bitstream reader to actually work a machine word at a time, instead of 32-bits at a time.
This cuts in half the number of virtual methods called to refill that word when compiling on a 64-bit
host, and will make 64-bit read operations faster.

llvm-svn: 173072

11 years ago[ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a crash if...
Argyrios Kyrtzidis [Mon, 21 Jan 2013 18:45:42 +0000 (18:45 +0000)]
[ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a crash if Precompilepreamble
is set to true because there is no FileManager at that point.

Patch by Hurcan Solter!

llvm-svn: 173071

11 years ago[analyzer] Fix test for r173067.
Jordan Rose [Mon, 21 Jan 2013 18:41:05 +0000 (18:41 +0000)]
[analyzer] Fix test for r173067.

Note to self: don't remove comments /after/ updating the line-sensitive
part of a test.

llvm-svn: 173070

11 years agoReplace some unnecessary O(N^2) lookups for properties with
Douglas Gregor [Mon, 21 Jan 2013 18:35:55 +0000 (18:35 +0000)]
Replace some unnecessary O(N^2) lookups for properties with
DeclContext lookups. The performance win is negligible in my tests,
but it's the Right Thing To Do (TM).

llvm-svn: 173068

11 years ago[analyzer] Show notes inside implicit calls at the last explicit call site.
Jordan Rose [Mon, 21 Jan 2013 18:28:30 +0000 (18:28 +0000)]
[analyzer] Show notes inside implicit calls at the last explicit call site.

Before:
  struct Wrapper { <-- 2. Calling default constructor for 'NonTrivial'.
    NonTrivial m;
  };

  Wrapper w; <-- 1. Calling implicit default constructor for 'Wrapper'.

After:
  struct Wrapper {
    NonTrivial m;
  };

  Wrapper w; <-- 1. Calling implicit default constructor for 'Wrapper'.
             ^-- 2. Calling default constructor for 'NonTrivial'.

llvm-svn: 173067

11 years agoReadSourceManagerBlock is skipping over records that can contain Blobs. Not passing
Chris Lattner [Mon, 21 Jan 2013 18:28:26 +0000 (18:28 +0000)]
ReadSourceManagerBlock is skipping over records that can contain Blobs.  Not passing
in a StringRef to bind to them forces them to be unpacked into the Record as individual
bytes.  This is wasteful, but not likely to be measurable in this instance.

llvm-svn: 173066

11 years agoFix a heinous inefficiency introduced in r149918, wherein reading each byte of a
Chris Lattner [Mon, 21 Jan 2013 18:24:49 +0000 (18:24 +0000)]
Fix a heinous inefficiency introduced in r149918, wherein reading each byte of a
BLOB (i.e., large, performance intensive data) in a bitcode file was switched to
invoking one virtual method call per byte read.  Now we do one virtual call per
BLOB.

llvm-svn: 173065

11 years agoIntroduce a new data structure, the SparseMultiSet, and changes to the MI scheduler...
Michael Ilseman [Mon, 21 Jan 2013 18:18:53 +0000 (18:18 +0000)]
Introduce a new data structure, the SparseMultiSet, and changes to the MI scheduler to use it.

A SparseMultiSet adds multiset behavior to SparseSet, while retaining SparseSet's desirable properties. Essentially, SparseMultiSet provides multiset behavior by storing its dense data in doubly linked lists that are inlined into the dense vector. This allows it to provide good data locality as well as vector-like constant-time clear() and fast constant time find(), insert(), and erase(). It also allows SparseMultiSet to have a builtin recycler rather than keeping SparseSet's behavior of always swapping upon removal, which allows it to preserve more iterators. It's often a better alternative to a SparseSet of a growable container or vector-of-vector.

llvm-svn: 173064

11 years agowean Blob handling logic off of banging on NextChar directly. Instead, make
Chris Lattner [Mon, 21 Jan 2013 18:18:25 +0000 (18:18 +0000)]
wean Blob handling logic off of banging on NextChar directly.  Instead, make
it reason about the current bit position, which is always independent of the
underlying cursors word size.

llvm-svn: 173063

11 years agorename "SkipToWord" to "SkipToFourByteBoundary" since a word is not always 4 bytes.
Chris Lattner [Mon, 21 Jan 2013 18:04:19 +0000 (18:04 +0000)]
rename "SkipToWord" to "SkipToFourByteBoundary" since a word is not always 4 bytes.

llvm-svn: 173062

11 years agoFix a comment. Induction vars dont need to start at zero.
Nadav Rotem [Mon, 21 Jan 2013 17:59:18 +0000 (17:59 +0000)]
Fix a comment. Induction vars dont need to start at zero.

llvm-svn: 173061

11 years agoDonated anonymously: This enables GCC 4.8.0 to build libc++.
Howard Hinnant [Mon, 21 Jan 2013 17:26:55 +0000 (17:26 +0000)]
Donated anonymously:  This enables GCC 4.8.0 to build libc++.

llvm-svn: 173060

11 years agoRevert r173056; it breaks one of the CodeGen-with-PCH tests.
Douglas Gregor [Mon, 21 Jan 2013 16:52:34 +0000 (16:52 +0000)]
Revert r173056; it breaks one of the CodeGen-with-PCH tests.

llvm-svn: 173058

11 years agoWhen loading an identifier from an AST file solely for the purpose of
Douglas Gregor [Mon, 21 Jan 2013 16:47:11 +0000 (16:47 +0000)]
When loading an identifier from an AST file solely for the purpose of
forming the identifier, e.g., as part of a selector or a declaration
name, don't actually deserialize any information about the
identifier. Instead, simply mark it "out-of-date" and we'll load the
the information on demand. 2% speedup on the modules testcase I'm
looking at; should also help PCH.

llvm-svn: 173056

11 years agoFixes formatting of empty blocks.
Manuel Klimek [Mon, 21 Jan 2013 16:42:44 +0000 (16:42 +0000)]
Fixes formatting of empty blocks.

We now only put empty blocks into a single line, if all of:
- all tokens of the structural element fit into a single line
- we're not in a control flow statement

Note that we usually don't put record definitions into a single line, as
there's usually at least one more token (the semicolon) after the
closing brace. This doesn't hold when we are in a context where there is
no semicolon, like "enum E {}".

There were some missing tests around joining lines around the corner
cases of the allowed number of columns, so this patch adds some.

llvm-svn: 173055

11 years agoWhen deserializing a declaration, don't look for redeclarations if its
Douglas Gregor [Mon, 21 Jan 2013 16:16:40 +0000 (16:16 +0000)]
When deserializing a declaration, don't look for redeclarations if its
kind indicates that it can never be redeclared. Good for a 1% speedup,
and redeclaration searching drops off the profile.

llvm-svn: 173054

11 years agoR600/SI: Use unnormalized coordinates for sampling with the RECT target.
Tom Stellard [Mon, 21 Jan 2013 15:40:48 +0000 (15:40 +0000)]
R600/SI: Use unnormalized coordinates for sampling with the RECT target.

Patch by: Michel Dänzer

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 173053

11 years agoR600/SI: Take target parameter for sample intrinsics.
Tom Stellard [Mon, 21 Jan 2013 15:40:47 +0000 (15:40 +0000)]
R600/SI: Take target parameter for sample intrinsics.

Patch by: Michel Dänzer

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 173052

11 years agoR600/SI: Derive all sample intrinsics from a single class.
Tom Stellard [Mon, 21 Jan 2013 15:40:46 +0000 (15:40 +0000)]
R600/SI: Derive all sample intrinsics from a single class.

Patch by: Michel Dänzer

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 173051

11 years agoIntroduce a fast path for the ASTReader's name lookup within a
Douglas Gregor [Mon, 21 Jan 2013 15:25:38 +0000 (15:25 +0000)]
Introduce a fast path for the ASTReader's name lookup within a
DeclContext. When the DeclContext is of a kind that can only be
defined once and never updated, we limit the search to the module file
that conatins the lookup table. Provides a 15% speedup in one
modules-heavy source file.

llvm-svn: 173050

11 years ago[asan] fix linux build
Kostya Serebryany [Mon, 21 Jan 2013 15:04:36 +0000 (15:04 +0000)]
[asan] fix linux build

llvm-svn: 173049

11 years ago[ASan] Move Mac-specific tests to asan_mac_test.cc
Alexander Potapenko [Mon, 21 Jan 2013 14:49:55 +0000 (14:49 +0000)]
[ASan] Move Mac-specific tests to asan_mac_test.cc

llvm-svn: 173048

11 years agoFix parsing of templated declarations.
Daniel Jasper [Mon, 21 Jan 2013 14:39:22 +0000 (14:39 +0000)]
Fix parsing of templated declarations.

Before: template <template <typename T>, typename P > class X;
After:  template <template <typename T>, typename P> class X;

More importantly, the token annotations for the second ">" are now computed
correctly.

llvm-svn: 173047

11 years agoRemoving empty loop-convert directory
Edwin Vane [Mon, 21 Jan 2013 14:35:54 +0000 (14:35 +0000)]
Removing empty loop-convert directory

llvm-svn: 173046

11 years agoFixes indent in linkage specification blocks.
Manuel Klimek [Mon, 21 Jan 2013 14:32:05 +0000 (14:32 +0000)]
Fixes indent in linkage specification blocks.

We now indent:
extern "C" {
int a;
}

without additional indent inside the extern "C" block.

llvm-svn: 173045

11 years agoCMake: generalize checking for target availability and add initial support for PowerP...
Alexey Samsonov [Mon, 21 Jan 2013 14:31:45 +0000 (14:31 +0000)]
CMake: generalize checking for target availability and add initial support for PowerPC native arch. With this patch, building LLVM on PowerPC native arch produces a working ASan runtime.

llvm-svn: 173044

11 years agoFix bug discovered by valgrind.
Daniel Jasper [Mon, 21 Jan 2013 14:18:28 +0000 (14:18 +0000)]
Fix bug discovered by valgrind.

When trying to merge lines, we should not touch lines that are invalid,
as we don't know how long they might be.

llvm-svn: 173043

11 years agoAdd regression test.
Manuel Klimek [Mon, 21 Jan 2013 14:16:56 +0000 (14:16 +0000)]
Add regression test.

llvm-svn: 173042

11 years agoAST/VTableBuilder.h: Suppress a warning. [-Wunused-private-field]
NAKAMURA Takumi [Mon, 21 Jan 2013 14:15:24 +0000 (14:15 +0000)]
AST/VTableBuilder.h: Suppress a warning. [-Wunused-private-field]

llvm-svn: 173041

11 years agoR600/SILowerControlFlow.cpp: Fix a warning. [-Wunused-variable]
NAKAMURA Takumi [Mon, 21 Jan 2013 14:06:48 +0000 (14:06 +0000)]
R600/SILowerControlFlow.cpp: Fix a warning. [-Wunused-variable]

llvm-svn: 173040

11 years agoFixes detection of class template specializations.
Manuel Klimek [Mon, 21 Jan 2013 13:58:54 +0000 (13:58 +0000)]
Fixes detection of class template specializations.

Now correctly formats:
template <> class A<int> {} a;

llvm-svn: 173038