platform/upstream/llvm.git
11 years agoImplement C++03 [dcl.init]p5's checking for value-initialization of references
Richard Smith [Sat, 8 Dec 2012 02:01:17 +0000 (02:01 +0000)]
Implement C++03 [dcl.init]p5's checking for value-initialization of references
properly, rather than faking it up by pretending that a reference member makes
the default constructor non-trivial. That leads to rejects-valids when putting
such types inside unions.

llvm-svn: 169662

11 years agoGet LLDB-Info.plist up to date with r169081.
Filipe Cabecinhas [Sat, 8 Dec 2012 01:20:07 +0000 (01:20 +0000)]
Get LLDB-Info.plist up to date with r169081.

llvm-svn: 169661

11 years agoASan: fix interface-symbols test on Mac by explicitly listing all weak functions
Alexey Samsonov [Sat, 8 Dec 2012 01:12:12 +0000 (01:12 +0000)]
ASan: fix interface-symbols test on Mac by explicitly listing all weak functions

llvm-svn: 169660

11 years agoAdd the core architecture for the lld driver.
Michael J. Spencer [Sat, 8 Dec 2012 00:47:36 +0000 (00:47 +0000)]
Add the core architecture for the lld driver.

This includes selecting which driver to emulate, option parsing, invocation
building, and running the link. This currently only supports a very basic
subset of ld for x86_64-linux.

lld -flavor ld obj.o -o obj

or symlink lld as (ld , link, ld64, core) to get the desired behavior without
-flavor.

llvm-svn: 169659

11 years agoMake sure to check for DW_AT_linkage_name to get the mangled name in the DWARF along...
Greg Clayton [Sat, 8 Dec 2012 00:24:40 +0000 (00:24 +0000)]
Make sure to check for DW_AT_linkage_name to get the mangled name in the DWARF along with the older DW_AT_MIPS_linkage_name attribute.

llvm-svn: 169657

11 years agoAdd the `lto_codegen_set_export_dynamic' function.
Bill Wendling [Sat, 8 Dec 2012 00:18:16 +0000 (00:18 +0000)]
Add the `lto_codegen_set_export_dynamic' function.

This function sets the `_exportDynamic' ivar. When that's set, we export all
symbols (e.g. we don't run the internalize pass). This is equivalent to the
`--export-dynamic' linker flag in GNU land:

--export-dynamic
  When creating a dynamically linked executable, add all symbols to the dynamic
  symbol table. The dynamic symbol table is the set of symbols which are visible
  from dynamic objects at run time. If you do not use this option, the dynamic
  symbol table will normally contain only those symbols which are referenced by
  some dynamic object mentioned in the link. If you use dlopen to load a dynamic
  object which needs to refer back to the symbols defined by the program, rather
  than some other dynamic object, then you will probably need to use this option
  when linking the program itself.

The Darwin linker will support this via the `-export_dynamic' flag. We should
modify clang to support this via the `-rdynamic' flag.

llvm-svn: 169656

11 years agoAdded GetCanonicalType() to SBType:
Greg Clayton [Sat, 8 Dec 2012 00:17:07 +0000 (00:17 +0000)]
Added GetCanonicalType() to SBType:

lldb::SBType
SBType::GetCanonicalType();

llvm-svn: 169655

11 years agoCurrently when AST record layouts are dumped with -fdump-record-layouts, the
Eli Bendersky [Sat, 8 Dec 2012 00:07:24 +0000 (00:07 +0000)]
Currently when AST record layouts are dumped with -fdump-record-layouts, the
following:

sizeof=132, dsize=132, align=4
nvsize=132, nvalign=4

Is not indented, so when classes are nested there is no way to know to
which class it belongs.

Fix this problem by indenting the size summary properly for each class.

llvm-svn: 169654

11 years agoAdd C API for specifying CPU to the disassembler.
Jim Grosbach [Fri, 7 Dec 2012 23:53:27 +0000 (23:53 +0000)]
Add C API for specifying CPU to the disassembler.

It was a nasty oversight that we didn't include this when we added this
API in the first place. Blech.

rdar://12839439

llvm-svn: 169653

11 years agos/AttrListPtr/AttributeSet/g to better label what this class is going to be in the...
Bill Wendling [Fri, 7 Dec 2012 23:17:26 +0000 (23:17 +0000)]
s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future.

llvm-svn: 169652

11 years agos/AttrListPtr/AttributeSet/g to better label what this class is going to be in the...
Bill Wendling [Fri, 7 Dec 2012 23:16:57 +0000 (23:16 +0000)]
s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future.

llvm-svn: 169651

11 years agoFix analysis based warnings so that all warnings are emitted when compiling
DeLesley Hutchins [Fri, 7 Dec 2012 22:53:48 +0000 (22:53 +0000)]
Fix analysis based warnings so that all warnings are emitted when compiling
with -Werror.  Previously, compiling with -Werror would emit only the first
warning in a compilation unit, because clang assumes that once an error occurs,
further analysis is unlikely to return valid results.  However, warnings that
have been upgraded to errors should not be treated as "errors" in this sense.

llvm-svn: 169649

11 years agoAppease -Wnon-virtual-dtor
Matt Beaumont-Gay [Fri, 7 Dec 2012 22:49:27 +0000 (22:49 +0000)]
Appease -Wnon-virtual-dtor

llvm-svn: 169648

11 years ago[libclang] Declarations inside anonymous namespaces have internal linkage so
Argyrios Kyrtzidis [Fri, 7 Dec 2012 22:41:46 +0000 (22:41 +0000)]
[libclang] Declarations inside anonymous namespaces have internal linkage so
their USR should contain a location.

This uniques them from other declarations with the same name but in different translation units.
rdar://10546541

llvm-svn: 169647

11 years agoASan: use new option -fsanitize-blacklist in output tests
Alexey Samsonov [Fri, 7 Dec 2012 22:21:21 +0000 (22:21 +0000)]
ASan: use new option -fsanitize-blacklist in output tests

llvm-svn: 169646

11 years agoFix a few more clang (3.2) warnings on Linux:
Daniel Malea [Fri, 7 Dec 2012 22:21:08 +0000 (22:21 +0000)]
Fix a few more clang (3.2) warnings on Linux:
- remove unused members
- add NO_PEDANTIC to selected Makefiles
- fix return values (removed NULL as needed)
- disable warning about four-char-constants
- remove unneeded const from operator*() declaration
- add missing lambda function return types
- fix printf() with no format string
- change sizeof to use a type name instead of variable name
- fix Linux ProcessMonitor.cpp to be 32/64 bit friendly
- disable warnings emitted by swig-generated C++ code

Patch by Matt Kopec!

llvm-svn: 169645

11 years agoMake the contents of encoded sections SmallVector<char, N> instead of
Eli Bendersky [Fri, 7 Dec 2012 22:06:56 +0000 (22:06 +0000)]
Make the contents of encoded sections SmallVector<char, N> instead of
SmallString. This makes it possible to use the length-erased SmallVectorImpl
in the interface without imposing buffer size. Thus, the size of MCInstFragment
is back down since a preallocated 8-byte contents buffer is enough.

It would be generally a good idea to rid all the fragments of SmallString as
contents, because a vector just makes more sense.

llvm-svn: 169644

11 years agoASan: change the strategy we use for installing malloc/free/symbolization hooks on...
Alexey Samsonov [Fri, 7 Dec 2012 22:01:28 +0000 (22:01 +0000)]
ASan: change the strategy we use for installing malloc/free/symbolization hooks on Linux: don't provide a default no-op implementations for hooks in runtime, and optionally call hooks if they are provided by the user. Don't force weak interface functions into runtime.

llvm-svn: 169641

11 years ago[analyzer] Rename the option help to reflect better what it does.
Anna Zaks [Fri, 7 Dec 2012 21:51:50 +0000 (21:51 +0000)]
[analyzer] Rename the option help to reflect better what it does.

llvm-svn: 169640

11 years ago[analyzer] Optimization heuristic: do not reanalyze every ObjC method as
Anna Zaks [Fri, 7 Dec 2012 21:51:47 +0000 (21:51 +0000)]
[analyzer] Optimization heuristic: do not reanalyze every ObjC method as
top level.

This heuristic is already turned on for non-ObjC methods
(inlining-mode=noredundancy). If a method has been previously analyzed,
while being inlined inside of another method, do not reanalyze it as top
level.

This commit applies it to ObjCMethods as well. The main caveat here is
that to catch the retain release errors, we are still going to reanalyze
all the ObjC methods but without inlining turned on.

Gives 21% performance increase on one heavy ObjC benchmark, which
suffered large performance regressions due to ObjC inlining.

llvm-svn: 169639

11 years agoWhen we use the BLEND instruction that uses the MSB as a mask, we can remove
Nadav Rotem [Fri, 7 Dec 2012 21:43:11 +0000 (21:43 +0000)]
When we use the BLEND instruction that uses the MSB as a mask, we can remove
the VSRI instruction before it since it does not affect the MSB.

Thanks Craig Topper for suggesting this.

llvm-svn: 169638

11 years agoRemove trailing whitespace
Michael Ilseman [Fri, 7 Dec 2012 21:41:53 +0000 (21:41 +0000)]
Remove trailing whitespace

llvm-svn: 169637

11 years agoUnbreak the C++98 build.
David Blaikie [Fri, 7 Dec 2012 21:39:54 +0000 (21:39 +0000)]
Unbreak the C++98 build.

llvm-svn: 169636

11 years agoIn hexagon convertToHardwareLoop, don't deref end() iterator
Matthew Curtis [Fri, 7 Dec 2012 21:03:15 +0000 (21:03 +0000)]
In hexagon convertToHardwareLoop, don't deref end() iterator

In particular, check if MachineBasicBlock::iterator is end() before
using it to call getDebugLoc();

See also this thread on llvm-commits:
   http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121112/155914.html

llvm-svn: 169634

11 years agoMore Linux warnings fixes (remove default labels as needed):
Daniel Malea [Fri, 7 Dec 2012 20:51:09 +0000 (20:51 +0000)]
More Linux warnings fixes (remove default labels as needed):
- as per http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations

Patch by Matt Kopec!

llvm-svn: 169633

11 years agoAST matcher tutorial (Part I)
Daniel Jasper [Fri, 7 Dec 2012 20:34:49 +0000 (20:34 +0000)]
AST matcher tutorial (Part I)

This an AST matcher tutorial based on Sam Panzer's document
(https://docs.google.com/a/google.com/document/d/1oTkVLhCdRJUEH1_LDaQdXqe8-aOqT5GLDL9e4MhoFF8/edit).

Checking in now although some parts might be a bit rough so others can
help improving it.

llvm-svn: 169632

11 years ago[analyzer] Fix r168019 to work with unpruned paths as well.
Jordan Rose [Fri, 7 Dec 2012 19:56:29 +0000 (19:56 +0000)]
[analyzer] Fix r168019 to work with unpruned paths as well.

This is the case where the analyzer tries to print out source locations
for code within a synthesized function body, which of course does not have
a valid source location. The previous fix attempted to do this during
diagnostic path pruning, but some diagnostics have pruning disabled, and
so any diagnostic with a path that goes through a synthesized body will
either hit an assertion or emit invalid output.

<rdar://problem/12657843> (again)

llvm-svn: 169631

11 years agoReduce conversions between Store <-> ImmutableMapRef in RegionStore.
Ted Kremenek [Fri, 7 Dec 2012 19:54:25 +0000 (19:54 +0000)]
Reduce conversions between Store <-> ImmutableMapRef in RegionStore.

This reduces canonicalization of ImmutableMaps.  This reduces analysis time
of one heavy Objective-C file by another 1%.

llvm-svn: 169630

11 years agoMark ImmutableMap::remove/add() const.
Ted Kremenek [Fri, 7 Dec 2012 19:44:12 +0000 (19:44 +0000)]
Mark ImmutableMap::remove/add() const.

llvm-svn: 169629

11 years agotsan: even more fd interceptors + fixes
Dmitry Vyukov [Fri, 7 Dec 2012 19:23:59 +0000 (19:23 +0000)]
tsan: even more fd interceptors + fixes

llvm-svn: 169628

11 years agoFixed some grammar and punctuation error.
John Criswell [Fri, 7 Dec 2012 19:21:10 +0000 (19:21 +0000)]
Fixed some grammar and punctuation error.
No content changes.

llvm-svn: 169627

11 years agoRefactor MCInstFragment and MCDataFragment to adhere to a common interface,
Eli Bendersky [Fri, 7 Dec 2012 19:13:57 +0000 (19:13 +0000)]
Refactor MCInstFragment and MCDataFragment to adhere to a common interface,
which removes code duplication and prepares the ground for future additions.

Full discussion:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121203/158233.html

llvm-svn: 169626

11 years agoNow that we set ThreadPlanCallFunction to private in the constructor, it is confusing...
Jim Ingham [Fri, 7 Dec 2012 19:04:31 +0000 (19:04 +0000)]
Now that we set ThreadPlanCallFunction to private in the constructor, it is confusing that we set it
again in client code after creating the plans.  So remove those unnecessary calls.

llvm-svn: 169625

11 years agoX86: Prefer using VPSHUFD over VPERMIL because it has better throughput.
Nadav Rotem [Fri, 7 Dec 2012 19:01:13 +0000 (19:01 +0000)]
X86: Prefer using VPSHUFD over VPERMIL because it has better throughput.

llvm-svn: 169624

11 years ago<rdar://problem/10903854>
Greg Clayton [Fri, 7 Dec 2012 18:37:09 +0000 (18:37 +0000)]
<rdar://problem/10903854>

log enable now resolves the "--file" option in case it contains ~.

llvm-svn: 169623

11 years agoAdd helper method to convert from a RegionStoreRefBindings to a Store.
Ted Kremenek [Fri, 7 Dec 2012 18:32:08 +0000 (18:32 +0000)]
Add helper method to convert from a RegionStoreRefBindings to a Store.

llvm-svn: 169622

11 years agotsan: more fd interceptors + bug fixes + tests
Dmitry Vyukov [Fri, 7 Dec 2012 18:30:40 +0000 (18:30 +0000)]
tsan: more fd interceptors + bug fixes + tests

llvm-svn: 169621

11 years ago[asan] fix lint, remove debug prints
Kostya Serebryany [Fri, 7 Dec 2012 18:07:52 +0000 (18:07 +0000)]
[asan] fix lint, remove debug prints

llvm-svn: 169620

11 years agoAdd separate statistics for Data and Inst fragments emitted during relaxation.
Eli Bendersky [Fri, 7 Dec 2012 17:59:21 +0000 (17:59 +0000)]
Add separate statistics for Data and Inst fragments emitted during relaxation.
Also fixes a test that was overly-sensitive to the exact order of statistics
emitted.

llvm-svn: 169619

11 years agoSet ThreadPlanCallFunction to private in ConstructorSetup. This fixes a problem...
Andrew Kaylor [Fri, 7 Dec 2012 17:56:31 +0000 (17:56 +0000)]
Set ThreadPlanCallFunction to private in ConstructorSetup.  This fixes a problem on Linux where 'continue' was misfiring after an expression evaluation when stopped at a breakpoint.  The problem was that InferiorCallMmap was not setting its ThreadPlanCallFunction to private and so the completion of that thread plan appeared to be the stop reason and therefore the 'continue' operation failed to step over the breakpoint.  The SetPrivate call is being put in ThreadPlanCallFunction rather than InferiorCallMmap to make the solution more general.

llvm-svn: 169618

11 years agoSome common functionality from WinCOFFStreamer::EmitAssignment can be now
Eli Bendersky [Fri, 7 Dec 2012 17:55:28 +0000 (17:55 +0000)]
Some common functionality from WinCOFFStreamer::EmitAssignment can be now
delegated to MCObjectStreamer.

llvm-svn: 169617

11 years agoASan: intercept prctl on Linux only
Alexey Samsonov [Fri, 7 Dec 2012 17:54:38 +0000 (17:54 +0000)]
ASan: intercept prctl on Linux only

llvm-svn: 169616

11 years agoFix Test11588.py on Linux. The test was failing because the synthetic type fields...
Andrew Kaylor [Fri, 7 Dec 2012 17:45:05 +0000 (17:45 +0000)]
Fix Test11588.py on Linux.  The test was failing because the synthetic type fields were resolving to int instead of long.  A similar change was made in r155144 to eliminate the type specification for an earlier check in this test, so it seemed appropriate here too.

llvm-svn: 169615

11 years agoSeparate initing the stdout/stderr for running the Python Script interpreter from...
Jim Ingham [Fri, 7 Dec 2012 17:43:38 +0000 (17:43 +0000)]
Separate initing the stdout/stderr for running the Python Script interpreter from initing the lldb.target/frame/etc globals,
and only do the latter when it makes sense to.

<rdar://problem/12554049>

llvm-svn: 169614

11 years agoLift EmitAssignment into MCObjectStreamer which gets rid of at least three
Eli Bendersky [Fri, 7 Dec 2012 17:42:41 +0000 (17:42 +0000)]
Lift EmitAssignment into MCObjectStreamer which gets rid of at least three
duplicate implementations in format-specific streamers.

llvm-svn: 169613

11 years agoTake the Target API lock before letting the Python code start to work constructing...
Jim Ingham [Fri, 7 Dec 2012 17:42:15 +0000 (17:42 +0000)]
Take the Target API lock before letting the Python code start to work constructing threads, otherwise we will risk a lock-inversion deadlock between the thread list and the API mutex.

<rdar://problem/12554049>

llvm-svn: 169612

11 years agoHexagon TC: forward appropriate args to assembler
Matthew Curtis [Fri, 7 Dec 2012 17:23:04 +0000 (17:23 +0000)]
Hexagon TC: forward appropriate args to assembler

llvm-svn: 169611

11 years agoDriver/ToolChains.cpp: Add the name CentOS5 32bit gcc44 (aka i386-redhat-linux6E).
NAKAMURA Takumi [Fri, 7 Dec 2012 17:13:18 +0000 (17:13 +0000)]
Driver/ToolChains.cpp: Add the name CentOS5 32bit gcc44 (aka i386-redhat-linux6E).

Thanks to Bruce Stephens.

llvm-svn: 169610

11 years agoAdded Mapping Symbols for ARM ELF
Tim Northover [Fri, 7 Dec 2012 16:50:23 +0000 (16:50 +0000)]
Added Mapping Symbols for ARM ELF

Before this patch, when you objdump an LLVM-compiled file, objdump tried to
decode data-in-code sections as if they were code.  This patch adds the missing
Mapping Symbols, as defined by "ELF for the ARM Architecture" (ARM IHI 0044D).

Patch based on work by Greg Fitzgerald.

llvm-svn: 169609

11 years agoConvert HowToReleaseLLVM.html to reST
Dmitri Gribenko [Fri, 7 Dec 2012 16:42:48 +0000 (16:42 +0000)]
Convert HowToReleaseLLVM.html to reST

Patch by Alexander Zinenko.

llvm-svn: 169608

11 years agotsan: fix pipe interceptors and add 2 tests
Dmitry Vyukov [Fri, 7 Dec 2012 16:22:54 +0000 (16:22 +0000)]
tsan: fix pipe interceptors and add 2 tests

llvm-svn: 169607

11 years agotsan: fix lint warnings
Dmitry Vyukov [Fri, 7 Dec 2012 16:20:06 +0000 (16:20 +0000)]
tsan: fix lint warnings

llvm-svn: 169606

11 years agoClang-format: extracted FormatTokenSource from UnwrappedLineParser.
Alexander Kornienko [Fri, 7 Dec 2012 16:15:44 +0000 (16:15 +0000)]
Clang-format: extracted FormatTokenSource from UnwrappedLineParser.

Summary: FormatTokenLexer is here, FormatTokenBuffer is on the way. This will allow to re-parse unwrapped lines when needed.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D186

llvm-svn: 169605

11 years agoThe test unconditionally assumes a particular cpu has a backend build in the target.
David Tweed [Fri, 7 Dec 2012 15:57:45 +0000 (15:57 +0000)]
The test unconditionally assumes a particular cpu has a backend build in the target.
Buildbots for some hosts may choose to build only their own backend in order to
maximise testing-turnaround time. Move the test into a prefixed directory so
lit's standard "backend specific" suppression can be done.

llvm-svn: 169604

11 years agoSplit MCELFStreamer into a header file.
Logan Chien [Fri, 7 Dec 2012 15:50:40 +0000 (15:50 +0000)]
Split MCELFStreamer into a header file.

llvm-svn: 169603

11 years agotsan: add pipe interceptors
Dmitry Vyukov [Fri, 7 Dec 2012 15:32:56 +0000 (15:32 +0000)]
tsan: add pipe interceptors

llvm-svn: 169602

11 years ago[asan] intercept prctl(PR_SET_NAME) and set the thread name. Output the thread names...
Kostya Serebryany [Fri, 7 Dec 2012 15:15:01 +0000 (15:15 +0000)]
[asan] intercept prctl(PR_SET_NAME) and set the thread name. Output the thread names (if non-empty) in asan reports

llvm-svn: 169601

11 years agotsan: refactoring is preparation to more precise fd synchronization handling
Dmitry Vyukov [Fri, 7 Dec 2012 14:40:10 +0000 (14:40 +0000)]
tsan: refactoring is preparation to more precise fd synchronization handling

llvm-svn: 169600

11 years agoHexagon TC: add cc1 defaults for hexagon-gcc
Matthew Curtis [Fri, 7 Dec 2012 13:52:44 +0000 (13:52 +0000)]
Hexagon TC: add cc1 defaults for hexagon-gcc
 compatibility

llvm-svn: 169599

11 years ago[sanitizer] implement SanitizerSetThreadName/SanitizerGetThreadName. Just for linux...
Kostya Serebryany [Fri, 7 Dec 2012 11:27:24 +0000 (11:27 +0000)]
[sanitizer] implement SanitizerSetThreadName/SanitizerGetThreadName. Just for linux so far (using prctl(PR_GET_NAME))

llvm-svn: 169598

11 years agoSwitch to r83 of cpplint.
Evgeniy Stepanov [Fri, 7 Dec 2012 11:00:14 +0000 (11:00 +0000)]
Switch to r83 of cpplint.

Ubuntu Precise compatibility.

llvm-svn: 169597

11 years agodocs: Convert LangRef to reST.
Sean Silva [Fri, 7 Dec 2012 10:36:55 +0000 (10:36 +0000)]
docs: Convert LangRef to reST.

NOTE: If you have any patches in the works that modify LangRef, you will
need to rewrite the changes to LangRef.html to their equivalents in
LangRef.rst. If you need assistance feel free to contact me.

Since LangRef is mission-critical for the project and "normative", I
have taken extra care to ensure that no content was lost or altered in
the conversion. The content was converted with a tool called `pandoc`,
so there is no chance for a human error like accidentally forgetting a
sentence or whatever. After the initial conversion by `pandoc`, only
changes to the markup were done.

This is just the most literal conversion of the HTML document as
possible. It might be worth exploring some way to chop up this massive
document into separate pages, e.g. something like
`docs/LangRef/Instructions.rst`, `docs/LangRef/Intrinsics.rst`, etc.
with `docs/LangRef.rst` being an "intro/navigation page" of sorts. On
the other hand, that loses the ability to {Ctrl,Cmd}-F for a given term
right from your browser.

IMO, I think our stylesheet needs some work because I find it hard to
tell what level of nesting some of the headings are at (e.g. "is this a
new section or is it a subsection?"). The issue is present on other
pages, but the sheer size and deep section structure of LangRef really
brings this issue out. If there are any web designers out there in the
community it would be awesome if you tried to come up with something
nicer.

llvm-svn: 169596

11 years ago[sanitizer] try not to use libc mem* functions in sanitizer_common tests (conflicts...
Kostya Serebryany [Fri, 7 Dec 2012 10:13:10 +0000 (10:13 +0000)]
[sanitizer] try not to use libc mem* functions in sanitizer_common tests (conflicts with our own interceptors)

llvm-svn: 169595

11 years agoSmall tweaks to clang-format.
Daniel Jasper [Fri, 7 Dec 2012 09:52:15 +0000 (09:52 +0000)]
Small tweaks to clang-format.

Now not joining keywords with '::' and not putting a space between
a pointer pointer.

llvm-svn: 169594

11 years ago[sanitizer] fix the build on ancient gcc which has stricter rules about what can...
Kostya Serebryany [Fri, 7 Dec 2012 09:40:17 +0000 (09:40 +0000)]
[sanitizer] fix the build on ancient gcc which has stricter rules about what can be put on TLS. Long term, we absolutely must build the run-times with the fresh target clang

llvm-svn: 169593

11 years agotsan: deflake output tests (by increasing sleeps)
Dmitry Vyukov [Fri, 7 Dec 2012 09:24:57 +0000 (09:24 +0000)]
tsan: deflake output tests (by increasing sleeps)

llvm-svn: 169592

11 years ago[msan] Remove readonly/readnone attributes from all called functions.
Evgeniy Stepanov [Fri, 7 Dec 2012 09:08:32 +0000 (09:08 +0000)]
[msan] Remove readonly/readnone attributes from all called functions.

MSan uses a TLS slot to pass shadow for function arguments and return values.
This makes all instrumented functions not readonly, and at the same time
requires that all callees of an instrumented function that may be
MSan-instrumented do not have readonly attribute (otherwise some of the
instrumentation may be optimized out).

llvm-svn: 169591

11 years agoCache queries to lookupPrivateMethod() within ObjCMethodCall::getRuntimeDefinition().
Ted Kremenek [Fri, 7 Dec 2012 07:30:19 +0000 (07:30 +0000)]
Cache queries to lookupPrivateMethod() within ObjCMethodCall::getRuntimeDefinition().

The same queries can happen thousands of times.  This reduces the analysis
time on one heavy Objective-C file by 2.4%.

llvm-svn: 169589

11 years agoFix the required args count for variadic blocks.
John McCall [Fri, 7 Dec 2012 07:03:17 +0000 (07:03 +0000)]
Fix the required args count for variadic blocks.

We were emitting calls to blocks as if all arguments were
required --- i.e. with signature (A,B,C,D,...) rather than
(A,B,...).  This patch fixes that and accounts for the
implicit block-context argument as a required argument.
In addition, this patch changes the function type under which
we call unprototyped functions on platforms like x86-64 that
guarantee compatibility of variadic functions with unprototyped
function types;  previously we would always call such functions
under the LLVM type T (...)*, but now we will call them under
the type T (A,B,C,D,...)*.  This last change should have no
material effect except for making the type conventions more
explicit;  it was a side-effect of the most convenient implementation.

llvm-svn: 169588

11 years agoclang/test: Remove "REQUIRES:LP64" in two tests. Each of them have explicit triple.
NAKAMURA Takumi [Fri, 7 Dec 2012 06:57:40 +0000 (06:57 +0000)]
clang/test: Remove "REQUIRES:LP64" in two tests. Each of them have explicit triple.

llvm-svn: 169587

11 years agoFurther reduce analysis time by 0.2% on a heavy Objective-C example by avoiding over...
Ted Kremenek [Fri, 7 Dec 2012 06:49:27 +0000 (06:49 +0000)]
Further reduce analysis time by 0.2% on a heavy Objective-C example by avoiding over-eager canonicalization of clusters.

llvm-svn: 169586

11 years agoUse the new MIBundleBuilder class in the Mips target.
Jakob Stoklund Olesen [Fri, 7 Dec 2012 04:23:40 +0000 (04:23 +0000)]
Use the new MIBundleBuilder class in the Mips target.

This is the preferred way of creating bundled machine instructions.

llvm-svn: 169585

11 years agoAdd an MIBundleBuilder class.
Jakob Stoklund Olesen [Fri, 7 Dec 2012 04:23:35 +0000 (04:23 +0000)]
Add an MIBundleBuilder class.

Like the MachineInstrBuilder, this class makes it easier to build
bundles of MachineInstrs.

llvm-svn: 169584

11 years agoAdd higher-level API for dealing with bundled MachineInstrs.
Jakob Stoklund Olesen [Fri, 7 Dec 2012 04:23:29 +0000 (04:23 +0000)]
Add higher-level API for dealing with bundled MachineInstrs.

This is still a work in progress. The purpose is to make bundling and
unbundling operations explicit, and to catch errors where bundles are
broken or created inadvertently.

The old IsInsideBundle flag is replaced by two MI flags: BundledPred
which has the same meaning as IsInsideBundle, and BundledSucc which is
set on instructions that are bundled with a successor. Having two flags
provdes redundancy to detect when a bundle is inadvertently torn by a
splice() or insert(), and it makes it possible to write bundle iterators
that don't need to peek at adjacent instructions.

The new flags can't be manipulated directly (once setIsInsideBundle is
gone). Instead there are MI functions to make and break bundle bonds.

The setIsInsideBundle function will be removed in a future commit. It
should be replaced by bundleWithPred().

llvm-svn: 169583

11 years ago<rdar://problem/12831670>
Jason Molenda [Fri, 7 Dec 2012 03:38:23 +0000 (03:38 +0000)]
<rdar://problem/12831670>
When using the same-device optimization for shared cache libraries, if
we have an invalid load address for __LINKEDIT, don't try to read
anything out of lldb's own address space.  Reading it out of the remote
address space will fail gracefully if we have bad addresses but reading
it out of lldb's own address space will result in a crash.

llvm-svn: 169582

11 years agoUnbreak the GCC (4.4 & other bot) builds from r169571.
David Blaikie [Fri, 7 Dec 2012 03:28:20 +0000 (03:28 +0000)]
Unbreak the GCC (4.4 & other bot) builds from r169571.

llvm-svn: 169581

11 years ago[mips] Delete nodes and instructions for dynamic alloca that are no longer in
Akira Hatanaka [Fri, 7 Dec 2012 03:10:18 +0000 (03:10 +0000)]
[mips] Delete nodes and instructions for dynamic alloca that are no longer in
use.

llvm-svn: 169580

11 years ago[mips] Shorten predicate name.
Akira Hatanaka [Fri, 7 Dec 2012 03:06:09 +0000 (03:06 +0000)]
[mips] Shorten predicate name.

llvm-svn: 169579

11 years ago[mips] Delete unused sub-target features.
Akira Hatanaka [Fri, 7 Dec 2012 03:04:05 +0000 (03:04 +0000)]
[mips] Delete unused sub-target features.

llvm-svn: 169578

11 years ago[mips] Remove unnecessary predicates.
Akira Hatanaka [Fri, 7 Dec 2012 03:01:24 +0000 (03:01 +0000)]
[mips] Remove unnecessary predicates.

llvm-svn: 169577

11 years agoAdd file missed from r169574!
Richard Smith [Fri, 7 Dec 2012 02:26:01 +0000 (02:26 +0000)]
Add file missed from r169574!

llvm-svn: 169576

11 years agoarcconfig for compiler-rt
Alexey Samsonov [Fri, 7 Dec 2012 02:11:47 +0000 (02:11 +0000)]
arcconfig for compiler-rt

llvm-svn: 169575

11 years agoPer [dcl.fct.def.default]p1, don't allow variadic special members to be defaulted.
Richard Smith [Fri, 7 Dec 2012 02:10:28 +0000 (02:10 +0000)]
Per [dcl.fct.def.default]p1, don't allow variadic special members to be defaulted.

llvm-svn: 169574

11 years agoAdd support to ValueTracking for determining that a pointer is non-null
Chandler Carruth [Fri, 7 Dec 2012 02:08:58 +0000 (02:08 +0000)]
Add support to ValueTracking for determining that a pointer is non-null
by virtue of inbounds GEPs that preclude a null pointer.

This is a very common pattern in the code generated by std::vector and
other standard library routines which use allocators that test for null
pervasively. This is one step closer to teaching Clang+LLVM to be able
to produce an empty function for:

  void f() {
    std::vector<int> v;
    v.push_back(1);
    v.push_back(2);
    v.push_back(3);
    v.push_back(4);
  }

Which is related to getting them to completely fold SmallVector
push_back sequences into constants when inlining and other optimizations
make that a possibility.

llvm-svn: 169573

11 years agoAdd manualRetain() and manualRelease() to ImmutableMapRef, and add a new constructor.
Ted Kremenek [Fri, 7 Dec 2012 02:03:00 +0000 (02:03 +0000)]
Add manualRetain() and manualRelease() to ImmutableMapRef, and add a new constructor.

llvm-svn: 169572

11 years agoChange RegionStore to always use ImmutableMapRef for processing cluster bindings.
Ted Kremenek [Fri, 7 Dec 2012 01:55:21 +0000 (01:55 +0000)]
Change RegionStore to always use ImmutableMapRef for processing cluster bindings.

This reduces analysis time by 1.2% on one test case (Objective-C), but
also cleans up some of the code conceptually as well.  We can possible
just make RegionBindingsRef -> RegionBindings, but I wanted to stage
things.

After this, we should revisit Jordan's optimization of not canonicalizing
the immutable AVL trees for the cluster bindings as well.

llvm-svn: 169571

11 years ago[analyzer] Remove possible pessimizations from r169563.
Jordan Rose [Fri, 7 Dec 2012 01:54:38 +0000 (01:54 +0000)]
[analyzer] Remove possible pessimizations from r169563.

Thanks for reminding me about copy-elision, David. Passing references here
doesn't help when we could get move construction in C++11. If we really
cared, we'd use std::swap to steal the reference from the temporary arg,
but it's probably not /that/ critical outside of Profile anyway.

llvm-svn: 169570

11 years agoMakefile.common: Update a description, s/Source/SOURCES/ , according to MakefileGuide...
NAKAMURA Takumi [Fri, 7 Dec 2012 01:43:23 +0000 (01:43 +0000)]
Makefile.common: Update a description, s/Source/SOURCES/ , according to MakefileGuide.html#control-variables .

llvm-svn: 169569

11 years agounittest/googletest/Makefile: Unbreak out-of-tree build.
NAKAMURA Takumi [Fri, 7 Dec 2012 01:25:45 +0000 (01:25 +0000)]
unittest/googletest/Makefile: Unbreak out-of-tree build.

  - Use SOURCES instead of Source. See Makefile.rules and MakefileGuide.html.
  - Don't assume the current directory. $(wildcard *.cc) doesn't match anything on corresponding build directory.

llvm-svn: 169568

11 years ago<rdar://problem/8908550>
Greg Clayton [Fri, 7 Dec 2012 00:19:47 +0000 (00:19 +0000)]
<rdar://problem/8908550>

Added "--address" as an available option for "source list".

llvm-svn: 169567

11 years agotest/Index/skip-parsed-bodies/compile_commands.json: Remove XFAIL on cygming.
NAKAMURA Takumi [Fri, 7 Dec 2012 00:05:36 +0000 (00:05 +0000)]
test/Index/skip-parsed-bodies/compile_commands.json: Remove XFAIL on cygming.

llvm-svn: 169566

11 years agoAdd convenience accessor to Triple for OS == NaCl
Eli Bendersky [Fri, 7 Dec 2012 00:01:53 +0000 (00:01 +0000)]
Add convenience accessor to Triple for OS == NaCl

llvm-svn: 169565

11 years agoTry to unbreak makefile build by excluding gtest-all.cc source
Alexey Samsonov [Thu, 6 Dec 2012 23:59:54 +0000 (23:59 +0000)]
Try to unbreak makefile build by excluding gtest-all.cc source

llvm-svn: 169564

11 years ago[analyzer] Avoid ProgramStateRef copy constructors.
Jordan Rose [Thu, 6 Dec 2012 23:55:34 +0000 (23:55 +0000)]
[analyzer] Avoid ProgramStateRef copy constructors.

Suggested by David Blaikie. ExplodedNode, CallEvent, and CheckerContext all
hang onto their ProgramState, so the accessors can return a reference to the
internal state rather than preemptively copying it. This helps avoid
temporary ProgramStateRefs, though local variables will still (correctly)
do an extra retain and release.

llvm-svn: 169563

11 years agoRevert r169557. It seems that the test is too restricted
Logan Chien [Thu, 6 Dec 2012 23:40:31 +0000 (23:40 +0000)]
Revert r169557.  It seems that the test is too restricted
and will break the build on buildbot.

llvm-svn: 169562

11 years agoAdd a 'using' declaration to suppress GCC's -Woverloaded-virtual while we
Matt Beaumont-Gay [Thu, 6 Dec 2012 23:15:36 +0000 (23:15 +0000)]
Add a 'using' declaration to suppress GCC's -Woverloaded-virtual while we
decide what pattern we want to follow in the future.

llvm-svn: 169561

11 years ago<rdar://problem/12827789>
Greg Clayton [Thu, 6 Dec 2012 23:12:53 +0000 (23:12 +0000)]
<rdar://problem/12827789>

Be sure to load dSYM files when the object file is in memory only.

llvm-svn: 169560

11 years agoModify the LLVM checkout of googletest:
Alexey Samsonov [Thu, 6 Dec 2012 23:04:41 +0000 (23:04 +0000)]
Modify the LLVM checkout of googletest:
1) don't delete gtest-all.cc (which is used to gather all gtest source
   files in a single file)
2) make including LLVMSupport headers optional (on by default).
   Sanitizer tools may want to use their own versions of googletest
   compiled with specific flags, instead of the common googletest
   library used for all other LLVM/Clang unittests.

llvm-svn: 169559

11 years ago[libclang] Add a test to make sure we skip bodies properly from "#pragma once" headers.
Argyrios Kyrtzidis [Thu, 6 Dec 2012 23:04:24 +0000 (23:04 +0000)]
[libclang] Add a test to make sure we skip bodies properly from "#pragma once" headers.

llvm-svn: 169558

11 years agoAdd i686-linux-android for gcc toolchain detection.
Logan Chien [Thu, 6 Dec 2012 22:59:37 +0000 (22:59 +0000)]
Add i686-linux-android for gcc toolchain detection.

* Look for i686-linux-android under <sysroot>/lib/gcc.

* This patch also slightly enhance the test suite for
  Android GCC toolchain detection.

llvm-svn: 169557