platform/upstream/llvm.git
10 years agoFix YAML tests.
Rui Ueyama [Wed, 11 Sep 2013 04:40:12 +0000 (04:40 +0000)]
Fix YAML tests.

llvm-svn: 190487

10 years agoDo not quote YAML plain string myself. Let YAMLIO do that.
Rui Ueyama [Wed, 11 Sep 2013 04:00:35 +0000 (04:00 +0000)]
Do not quote YAML plain string myself. Let YAMLIO do that.

llvm-svn: 190486

10 years agoRe-submit r190469: YAMLIO: Fix string quoting logic.
Rui Ueyama [Wed, 11 Sep 2013 04:00:08 +0000 (04:00 +0000)]
Re-submit r190469: YAMLIO: Fix string quoting logic.

llvm-svn: 190485

10 years agovolatile types are not trivially copyable.
Eli Friedman [Wed, 11 Sep 2013 03:49:34 +0000 (03:49 +0000)]
volatile types are not trivially copyable.

PR17123.

llvm-svn: 190484

10 years agoFix test.
Eli Friedman [Wed, 11 Sep 2013 03:49:30 +0000 (03:49 +0000)]
Fix test.

llvm-svn: 190483

10 years agoFix is_trivially_constructible preconditions.
Eli Friedman [Wed, 11 Sep 2013 02:53:02 +0000 (02:53 +0000)]
Fix is_trivially_constructible preconditions.

Fixes a crash in cases where the first argument was an incomplete type
or an uninstantiated template type.

<rdar://problem/14938471>

llvm-svn: 190482

10 years agoDisable the bool and enum sanitizers when emitting the implicitly-defined copy
Nick Lewycky [Wed, 11 Sep 2013 02:03:20 +0000 (02:03 +0000)]
Disable the bool and enum sanitizers when emitting the implicitly-defined copy
constructor, copy assignment operator and move assignment operator.

llvm-svn: 190481

10 years agoRevert "YAMLIO: Fix string quoting logic." (r190469)
Hans Wennborg [Wed, 11 Sep 2013 01:59:32 +0000 (01:59 +0000)]
Revert "YAMLIO: Fix string quoting logic." (r190469)

It was turning the buildbots red.

llvm-svn: 190480

10 years agoAdding bad_array_length to libc++abi
Marshall Clow [Wed, 11 Sep 2013 01:42:02 +0000 (01:42 +0000)]
Adding bad_array_length to libc++abi

llvm-svn: 190479

10 years agoAdding bad_array_length to libc++
Marshall Clow [Wed, 11 Sep 2013 01:38:42 +0000 (01:38 +0000)]
Adding bad_array_length to libc++

llvm-svn: 190478

10 years ago[python-bindings] Added support for getting/setting operands of values and getting...
Michael Gottesman [Wed, 11 Sep 2013 01:38:12 +0000 (01:38 +0000)]
[python-bindings] Added support for getting/setting operands of values and getting the number of operands of a value.

Also in the process did some cleanups for BasicBlock.

llvm-svn: 190477

10 years agoThe cleanup attribute no longer uses an unresolved, simple identifier as its argument...
Aaron Ballman [Wed, 11 Sep 2013 01:37:41 +0000 (01:37 +0000)]
The cleanup attribute no longer uses an unresolved, simple identifier as its argument.  Instead, it takes an expression that is fully resolved.

llvm-svn: 190476

10 years ago[python-bindings] Added support for iterating over a basic blocks instructions, getti...
Michael Gottesman [Wed, 11 Sep 2013 01:17:38 +0000 (01:17 +0000)]
[python-bindings] Added support for iterating over a basic blocks instructions, getting their name/dumping them, f/b iteration.

Tests are included.

llvm-svn: 190475

10 years agoLWG Issue #2210 Part 5 - map/multimap; no, really - the last one was set/multiset...
Marshall Clow [Wed, 11 Sep 2013 01:15:47 +0000 (01:15 +0000)]
LWG Issue #2210 Part 5 - map/multimap; no, really - the last one was set/multiset. THIS is map/multimap

llvm-svn: 190474

10 years ago[python-bindings] Added support for iterating over a function's basic blocks, dumping...
Michael Gottesman [Wed, 11 Sep 2013 01:01:40 +0000 (01:01 +0000)]
[python-bindings] Added support for iterating over a function's basic blocks, dumping/getting names of those bb, f/w iteration.

Tests are included.

llvm-svn: 190473

10 years agoRemove trailing whitespace
Rui Ueyama [Wed, 11 Sep 2013 00:53:07 +0000 (00:53 +0000)]
Remove trailing whitespace

llvm-svn: 190472

10 years ago[python-bindings] Added support for getting a module's functions, iterating f/b over...
Michael Gottesman [Wed, 11 Sep 2013 00:52:47 +0000 (00:52 +0000)]
[python-bindings] Added support for getting a module's functions, iterating f/b over said functions, dumping/print name of functions.

Tests are included as well.

llvm-svn: 190471

10 years agoPR17075: When performing partial ordering of a member function against a
Richard Smith [Wed, 11 Sep 2013 00:52:39 +0000 (00:52 +0000)]
PR17075: When performing partial ordering of a member function against a
non-member function, the number of arguments in the two candidate calls
will be different (the non-member call will have one extra argument).
We used to get confused by this, and fail to compare the last argument
when testing whether the member is better, resulting in us always
thinking it is, even if the non-member is more specialized in the last
argument.

llvm-svn: 190470

10 years agoYAMLIO: Fix string quoting logic.
Rui Ueyama [Wed, 11 Sep 2013 00:45:48 +0000 (00:45 +0000)]
YAMLIO: Fix string quoting logic.

YAMLIO printed a string as is without quotes unless it contains a newline
character. That did not suffice. We also need to quote a string if it starts
with a backquote, quote, double quote or atsign, or it's the empty string.

llvm-svn: 190469

10 years ago[python-bindings] Export OpCode from core.py.
Michael Gottesman [Wed, 11 Sep 2013 00:41:07 +0000 (00:41 +0000)]
[python-bindings] Export OpCode from core.py.

llvm-svn: 190468

10 years ago[python-bindings] Added test for reading a module from bitcode.
Michael Gottesman [Wed, 11 Sep 2013 00:41:05 +0000 (00:41 +0000)]
[python-bindings] Added test for reading a module from bitcode.

llvm-svn: 190467

10 years agoRename variables for consistency.
Eli Friedman [Wed, 11 Sep 2013 00:41:02 +0000 (00:41 +0000)]
Rename variables for consistency.

No functional change.

llvm-svn: 190466

10 years ago[python-bindings] Fixed 3 test failures caused by typos.
Michael Gottesman [Wed, 11 Sep 2013 00:41:02 +0000 (00:41 +0000)]
[python-bindings] Fixed 3 test failures caused by typos.

llvm-svn: 190465

10 years agoAdd -fansi-escape-codes option
Nico Rieck [Wed, 11 Sep 2013 00:38:02 +0000 (00:38 +0000)]
Add -fansi-escape-codes option

Some build systems use pipes for stdin/stderr. On nix-ish platforms colored
output can be forced by -fcolor-diagnostics. On Windows this option has
no effect in these cases because LLVM uses the console API (which only
operates on the console buffer) even if a console wrapper capable of
interpreting ANSI escape codes is used.

The -fansi-escape-codes option allows switching from the console API to
ANSI escape codes. It has no effect on other platforms.

llvm-svn: 190464

10 years agoGet rid of unused isPodLike definition.
Eli Friedman [Wed, 11 Sep 2013 00:37:10 +0000 (00:37 +0000)]
Get rid of unused isPodLike definition.

llvm-svn: 190463

10 years agoRemove unused class.
Eli Friedman [Wed, 11 Sep 2013 00:37:06 +0000 (00:37 +0000)]
Remove unused class.

llvm-svn: 190462

10 years agoGet rid of unused isPodLike definitions.
Eli Friedman [Wed, 11 Sep 2013 00:36:54 +0000 (00:36 +0000)]
Get rid of unused isPodLike definitions.

llvm-svn: 190461

10 years agoSupport ANSI escape code on Windows
Nico Rieck [Wed, 11 Sep 2013 00:36:48 +0000 (00:36 +0000)]
Support ANSI escape code on Windows

In some cases (e.g. when a build system pipes stderr) the Windows console
API cannot be used to color output. For these, provide a way to switch to
ANSI escape codes. This is required for Clang's -fansi-escape-codes option.

llvm-svn: 190460

10 years agoFixed typo.
Michael Gottesman [Wed, 11 Sep 2013 00:27:23 +0000 (00:27 +0000)]
Fixed typo.

llvm-svn: 190459

10 years ago[python-bindings] Added code for loading a module from bitcode, getset its datalayout...
Michael Gottesman [Wed, 11 Sep 2013 00:23:14 +0000 (00:23 +0000)]
[python-bindings] Added code for loading a module from bitcode, getset its datalayout, getset its target, dump it, print it to a file.

llvm-svn: 190458

10 years ago[python-bindings] Added bindings for LLVMContextRef and a test for creating a new...
Michael Gottesman [Wed, 11 Sep 2013 00:23:10 +0000 (00:23 +0000)]
[python-bindings] Added bindings for LLVMContextRef and a test for creating a new context or getting the global context.

llvm-svn: 190457

10 years ago[python-bindings] Implemented the PassRegistry class and the calls to initialize...
Michael Gottesman [Wed, 11 Sep 2013 00:23:08 +0000 (00:23 +0000)]
[python-bindings] Implemented the PassRegistry class and the calls to initialize/shutdown llvm. Also included an initialize_llvm declaration.

llvm-svn: 190456

10 years ago[python-bindings] Removed unused import byref from llvm/disassembler.py.
Michael Gottesman [Wed, 11 Sep 2013 00:23:05 +0000 (00:23 +0000)]
[python-bindings] Removed unused import byref from llvm/disassembler.py.

llvm-svn: 190455

10 years agoLWG Issue #2210 Part 4 - map/multimap
Marshall Clow [Wed, 11 Sep 2013 00:06:45 +0000 (00:06 +0000)]
LWG Issue #2210 Part 4 - map/multimap

llvm-svn: 190454

10 years agoAllow darwin driver to use -help when no input files are specified.
Nick Kledzik [Tue, 10 Sep 2013 23:57:41 +0000 (23:57 +0000)]
Allow darwin driver to use -help when no input files are specified.

Patch by Joe Ranieri

llvm-svn: 190453

10 years agoSupport darwin linker options:
Nick Kledzik [Tue, 10 Sep 2013 23:55:14 +0000 (23:55 +0000)]
Support darwin linker options:
-current_version, -compatibility_version, and -install_name.

Patch by Joe Ranieri

llvm-svn: 190452

10 years agoRemove PackedVersion from MachOLinkingContext and replace with uint32_t
Nick Kledzik [Tue, 10 Sep 2013 23:46:57 +0000 (23:46 +0000)]
Remove PackedVersion from MachOLinkingContext and replace with uint32_t
and a parsePackedVersion() utility.

Patch by Joe Ranieri

llvm-svn: 190451

10 years agoDon't assert on invalid loop vectorization hint.
Eli Friedman [Tue, 10 Sep 2013 23:45:25 +0000 (23:45 +0000)]
Don't assert on invalid loop vectorization hint.

llvm-svn: 190450

10 years agoFix another mistake in r190442.
Eli Friedman [Tue, 10 Sep 2013 23:22:56 +0000 (23:22 +0000)]
Fix another mistake in r190442.

Sorry about that; I'll try to be more careful about DEBUG mode.

llvm-svn: 190449

10 years agoFix unused variables.
Eli Friedman [Tue, 10 Sep 2013 23:18:14 +0000 (23:18 +0000)]
Fix unused variables.

llvm-svn: 190448

10 years agoFix ICE in consumed analysis when CFG is null.
DeLesley Hutchins [Tue, 10 Sep 2013 23:10:10 +0000 (23:10 +0000)]
Fix ICE in consumed analysis when CFG is null.

llvm-svn: 190447

10 years agoFix mistake in r190442.
Eli Friedman [Tue, 10 Sep 2013 23:09:24 +0000 (23:09 +0000)]
Fix mistake in r190442.

llvm-svn: 190446

10 years agoRemove unused variable.
Eli Friedman [Tue, 10 Sep 2013 23:00:03 +0000 (23:00 +0000)]
Remove unused variable.

llvm-svn: 190445

10 years agogetMostSpecialized for function template sets is never used in the context of a
Richard Smith [Tue, 10 Sep 2013 22:59:25 +0000 (22:59 +0000)]
getMostSpecialized for function template sets is never used in the context of a
call; remove its 'number of explicit arguments' and 'what kind of call'
parameters.

llvm-svn: 190444

10 years agoAdd unused markings to suppress warnings.
Eli Friedman [Tue, 10 Sep 2013 22:57:15 +0000 (22:57 +0000)]
Add unused markings to suppress warnings.

trunk clang is a bit more aggressive about emitting unused-declaration
warnings, so adjust some AST code to match.  Specifically, use
LLVM_ATTRIBUTE_UNUSED for declarations which are never supposed to be
referenced, and turn references to declarations which are supposed to be
referenced into odr-uses.

llvm-svn: 190443

10 years agoRemove unused functions.
Eli Friedman [Tue, 10 Sep 2013 22:42:31 +0000 (22:42 +0000)]
Remove unused functions.

llvm-svn: 190442

10 years agoIgnore noreturn when checking function template specializations
Reid Kleckner [Tue, 10 Sep 2013 22:21:37 +0000 (22:21 +0000)]
Ignore noreturn when checking function template specializations

As requested when applying the same logic to calling conventions.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1634

llvm-svn: 190441

10 years agoHoist section call out of loop.
Eric Christopher [Tue, 10 Sep 2013 21:49:37 +0000 (21:49 +0000)]
Hoist section call out of loop.

llvm-svn: 190440

10 years agoPR5683: Issue a warning when subtracting pointers to types of zero size, and
Richard Smith [Tue, 10 Sep 2013 21:34:14 +0000 (21:34 +0000)]
PR5683: Issue a warning when subtracting pointers to types of zero size, and
treat such subtractions as being non-constant. Patch by Serge Pavlov! With a
few tweaks by me.

llvm-svn: 190439

10 years agoTry to unbreak mingw32 buildbot.
Rui Ueyama [Tue, 10 Sep 2013 21:32:42 +0000 (21:32 +0000)]
Try to unbreak mingw32 buildbot.

llvm-svn: 190438

10 years agoFix regression from r190382.
Eli Friedman [Tue, 10 Sep 2013 21:10:25 +0000 (21:10 +0000)]
Fix regression from r190382.

Make sure we perform the correct "referenced-but-not-used" check for
static member constants.

Fixes bug reported on cfe-commits by Alexey Samsonov.

llvm-svn: 190437

10 years ago<rdar://problem/14071463>
Enrico Granata [Tue, 10 Sep 2013 21:04:54 +0000 (21:04 +0000)]
<rdar://problem/14071463>

The wrong method was being called in some instances here, causing class lookups to fail

llvm-svn: 190436

10 years agoFix cl-link.c test failure on Mac platforms
Hans Wennborg [Tue, 10 Sep 2013 20:53:34 +0000 (20:53 +0000)]
Fix cl-link.c test failure on Mac platforms

The test filename (%s) is easily confused with an option when
it starts with /Users...

llvm-svn: 190435

10 years ago[ms-cxxabi] Mangle dynamic initializer stubs the same way MSVC does
Reid Kleckner [Tue, 10 Sep 2013 20:43:12 +0000 (20:43 +0000)]
[ms-cxxabi] Mangle dynamic initializer stubs the same way MSVC does

Summary: Dynamic initializers are mangled as ??__E <name> YAXXZ.

Reviewers: timurrrr

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

llvm-svn: 190434

10 years agoRemove Windows line-endings in two clang-cl test files.
Hans Wennborg [Tue, 10 Sep 2013 20:35:58 +0000 (20:35 +0000)]
Remove Windows line-endings in two clang-cl test files.

llvm-svn: 190432

10 years agoUse llvm::sys::Process::GetEnv() instead of ::getenv().
Rui Ueyama [Tue, 10 Sep 2013 20:33:21 +0000 (20:33 +0000)]
Use llvm::sys::Process::GetEnv() instead of ::getenv().

Process::GetEnv() uses GetEnvironmentVariableW, which is a Windows API
to get an environment variable and is preferable over getenv().

llvm-svn: 190431

10 years agoFix build after SCEV change
Matt Arsenault [Tue, 10 Sep 2013 20:22:17 +0000 (20:22 +0000)]
Fix build after SCEV change

llvm-svn: 190429

10 years agoclang-cl: Support building DLLs (PR17083)
Hans Wennborg [Tue, 10 Sep 2013 20:18:04 +0000 (20:18 +0000)]
clang-cl: Support building DLLs (PR17083)

This adds driver support for building DLLs (the /LD and /LDd flags).
It basically does two things: runtime selection and passing -dll and
-implib to the linker.

llvm-svn: 190428

10 years ago[ms-cxxabi] Implement guard variables for static initialization
Reid Kleckner [Tue, 10 Sep 2013 20:14:30 +0000 (20:14 +0000)]
[ms-cxxabi] Implement guard variables for static initialization

Static locals requiring initialization are not thread safe on Windows.
Unfortunately, it's possible to create static locals that are actually
externally visible with inline functions and templates.  As a result, we
have to implement an initialization guard scheme that is compatible with
TUs built by MSVC, which makes thread safety prohibitively difficult.

MSVC's scheme is that every function that requires a guard gets an i32
bitfield.  Each static local is assigned a bit that indicates if it has
been initialized, up to 32 bits, at which point a new bitfield is
created.  MSVC rejects inline functions with more than 32 static locals,
and the externally visible mangling (?_B) only allows for one guard
variable per function.

On Eli's recommendation, I used MangleNumberingContext to track which
bit each static corresponds to.

Implements PR16888.

Reviewers: rjmccall, eli.friedman

Differential Revision: http://llvm-reviews.chandlerc.com/D1416

llvm-svn: 190427

10 years agoFix missing CHECK-LABELs
Matt Arsenault [Tue, 10 Sep 2013 19:57:05 +0000 (19:57 +0000)]
Fix missing CHECK-LABELs

llvm-svn: 190426

10 years agoTeach ScalarEvolution about pointer address spaces
Matt Arsenault [Tue, 10 Sep 2013 19:55:24 +0000 (19:55 +0000)]
Teach ScalarEvolution about pointer address spaces

llvm-svn: 190425

10 years agoFix typo
Matt Arsenault [Tue, 10 Sep 2013 19:54:54 +0000 (19:54 +0000)]
Fix typo

llvm-svn: 190424

10 years agoAdd getenv() wrapper that works on multibyte environment variable.
Rui Ueyama [Tue, 10 Sep 2013 19:45:51 +0000 (19:45 +0000)]
Add getenv() wrapper that works on multibyte environment variable.

On Windows, character encoding of multibyte environment variable varies
depending on settings. The only reliable way to handle it I think is to use
GetEnvironmentVariableW().

GetEnvironmentVariableW() works on wchar_t string, which is on Windows UTF16
string. That's not ideal because we use UTF-8 as the internal encoding in LLVM.
This patch defines a wrapper function which takes and returns UTF-8 string for
GetEnvironmentVariableW().

The wrapper function does not do any conversion and just forwards the argument
to getenv() on Unix.

Differential Revision: http://llvm-reviews.chandlerc.com/D1612

llvm-svn: 190423

10 years agoLoopVectorize: PHI nodes are always at the beginning of a block, no need to scan...
Benjamin Kramer [Tue, 10 Sep 2013 18:46:15 +0000 (18:46 +0000)]
LoopVectorize: PHI nodes are always at the beginning of a block, no need to scan the whole block.

llvm-svn: 190422

10 years agoDebug Info: create scope children DIEs when the scope DIE is not null.
Manman Ren [Tue, 10 Sep 2013 18:40:41 +0000 (18:40 +0000)]
Debug Info: create scope children DIEs when the scope DIE is not null.

We try to create the scope children DIEs after we create the scope DIE. But
to avoid emitting empty lexical block DIE, we first check whether a scope
DIE is going to be null, then create the scope children if it is not null.
From the number of children, we decide whether to actually create the scope DIE.

This patch also removes an early exit which checks for a special condition.
It also removes deletion of un-used children DIEs that are generated
because we used to generate children DIEs before the scope DIE.

Deletion of un-used children DIEs may cause problem because we sometimes keep
created DIEs in a member variable of a CU.

llvm-svn: 190421

10 years agoObjectiveC migrator: rename inferred isXXX property,
Fariborz Jahanian [Tue, 10 Sep 2013 18:39:32 +0000 (18:39 +0000)]
ObjectiveC migrator: rename inferred isXXX property,
with a suitable 'getter' attribute.

llvm-svn: 190420

10 years agocmake: Install llvm-tblgen again
Hans Wennborg [Tue, 10 Sep 2013 18:35:14 +0000 (18:35 +0000)]
cmake: Install llvm-tblgen again

It was removed in r189130, but it turns out this makes life hard for
folks packaging LLVM and Clang and building the latter based on the
LLVM package.

Note that this only adds back the LLVM tblgen, and it's obviously
not included when LLVM_INSTALL_TOOLCHAIN_ONLY is set.

llvm-svn: 190419

10 years agoDebug Info: define a DIRef template.
Manman Ren [Tue, 10 Sep 2013 18:30:07 +0000 (18:30 +0000)]
Debug Info: define a DIRef template.

Specialize the constructors for DIRef<DIScope> and DIRef<DIType> to make sure
the Value is indeed a scope ref and a type ref.

Use DIScopeRef for DIScope::getContext and DIType::getContext and use DITypeRef
for getContainingType and getClassType.

DIScope::generateRef now returns a DIScopeRef instead of a "Value *" for
readability and type safety.

llvm-svn: 190418

10 years agoARM: Use the PICADD opcode calculated.
Jim Grosbach [Tue, 10 Sep 2013 17:21:39 +0000 (17:21 +0000)]
ARM: Use the PICADD opcode calculated.

We were figuring out whether to use tPICADD or PICADD, then just using
tPICADD unconditionally anyway. Oops.

A testcase from someone familiar enough with ELF to produce one would
be appreciated. The existing PIC testcase correctly verifies the .s
generated, but that doesn't catch this bug, which only showed up in
direct-to-object mode.

http://llvm.org/bugs/show_bug.cgi?id=17180

llvm-svn: 190417

10 years agotest: Add @expectedFailureFreeBSD decorators
Ed Maste [Tue, 10 Sep 2013 17:15:05 +0000 (17:15 +0000)]
test: Add @expectedFailureFreeBSD decorators

llvm.org/pr17184 expression interpreter fails for crash/assert tests

llvm-svn: 190416

10 years agotest: Add @expectedFailureFreeBSD decorators
Ed Maste [Tue, 10 Sep 2013 16:25:05 +0000 (16:25 +0000)]
test: Add @expectedFailureFreeBSD decorators

http://llvm.org/pr17183 expression w/ varargs printf() fails
http://llvm.org/pr15302 'anonymous namespace' prefix missing

llvm-svn: 190415

10 years agoFixup for r190410: use lazy initialization for symbolizer as some compilers emit...
Alexey Samsonov [Tue, 10 Sep 2013 16:16:27 +0000 (16:16 +0000)]
Fixup for r190410: use lazy initialization for symbolizer as some compilers emit global constructor to setup vptr

llvm-svn: 190414

10 years agoAllow _clang-format as alternative to .clang-format config filename
Hans Wennborg [Tue, 10 Sep 2013 15:41:12 +0000 (15:41 +0000)]
Allow _clang-format as alternative to .clang-format config filename

Dotfiles are impractical on Windows. This makes clang-format search
for the style configuration file as '_clang-format' in addition to
the usual '.clang-format'. This is similar to how VIM searches for
'_vimrc' on Windows.

Differential Revision: http://llvm-reviews.chandlerc.com/D1629

llvm-svn: 190413

10 years agoRemove unused private member in ARMAsmPrinter.cpp.
Logan Chien [Tue, 10 Sep 2013 15:10:02 +0000 (15:10 +0000)]
Remove unused private member in ARMAsmPrinter.cpp.

This commit removes the unused "AttributeItem" from
ObjectAttributeEmitter.

llvm-svn: 190412

10 years ago[ASan] Remove the explicit function prototypes for intercepted functions on Windows
Timur Iskhodzhanov [Tue, 10 Sep 2013 14:42:15 +0000 (14:42 +0000)]
[ASan] Remove the explicit function prototypes for intercepted functions on Windows

llvm-svn: 190411

10 years ago[Sanitizer] Refactor symbolization interface: use class instead of several functions...
Alexey Samsonov [Tue, 10 Sep 2013 14:36:16 +0000 (14:36 +0000)]
[Sanitizer] Refactor symbolization interface: use class instead of several functions. Move some code around to get rid of extra source files

llvm-svn: 190410

10 years agoAdding LZMA as dep for XML2 on 2.8.0 or higher
Renato Golin [Tue, 10 Sep 2013 14:24:17 +0000 (14:24 +0000)]
Adding LZMA as dep for XML2 on 2.8.0 or higher

LibXML2 config doesn't specify lzma as a dependency, which breaks
cross-compilation builds using new linkers (ld 2.21 or higher).

There is a bug on libxml2 to fix that, but since it's going to take
a while for things to go round and back, so we should have a harmless
addition of the library until then.

llvm-svn: 190409

10 years agoDon't divide L and #x in macro definitions. Fixes http://llvm.org/PR17144
Alexander Kornienko [Tue, 10 Sep 2013 13:41:43 +0000 (13:41 +0000)]
Don't divide L and #x in macro definitions. Fixes llvm.org/PR17144

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1639

llvm-svn: 190408

10 years ago[asan] refactor the use-after-return API so that the size class is computed at compil...
Kostya Serebryany [Tue, 10 Sep 2013 13:16:56 +0000 (13:16 +0000)]
[asan] refactor the use-after-return API so that the size class is computed at compile time instead of at run-time. llvm part

llvm-svn: 190407

10 years ago[asan] refactor the use-after-return API so that the size class is computed at compil...
Kostya Serebryany [Tue, 10 Sep 2013 13:16:26 +0000 (13:16 +0000)]
[asan] refactor the use-after-return API so that the size class is computed at compile time instead of at run-time. compiler-rt part

llvm-svn: 190406

10 years agoCorrectly calculate OriginalColumn after multi-line tokens.
Alexander Kornienko [Tue, 10 Sep 2013 12:29:48 +0000 (12:29 +0000)]
Correctly calculate OriginalColumn after multi-line tokens.

Summary: This also unifies the handling of escaped newlines for all tokens.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1638

llvm-svn: 190405

10 years ago[SystemZ] Update README.
Richard Sandiford [Tue, 10 Sep 2013 12:22:45 +0000 (12:22 +0000)]
[SystemZ] Update README.

llvm-svn: 190404

10 years ago[msan] Make all pointers in msan_interface "const volatile void *".
Evgeniy Stepanov [Tue, 10 Sep 2013 11:54:51 +0000 (11:54 +0000)]
[msan] Make all pointers in msan_interface "const volatile void *".

This way msan annotations can be used with both normal and volatile memory.

llvm-svn: 190403

10 years ago[msan] bool -> int to make msan_interface.h C-compatible.
Evgeniy Stepanov [Tue, 10 Sep 2013 11:04:37 +0000 (11:04 +0000)]
[msan] bool -> int to make msan_interface.h C-compatible.

llvm-svn: 190402

10 years agoclang-format: Understand function type typedefs with typeof.
Daniel Jasper [Tue, 10 Sep 2013 10:26:38 +0000 (10:26 +0000)]
clang-format: Understand function type typedefs with typeof.

Before:
  typedef typeof(int(int, int)) * MyFunc;
After:
  typedef typeof(int(int, int)) *MyFunc;

This fixes llvm.org/PR17178.

llvm-svn: 190401

10 years ago[SystemZ] Add TM and TMY
Richard Sandiford [Tue, 10 Sep 2013 10:20:32 +0000 (10:20 +0000)]
[SystemZ] Add TM and TMY

The main complication here is that TM and TMY (the memory forms) set
CC differently from the register forms.  When the tested bits contain
some 0s and some 1s, the register forms set CC to 1 or 2 based on the
value the uppermost bit.  The memory forms instead set CC to 1
regardless of the uppermost bit.

Until now, I've tried to make it so that a branch never tests for an
impossible CC value.  E.g. NR only sets CC to 0 or 1, so branches on the
result will only test for 0 or 1.  Originally I'd tried to do the same
thing for TM and TMY by using custom matching code in ISelDAGToDAG.
That ended up being very ugly though, and would have meant duplicating
some of the chain checks that the common isel code does.

I've therefore gone for the simpler alternative of adding an extra
operand to the TM DAG opcode to say whether a memory form would be OK.
This means that the inverse of a "TM;JE" is "TM;JNE" rather than the
more precise "TM;JNLE", just like the inverse of "TMLL;JE" is "TMLL;JNE".
I suppose that's arguably less confusing though...

llvm-svn: 190400

10 years ago[mips][msa] Removed unsupported dot product instructions (dotp_[su].b).
Daniel Sanders [Tue, 10 Sep 2013 10:10:39 +0000 (10:10 +0000)]
[mips][msa] Removed unsupported dot product instructions (dotp_[su].b).

The dotp_[su].b instructions never existed in any revision of the MSA spec.

llvm-svn: 190399

10 years ago[mips][msa] Removed unsupported dot product instructions (dotp_[su].b)
Daniel Sanders [Tue, 10 Sep 2013 09:51:43 +0000 (09:51 +0000)]
[mips][msa] Removed unsupported dot product instructions (dotp_[su].b)

The dotp_[su].b instructions never existed in any revision of the MSA spec.

llvm-svn: 190398

10 years agoAdd test cases for Mips mthc1/mfhc1 instructions. Add check for odd value of register...
Vladimir Medic [Tue, 10 Sep 2013 09:50:01 +0000 (09:50 +0000)]
Add test cases for Mips mthc1/mfhc1 instructions. Add check for odd value of register when PFU is 32 bit.

llvm-svn: 190397

10 years agoRemove obsolete code from MipsAsmParser.cpp.
Vladimir Medic [Tue, 10 Sep 2013 09:39:55 +0000 (09:39 +0000)]
Remove obsolete code from MipsAsmParser.cpp.

llvm-svn: 190396

10 years agoCalculate and store ColumnWidth instead of CodePointCount in FormatTokens.
Alexander Kornienko [Tue, 10 Sep 2013 09:38:25 +0000 (09:38 +0000)]
Calculate and store ColumnWidth instead of CodePointCount in FormatTokens.

Summary:
This fixes various issues with mixed tabs and spaces handling, e.g.
when realigning block comments.

Reviewers: klimek, djasper

Reviewed By: djasper

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

llvm-svn: 190395

10 years agoDelete unused static class members
Alexey Samsonov [Tue, 10 Sep 2013 09:26:48 +0000 (09:26 +0000)]
Delete unused static class members

llvm-svn: 190394

10 years agoRejected 190391, due to failures on clang-x86_64-darwin11-nobootstrap-RAincremental.
Stepan Dyatkovskiy [Tue, 10 Sep 2013 08:37:22 +0000 (08:37 +0000)]
Rejected 190391, due to failures on clang-x86_64-darwin11-nobootstrap-RAincremental.

llvm-svn: 190393

10 years ago[ASan] Don't crash in DescribeHeapAddress if we don't know the current thread's ID
Timur Iskhodzhanov [Tue, 10 Sep 2013 08:36:21 +0000 (08:36 +0000)]
[ASan] Don't crash in DescribeHeapAddress if we don't know the current thread's ID

Also make DescribeThread easier to use.
This was firing on Dr.ASan runs, not sure how to repro InvalidTID in a simple test.

llvm-svn: 190392

10 years agoFix for PR16752. Second commit.
Stepan Dyatkovskiy [Tue, 10 Sep 2013 08:18:44 +0000 (08:18 +0000)]
Fix for PR16752. Second commit.

PR16752: 'mode' attribute for unusual targets doesn't work properly
Description:
Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth methods. Methods asks target for proper type for given bit width.
2. Fix handleModeAttr according to new methods in TargetInfo.

Fixes:
1st Commit (Done): Add new methods for TargetInfo:
     getRealTypeByWidth and getIntTypeByWidth
  for ASTContext names are almost same(invokes new methods from TargetInfo):
     getIntTypeForBitwidth and getRealTypeForBitwidth

2nd Commit (Current): Fix SemaDeclAttr, handleModeAttr function.

llvm-svn: 190391

10 years agoFix minor coding style issue in r190296 pointed out by Richard Smith.
David Tweed [Tue, 10 Sep 2013 08:00:34 +0000 (08:00 +0000)]
Fix minor coding style issue in r190296 pointed out by Richard Smith.

llvm-svn: 190390

10 years ago[python-bindings] Changed test_memory_buffer_create_from_file to just use the generic...
Michael Gottesman [Tue, 10 Sep 2013 06:58:00 +0000 (06:58 +0000)]
[python-bindings] Changed test_memory_buffer_create_from_file to just use the generic provided test_file instead of a binary.

llvm-svn: 190389

10 years ago[python bindings] Added code to get the length of a memory buffer. Tests are included.
Michael Gottesman [Tue, 10 Sep 2013 06:57:57 +0000 (06:57 +0000)]
[python bindings] Added code to get the length of a memory buffer. Tests are included.

This is a part of a series of patches that have been sitting fallow on a
personal branch that I have been messing with for a bit.

The patches start to flesh out the python llvm-c wrapper to the point where you can:

1. Load Modules from Bitcode/Dump/Print them.
2. Iterate over Functions from those modules/get their names/dump them.
3. Iterate over the BasicBlocks from said function/get the BB's name/dump it.
4. Iterate over the Instructions in said BasicBlocks/get the instructions
   name/dump the instruction.

My main interest in developing this was to be able to gather statistics about
LLVM IR using python scripts to speed up statistical profiling of different IR
level transformations (hence the focus on printing/dumping/getting names).

This is a gift from me to the LLVM community = ).

I am going to be committing the patches slowly over the next bit as I have time
to prepare the patches.

The overall organization follows the c-api like the bindings that are already
implemented.

llvm-svn: 190388

10 years agoSeparate popcnt and sse4.2 feature control somewhat to match gcc behavior.
Craig Topper [Tue, 10 Sep 2013 06:55:47 +0000 (06:55 +0000)]
Separate popcnt and sse4.2 feature control somewhat to match gcc behavior.

Enabling sse4.2 will implicitly enable popcnt unless popcnt is explicitly disabled.
Disabling sse4.2 will not disable popcnt if popcnt is explicitly enabled.

llvm-svn: 190387

10 years agoMCObjectFileInfo.cpp: Fix a couple of possible typo(s), s/DwarfPub/DwarfGnuPub/,...
NAKAMURA Takumi [Tue, 10 Sep 2013 06:01:56 +0000 (06:01 +0000)]
MCObjectFileInfo.cpp: Fix a couple of possible typo(s), s/DwarfPub/DwarfGnuPub/, in r190344.

XFAIL can be removed. (in r190374)

llvm-svn: 190386