platform/upstream/llvm.git
12 years agoAdding a test case for expression parser's support for Unicode strings. This is an...
Enrico Granata [Tue, 15 Jan 2013 00:03:03 +0000 (00:03 +0000)]
Adding a test case for expression parser's support for Unicode strings. This is an expected failure for now

llvm-svn: 172493

12 years ago<rdar://problem/12790664>
Enrico Granata [Mon, 14 Jan 2013 23:53:26 +0000 (23:53 +0000)]
<rdar://problem/12790664>

Single-character Unicode data formatters

llvm-svn: 172492

12 years agoNow GenericAsmParser and AsmParser are no longer friends, GenericAsmParser can
Eli Bendersky [Mon, 14 Jan 2013 23:43:18 +0000 (23:43 +0000)]
Now GenericAsmParser and AsmParser are no longer friends, GenericAsmParser can
simply use the getParser method from MCAsmParserExtension, working through the
MCAsmParser interface. There's no longer a need to overload that method to
cast it to the concrete AsmParser.

llvm-svn: 172491

12 years agoProperly encapsulate additional methods and data from AsmParser.
Eli Bendersky [Mon, 14 Jan 2013 23:22:36 +0000 (23:22 +0000)]
Properly encapsulate additional methods and data from AsmParser.

This finally allows AsmParser to no longer list GenericAsmParser as a friend.
All member vars directly accessed by GenericAsmParser have been properly
encapsulated and exposed through the MCAsmParser interface. This reduces the
coupling between AsmParser and GenericAsmParser.

llvm-svn: 172490

12 years agoRemove trailing spaces.
Jakub Staszak [Mon, 14 Jan 2013 23:16:36 +0000 (23:16 +0000)]
Remove trailing spaces.

llvm-svn: 172489

12 years agoThis change is to implement following rules under the condition C_A and/or C_R
Shuxin Yang [Mon, 14 Jan 2013 22:48:41 +0000 (22:48 +0000)]
This change is to implement following rules under the condition C_A and/or C_R

 ---------------------------------------------------------------------------
 C_A: reassociation is allowed
 C_R: reciprocal of a constant C is appropriate, which means
    - 1/C is exact, or
    - reciprocal is allowed and 1/C is neither a special value nor a denormal.
 -----------------------------------------------------------------------------

 rule1:  (X/C1) / C2 => X / (C2*C1)  (if C_A)
                     => X * (1/(C2*C1))  (if C_A && C_R)
 rule 2:  X*C1 / C2 => X * (C1/C2)  if C_A
 rule 3: (X/Y)/Z = > X/(Y*Z)  (if C_A && at least one of Y and Z is symbolic value)
 rule 4: Z/(X/Y) = > (Z*Y)/X  (similar to rule3)

 rule 5: C1/(X*C2) => (C1/C2) / X (if C_A)
 rule 6: C1/(X/C2) => (C1*C2) / X (if C_A)
 rule 7: C1/(C2/X) => (C1/C2) * X (if C_A)

llvm-svn: 172488

12 years agoDocument that we should recognize attributes supported by gcc with C++11
Dmitri Gribenko [Mon, 14 Jan 2013 22:44:07 +0000 (22:44 +0000)]
Document that we should recognize attributes supported by gcc with C++11
[[gnu::...]] syntax

Pointed out by Richard Smith on the mailing list.

llvm-svn: 172487

12 years agoclang-format goodness
Tobias Grosser [Mon, 14 Jan 2013 22:40:23 +0000 (22:40 +0000)]
clang-format goodness

llvm-svn: 172486

12 years agoRefactor to call ActOnFinishFullExpr on every full expression. Teach
Richard Smith [Mon, 14 Jan 2013 22:39:08 +0000 (22:39 +0000)]
Refactor to call ActOnFinishFullExpr on every full expression. Teach
ActOnFinishFullExpr that some of its checks only apply to discarded-value
expressions. This adds missing checks for unexpanded variadic template
parameter packs to a handful of constructs.

llvm-svn: 172485

12 years ago[ms-inline asm] Extend support for parsing Intel bracketed memory operands that
Chad Rosier [Mon, 14 Jan 2013 22:31:35 +0000 (22:31 +0000)]
[ms-inline asm] Extend support for parsing Intel bracketed memory operands that
have an arbitrary ordering of the base register, index register and displacement.
rdar://12527141

llvm-svn: 172484

12 years agoImprove r172468: const_cast is not needed here
Dmitri Gribenko [Mon, 14 Jan 2013 22:18:18 +0000 (22:18 +0000)]
Improve r172468: const_cast is not needed here

llvm-svn: 172483

12 years agoFix shadowed variable warning
Nick Kledzik [Mon, 14 Jan 2013 22:10:22 +0000 (22:10 +0000)]
Fix shadowed variable warning

llvm-svn: 172482

12 years agoImprove r172471: avoid all those extra casts on the lines nearby
Dmitri Gribenko [Mon, 14 Jan 2013 22:08:37 +0000 (22:08 +0000)]
Improve r172471: avoid all those extra casts on the lines nearby

llvm-svn: 172481

12 years agoThis patch addresses an incorrect transformation in the DAG combiner.
Bill Schmidt [Mon, 14 Jan 2013 22:04:38 +0000 (22:04 +0000)]
This patch addresses an incorrect transformation in the DAG combiner.

The included test case is derived from one of the GCC compatibility tests.
The problem arises after the selection DAG has been converted to type-legalized
form.  The combiner first sees a 64-bit load that can be converted into a
pre-increment form.  The original load feeds into a SRL that isolates the
upper 32 bits of the loaded doubleword.  This looks like an opportunity for
DAGCombiner::ReduceLoadWidth() to replace the 64-bit load with a 32-bit load.

However, this transformation is not valid, as the replacement load is not
a pre-increment load.  The pre-increment load produces an extra result,
which feeds a subsequent add instruction.  The replacement load only has
one result value, and this value is propagated to all uses of the pre-
increment load, including the add.  Because the add is looking for the
second result value as its operand, it ends up attempting to add a constant
to a token chain, resulting in a crash.

So the patch simply disables this transformation for any load with more than
two result values.

llvm-svn: 172480

12 years agoOnce a function has been JIT-compiled once, don't
Sean Callanan [Mon, 14 Jan 2013 21:45:38 +0000 (21:45 +0000)]
Once a function has been JIT-compiled once, don't
JIT it again.

llvm-svn: 172477

12 years agoMultiprecision subtraction builtins.
Michael Gottesman [Mon, 14 Jan 2013 21:44:30 +0000 (21:44 +0000)]
Multiprecision subtraction builtins.

We lower these into 2x chained usub.with.overflow intrinsics.

llvm-svn: 172476

12 years agoFollow up of commit r172472.
Quentin Colombet [Mon, 14 Jan 2013 21:34:09 +0000 (21:34 +0000)]
Follow up of commit r172472.
Refactor the big if/else sequence into one string switch for ARM subtype selection.

llvm-svn: 172475

12 years agoImprove r172464: const_cast is not needed if the variable is not const
Dmitri Gribenko [Mon, 14 Jan 2013 21:23:37 +0000 (21:23 +0000)]
Improve r172464: const_cast is not needed if the variable is not const

llvm-svn: 172474

12 years agoComplete the existing support of ARM v6m, v7m, and v7em, i.e., respectively cortex...
Quentin Colombet [Mon, 14 Jan 2013 21:07:43 +0000 (21:07 +0000)]
Complete the existing support of ARM v6m, v7m, and v7em, i.e., respectively cortex-m0, cortex-m3, and cortex-m4 on the backend side.

Adds new subtype values for the MachO format and use them when the related triple are set.

llvm-svn: 172472

12 years agoFix Casting
David Greene [Mon, 14 Jan 2013 21:04:47 +0000 (21:04 +0000)]
Fix Casting

Fix a casting-away-const compiler warning.

llvm-svn: 172471

12 years agoFix Casting
David Greene [Mon, 14 Jan 2013 21:04:45 +0000 (21:04 +0000)]
Fix Casting

Do proper casting to eliminate a const-away-cast compiler warning.

llvm-svn: 172470

12 years agoFix More Casts
David Greene [Mon, 14 Jan 2013 21:04:44 +0000 (21:04 +0000)]
Fix More Casts

Properly cast some more code that triggered cast-away-const errors.

llvm-svn: 172469

12 years agoFix Another Cast
David Greene [Mon, 14 Jan 2013 21:04:42 +0000 (21:04 +0000)]
Fix Another Cast

Properly cast code to eliminate cast-away-const errors.

llvm-svn: 172468

12 years agoFix Casting Bug
David Greene [Mon, 14 Jan 2013 21:04:40 +0000 (21:04 +0000)]
Fix Casting Bug

Add a const version of getFpValPtr to avoid a cast-away-const warning.

llvm-svn: 172467

12 years agoFix More Casts
David Greene [Mon, 14 Jan 2013 21:04:38 +0000 (21:04 +0000)]
Fix More Casts

Fix another cast-away-const cast.

llvm-svn: 172466

12 years agoFix Casting
David Greene [Mon, 14 Jan 2013 21:04:37 +0000 (21:04 +0000)]
Fix Casting

Stop a gcc warning about casting away const.

llvm-svn: 172465

12 years agoFix Casts
David Greene [Mon, 14 Jan 2013 21:04:35 +0000 (21:04 +0000)]
Fix Casts

Use const_cast<> to avoid cast-away-const errors.

llvm-svn: 172464

12 years agoSCEVExpander fix. RAUW needs to update the InsertedExpressions cache.
Andrew Trick [Mon, 14 Jan 2013 21:00:37 +0000 (21:00 +0000)]
SCEVExpander fix. RAUW needs to update the InsertedExpressions cache.

Note that this bug is only exposed because LTO fails to use TTI.

Fixes self-LTO of clang. rdar://13007381.

llvm-svn: 172462

12 years agoMake <cmath> classification macros work with integral types.
Howard Hinnant [Mon, 14 Jan 2013 20:56:22 +0000 (20:56 +0000)]
Make <cmath> classification macros work with integral types.

llvm-svn: 172461

12 years agoFix typo in comment.
Nick Lewycky [Mon, 14 Jan 2013 20:56:10 +0000 (20:56 +0000)]
Fix typo in comment.

llvm-svn: 172460

12 years agoTopologically sort the link options generated for modules based on
Douglas Gregor [Mon, 14 Jan 2013 20:53:57 +0000 (20:53 +0000)]
Topologically sort the link options generated for modules based on
module-import dependencies, so we'll get the link order correct for
those silly linkers that need it.

llvm-svn: 172459

12 years agoFix a race in the construction of future. This fixes http://llvm.org/bugs/show_bug...
Howard Hinnant [Mon, 14 Jan 2013 20:01:24 +0000 (20:01 +0000)]
Fix a race in the construction of future.  This fixes llvm.org/bugs/show_bug.cgi?id=14934.

llvm-svn: 172456

12 years ago[ADT/StringMap] Add a constructor in StringMap that accepts both an
Argyrios Kyrtzidis [Mon, 14 Jan 2013 19:41:09 +0000 (19:41 +0000)]
[ADT/StringMap] Add a constructor in StringMap that accepts both an
initial size and an allocator.

llvm-svn: 172455

12 years agoFix DenseMap when LLVM_HAS_RVALUE_REFERENCES is defined but equals 0.
Joe Groff [Mon, 14 Jan 2013 19:37:42 +0000 (19:37 +0000)]
Fix DenseMap when LLVM_HAS_RVALUE_REFERENCES is defined but equals 0.

llvm-svn: 172454

12 years agoAdd DenseMap::insert(value_type&&) method.
Joe Groff [Mon, 14 Jan 2013 19:24:15 +0000 (19:24 +0000)]
Add DenseMap::insert(value_type&&) method.
Use the existing move implementation of the internal DenseMap::InsertIntoBucket
method to provide a user-facing move insert method.

llvm-svn: 172453

12 years agoChanged SmallPtrSet.count guard + SmallPtrSet.insert to just SmallPtrSet.insert.
Michael Gottesman [Mon, 14 Jan 2013 19:18:39 +0000 (19:18 +0000)]
Changed SmallPtrSet.count guard + SmallPtrSet.insert to just SmallPtrSet.insert.

llvm-svn: 172452

12 years agoMove CheckForValidSection to the MCAsmParser interface.
Eli Bendersky [Mon, 14 Jan 2013 19:15:01 +0000 (19:15 +0000)]
Move CheckForValidSection to the MCAsmParser interface.

Now that it behaves itself in terms of streamer independence (r172450), this
method can be moved to MCAsmParser to be available to all extensions,
overriding, etc.

-- -This line, and those below, will be ignored--

M    lib/MC/MCParser/AsmParser.cpp
M    include/llvm/MC/MCParser/MCAsmParser.h

llvm-svn: 172451

12 years agoExpose an InitToTextSection through MCStreamer.
Eli Bendersky [Mon, 14 Jan 2013 19:04:57 +0000 (19:04 +0000)]
Expose an InitToTextSection through MCStreamer.

The aim of this patch is to fix the following piece of code in the
platform-independent AsmParser:

void AsmParser::CheckForValidSection() {
  if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {
    TokError("expected section directive before assembly directive");
    Out.SwitchSection(Ctx.getMachOSection(
                        "__TEXT", "__text",
                        MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
                        0, SectionKind::getText()));
  }
}

This was added for the "-n" option of llvm-mc.

The proposed fix adds another virtual method to MCStreamer, called
InitToTextSection. Conceptually, it's similar to the existing
InitSections which initializes all common sections and switches to
text. The new method is implemented by each platform streamer in a way
that it sees fit. So AsmParser can now do this:

void AsmParser::CheckForValidSection() {
  if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {
    TokError("expected section directive before assembly directive");
    Out.InitToTextSection();
  }
}

Which is much more reasonable.

llvm-svn: 172450

12 years agoMove ParseMacroArgument to the MCAsmParser interfance.
Eli Bendersky [Mon, 14 Jan 2013 19:00:26 +0000 (19:00 +0000)]
Move ParseMacroArgument to the MCAsmParser interfance.

Since it's used by extensions. One further step to fully decoupling
GenericAsmParser from an intimate knowledge of the internals of AsmParser,
pointing it to the MCASmParser interface instead (like all other parser
extensions do).

Since this change moves the MacroArgument type to the interface header, it's
renamed to be a bit more descriptive in a general context.

llvm-svn: 172449

12 years agoWhen forming the link options for an imported module, also include the
Douglas Gregor [Mon, 14 Jan 2013 19:00:05 +0000 (19:00 +0000)]
When forming the link options for an imported module, also include the
link options for the modules it imports.

llvm-svn: 172448

12 years agoFix string conversions functions to throw out_of_range properly. Fixes http://llvm...
Howard Hinnant [Mon, 14 Jan 2013 18:59:43 +0000 (18:59 +0000)]
Fix string conversions functions to throw out_of_range properly.  Fixes llvm.org/bugs/show_bug.cgi?id=14919.

llvm-svn: 172447

12 years ago[analyzer] Add ProgramStatePartialTrait<const void *>.
Jordan Rose [Mon, 14 Jan 2013 18:58:42 +0000 (18:58 +0000)]
[analyzer] Add ProgramStatePartialTrait<const void *>.

This should fix cast-away-const warnings reported by David Greene.

llvm-svn: 172446

12 years ago[analyzer] Fix cast-away-const warning by using const_cast.
Jordan Rose [Mon, 14 Jan 2013 18:58:38 +0000 (18:58 +0000)]
[analyzer] Fix cast-away-const warning by using const_cast.

Patch by David Greene, modified by me.

llvm-svn: 172445

12 years ago[analyzer] -drain is not an alias for -release.
Jordan Rose [Mon, 14 Jan 2013 18:58:33 +0000 (18:58 +0000)]
[analyzer] -drain is not an alias for -release.

This was previously added to support -[NSAutoreleasePool drain], which
behaves like -release under non-GC and "please collect" under GC. We're
not currently modeling the autorelease pool stack, though, so we can
just take this out entirely.

Fixes PR14927.

llvm-svn: 172444

12 years agoFix a logic error in the condition for a warning log message.
Jim Ingham [Mon, 14 Jan 2013 18:30:01 +0000 (18:30 +0000)]
Fix a logic error in the condition for a warning log message.

llvm-svn: 172442

12 years agoSwitch autolinking metadata format over to actual linker options, e.g.,
Douglas Gregor [Mon, 14 Jan 2013 18:28:43 +0000 (18:28 +0000)]
Switch autolinking metadata format over to actual linker options, e.g.,

  !0 = metadata !{metadata !"-lautolink"}
  !1 = metadata !{metadata !"-framework", metadata !"autolink_framework"}

referenced from llvm.module.linkoptions, e.g.,

  !llvm.module.linkoptions = !{!0, !1, !2, !3}

This conceptually moves the logic for figuring out the syntax the
linker will accept from LLVM into Clang. Moreover, it makes it easier
to support MSVC's

  #pragma comment(linker, "some option")

in the future, should anyone care to do so.

llvm-svn: 172441

12 years agoEncapsulate the MacroEnabled flag in AsmParser behind accessor methods.
Eli Bendersky [Mon, 14 Jan 2013 18:08:41 +0000 (18:08 +0000)]
Encapsulate the MacroEnabled flag in AsmParser behind accessor methods.

The methods are also exposed via the MCAsmParser interface, which allows more
than one client to control them. Previously, GenericAsmParser was playing with
a member var in AsmParser directly (by virtue of being its friend).

llvm-svn: 172440

12 years agoInfer "link" lines for top-level frameworks. Essentially, a framework
Douglas Gregor [Mon, 14 Jan 2013 17:57:51 +0000 (17:57 +0000)]
Infer "link" lines for top-level frameworks. Essentially, a framework
will have a shared library with the same name as its framework (and no
suffix!) within its .framework directory. Detect this both when
inferring the whole top-level framework and when parsing a module map.

llvm-svn: 172439

12 years agoThis patch addresses varargs processing for small complex types under
Bill Schmidt [Mon, 14 Jan 2013 17:45:36 +0000 (17:45 +0000)]
This patch addresses varargs processing for small complex types under
the 64-bit PowerPC ELF ABI.

The ABI requires that the real and imaginary parts of a complex argument
each occupy their own doubleword.  Arguments smaller than 8 bytes are
right-adjusted within the doubleword.

Clang expects EmitVAARG() to return a pointer to a structure in which
the real and imaginary parts are packed adjacently in memory.  To accomplish
this, we generate code to load the code appropriately from the varargs
location and pack the values into a temporary variable in the form Clang
expects, returning a pointer to that structure.

The test case demonstrates correct code generation for all "small" complex
types on PPC64:  int, short, char, and float.

llvm-svn: 172438

12 years agoImplement parsing, AST, (de-)serialization, and placeholder global
Douglas Gregor [Mon, 14 Jan 2013 17:21:00 +0000 (17:21 +0000)]
Implement parsing, AST, (de-)serialization, and placeholder global
metadata for linking against the libraries/frameworks for imported
modules.

The module map language is extended with a new "link" directive that
specifies what library or framework to link against when a module is
imported, e.g.,

  link "clangAST"

or

  link framework "MyFramework"

Importing the corresponding module (or any of its submodules) will
eventually link against the named library/framework.

For now, I've added some placeholder global metadata that encodes the
imported libraries/frameworks, so that we can test that this
information gets through to the IR. The format of the data is still
under discussion.

llvm-svn: 172437

12 years agoMichael van der Westhuizen: Improve support for testing on Linux. Fixes http://llvm...
Howard Hinnant [Mon, 14 Jan 2013 17:12:54 +0000 (17:12 +0000)]
Michael van der Westhuizen: Improve support for testing on Linux.  Fixes llvm.org/bugs/show_bug.cgi?id=14892.

llvm-svn: 172436

12 years agoMichael van der Westhuizen: Patches for Linux. Fixes http://llvm.org/bugs/show_bug...
Howard Hinnant [Mon, 14 Jan 2013 17:07:27 +0000 (17:07 +0000)]
Michael van der Westhuizen:  Patches for Linux.  Fixes llvm.org/bugs/show_bug.cgi?id=14648.

llvm-svn: 172435

12 years agoTest source file name in diagnostics
Alexander Kornienko [Mon, 14 Jan 2013 17:01:57 +0000 (17:01 +0000)]
Test source file name in diagnostics

llvm-svn: 172434

12 years agoFixes formatting of nested brace initializers.
Manuel Klimek [Mon, 14 Jan 2013 16:41:43 +0000 (16:41 +0000)]
Fixes formatting of nested brace initializers.

We now format this correctly:
Status::Rep Status::global_reps[3] = {
  { kGlobalRef, OK_CODE, NULL, NULL, NULL },
  { kGlobalRef, CANCELLED_CODE, NULL, NULL, NULL },
  { kGlobalRef, UNKNOWN_CODE, NULL, NULL, NULL }
};

- fixed a bug where BreakBeforeClosingBrace would be set on the wrong
  state
- added penalties for breaking between = and {, and between { and any
  other non-{ token

llvm-svn: 172433

12 years agoAdd support for Chromium style.
Daniel Jasper [Mon, 14 Jan 2013 16:26:38 +0000 (16:26 +0000)]
Add support for Chromium style.

llvm-svn: 172432

12 years agoMake single-line if statements optional.
Daniel Jasper [Mon, 14 Jan 2013 16:24:39 +0000 (16:24 +0000)]
Make single-line if statements optional.

Now, "if (a) return;" is only allowed, if this option is set.

Also add a Chromium style which is currently identical to Google style
except for this option.

llvm-svn: 172431

12 years ago[ubsan] Use __sanitizer::atomic_exchange(), prefer shared impl.
Will Dietz [Mon, 14 Jan 2013 16:13:52 +0000 (16:13 +0000)]
[ubsan] Use __sanitizer::atomic_exchange(), prefer shared impl.

Specify weaker memory order in case we optimize for it in the future,
presently still doing same __sync_lock_test_and_set() as before.

Change suggested by Alexey Samsonov, thanks!

llvm-svn: 172429

12 years agoFix a bug in the line merging.
Daniel Jasper [Mon, 14 Jan 2013 16:02:06 +0000 (16:02 +0000)]
Fix a bug in the line merging.

If the first line of a merge would exactly fit into the column limit,
an unsigned overflow made us not break.

llvm-svn: 172426

12 years agoFix bug that would lead to joining preprocessor directives.
Daniel Jasper [Mon, 14 Jan 2013 15:52:06 +0000 (15:52 +0000)]
Fix bug that would lead to joining preprocessor directives.

Before: #include "a.h" #include "b.h"
After:  #include "a.h"
        #include "b.h"
llvm-svn: 172424

12 years agoPut simple preprocessor directives on a single line.
Daniel Jasper [Mon, 14 Jan 2013 15:40:57 +0000 (15:40 +0000)]
Put simple preprocessor directives on a single line.

Before: #define A  \
          A
After:  #define A A
llvm-svn: 172423

12 years agoMove large part of asan_test_utils.h to sanitizer_common.
Evgeniy Stepanov [Mon, 14 Jan 2013 15:12:26 +0000 (15:12 +0000)]
Move large part of asan_test_utils.h to sanitizer_common.
Move my_rand() to the common header.

This lets us avoid the use of rand_r in sanitizer_common tests.
There is no rand_r on Android.

llvm-svn: 172421

12 years agoTurns out there is a simpler way of getting a set difference in bash than parsing...
Benjamin Kramer [Mon, 14 Jan 2013 15:00:48 +0000 (15:00 +0000)]
Turns out there is a simpler way of getting a set difference in bash than parsing diff output.

llvm-svn: 172420

12 years agoFix-up copypasto from r172410
Alexey Samsonov [Mon, 14 Jan 2013 14:52:35 +0000 (14:52 +0000)]
Fix-up copypasto from r172410

llvm-svn: 172419

12 years agoasan: fix windows build
Dmitry Vyukov [Mon, 14 Jan 2013 14:28:06 +0000 (14:28 +0000)]
asan: fix windows build

llvm-svn: 172415

12 years agoAdding a .gitignore to tools-extra
Edwin Vane [Mon, 14 Jan 2013 14:20:19 +0000 (14:20 +0000)]
Adding a .gitignore to tools-extra

Reviewers: klimek

llvm-svn: 172414

12 years agoPut short if statements on a single line.
Daniel Jasper [Mon, 14 Jan 2013 14:14:23 +0000 (14:14 +0000)]
Put short if statements on a single line.

Before: if (a)
          return;
After:  if (a) return;

Not yet sure, whether this is always desired, but we can add options and
make this a style parameter as we go along.

llvm-svn: 172413

12 years agoRevert r171829 "Split changeset_ty using iterators instead of loops" as it breaks...
Timur Iskhodzhanov [Mon, 14 Jan 2013 14:13:06 +0000 (14:13 +0000)]
Revert r171829 "Split changeset_ty using iterators instead of loops" as it breaks the VS2008 build

llvm-svn: 172411

12 years agoBuild rules for sanitizer_common tests on Android.
Evgeniy Stepanov [Mon, 14 Jan 2013 14:08:25 +0000 (14:08 +0000)]
Build rules for sanitizer_common tests on Android.

llvm-svn: 172410

12 years agoDump comments in -ast-dump.
Alexander Kornienko [Mon, 14 Jan 2013 14:07:11 +0000 (14:07 +0000)]
Dump comments in -ast-dump.
http://llvm-reviews.chandlerc.com/D269

"Added dumping of declaration comments in ASTDumper. This required moving the
comment dumping code from CommentDumper so that the indentation is correct."

Patch by Philip Craig!

llvm-svn: 172409

12 years agoRemove thread-locals from sanitizer_common tests.
Evgeniy Stepanov [Mon, 14 Jan 2013 14:06:58 +0000 (14:06 +0000)]
Remove thread-locals from sanitizer_common tests.

Not supported on Android.

llvm-svn: 172408

12 years agoAdded a test for clang-format diagnostics.
Alexander Kornienko [Mon, 14 Jan 2013 13:57:05 +0000 (13:57 +0000)]
Added a test for clang-format diagnostics.

llvm-svn: 172407

12 years agoFix: correct file name in diagnostics.
Alexander Kornienko [Mon, 14 Jan 2013 13:40:44 +0000 (13:40 +0000)]
Fix: correct file name in diagnostics.

llvm-svn: 172405

12 years agoclang/test/SemaCXX/cxx11-gnu-attrs.cpp: Add explicit -triple x86_64-unknown-unknown...
NAKAMURA Takumi [Mon, 14 Jan 2013 13:16:02 +0000 (13:16 +0000)]
clang/test/SemaCXX/cxx11-gnu-attrs.cpp: Add explicit -triple x86_64-unknown-unknown, or it doesn't work for targetting win32.

llvm-svn: 172404

12 years agoRefactor datastructure used in clang-format.
Daniel Jasper [Mon, 14 Jan 2013 13:08:07 +0000 (13:08 +0000)]
Refactor datastructure used in clang-format.

Main difference, add an AnnotatedLine class to hold information about a
line while formatting. At the same time degrade the UnwrappedLine class
to a class solely used for communicating between the UnwrappedLineParser
and the Formatter.

No functional changes intended.

llvm-svn: 172403

12 years agoImprove understanding post increment and decrement.
Daniel Jasper [Mon, 14 Jan 2013 12:18:19 +0000 (12:18 +0000)]
Improve understanding post increment and decrement.

Before: (a->f()) ++;
        a[42] ++;
After:  (a->f())++;
        a[42]++;
llvm-svn: 172400

12 years agoCustom DiagnosticConsumer parameter of reformat() + silence diagnostics in unit tests.
Alexander Kornienko [Mon, 14 Jan 2013 11:34:14 +0000 (11:34 +0000)]
Custom DiagnosticConsumer parameter of reformat() + silence diagnostics in unit tests.

Summary:
Added tests for clang-format diagnostics. Added DiagnosticConsumer
argument to clang::format::reformat().

Reviewers: klimek, djasper

Reviewed By: djasper

CC: cfe-commits, thakis, rafael.espindola
Differential Revision: http://llvm-reviews.chandlerc.com/D290

llvm-svn: 172399

12 years agoASan: Disable alloc/dealloc mismatch test on Android. It's not supposed to work there
Alexey Samsonov [Mon, 14 Jan 2013 11:07:59 +0000 (11:07 +0000)]
ASan: Disable alloc/dealloc mismatch test on Android. It's not supposed to work there

llvm-svn: 172398

12 years ago[asan] use the slow CFI-based unwinder when reporting an error. Still use the fast...
Kostya Serebryany [Mon, 14 Jan 2013 11:01:34 +0000 (11:01 +0000)]
[asan] use the slow CFI-based unwinder when reporting an error. Still use the fast unwinder for malloc/free. Linux-x86-only for now.

llvm-svn: 172397

12 years agoAdds some more tests for * and &.
Manuel Klimek [Mon, 14 Jan 2013 10:58:01 +0000 (10:58 +0000)]
Adds some more tests for * and &.

While reviewing r172303 I noticed that I wasn't sure whether we still
format those correctly and didn't see any tests.

llvm-svn: 172396

12 years agoasan/tsan: mmap shadow memory before allocating memory (otherwise other threads can...
Dmitry Vyukov [Mon, 14 Jan 2013 10:49:11 +0000 (10:49 +0000)]
asan/tsan: mmap shadow memory before allocating memory (otherwise other threads can access non yet allocated shadow)

llvm-svn: 172395

12 years agoASan: Disable alloc/dealloc-mismatch checker on Mac for now (it produces weird false...
Alexey Samsonov [Mon, 14 Jan 2013 10:18:38 +0000 (10:18 +0000)]
ASan: Disable alloc/dealloc-mismatch checker on Mac for now (it produces weird false positives on googletest)

llvm-svn: 172394

12 years agotsan: describe stack and TLS addresses
Dmitry Vyukov [Mon, 14 Jan 2013 10:00:03 +0000 (10:00 +0000)]
tsan: describe stack and TLS addresses

llvm-svn: 172393

12 years agoasan: enable allocator version 1 by default
Dmitry Vyukov [Mon, 14 Jan 2013 09:03:24 +0000 (09:03 +0000)]
asan: enable allocator version 1 by default

llvm-svn: 172392

12 years agoAdd extra tests for [[gnu::...]] attributes, missed from r172382.
Richard Smith [Mon, 14 Jan 2013 08:57:42 +0000 (08:57 +0000)]
Add extra tests for [[gnu::...]] attributes, missed from r172382.

llvm-svn: 172391

12 years agoasan/tsan: fix memory allocator statistics
Dmitry Vyukov [Mon, 14 Jan 2013 08:51:08 +0000 (08:51 +0000)]
asan/tsan: fix memory allocator statistics

llvm-svn: 172390

12 years agoasan: fix Android build
Dmitry Vyukov [Mon, 14 Jan 2013 08:48:26 +0000 (08:48 +0000)]
asan: fix Android build

llvm-svn: 172389

12 years agoasan/tsan: faster memory allocator
Dmitry Vyukov [Mon, 14 Jan 2013 08:23:34 +0000 (08:23 +0000)]
asan/tsan: faster memory allocator
1. Increase size classes from 32k to 128k
2. Use lock-free stack in central cache
3. Use blocking mutex when allocate new memory with mmap

llvm-svn: 172388

12 years agotsan: fix cmake warning (unused private field)
Dmitry Vyukov [Mon, 14 Jan 2013 08:21:34 +0000 (08:21 +0000)]
tsan: fix cmake warning (unused private field)

llvm-svn: 172387

12 years agotsan: add the FIXME
Dmitry Vyukov [Mon, 14 Jan 2013 08:12:47 +0000 (08:12 +0000)]
tsan: add the FIXME

llvm-svn: 172386

12 years agoasan: fix compilation errors in mutex
Dmitry Vyukov [Mon, 14 Jan 2013 08:01:58 +0000 (08:01 +0000)]
asan: fix compilation errors in mutex

llvm-svn: 172385

12 years agoFix regression in r172376. Don't try to detect missing 'constexpr' specifiers
Richard Smith [Mon, 14 Jan 2013 08:00:39 +0000 (08:00 +0000)]
Fix regression in r172376. Don't try to detect missing 'constexpr' specifiers
on redeclarations, since that makes us pick wrong prior declarations under
some circumstances.

llvm-svn: 172384

12 years ago[asan] add more frames to standalone_malloc_test
Kostya Serebryany [Mon, 14 Jan 2013 07:59:09 +0000 (07:59 +0000)]
[asan] add more frames to standalone_malloc_test

llvm-svn: 172383

12 years agoAccept [[gnu::*]] for all __attribute__((*))s which are:
Richard Smith [Mon, 14 Jan 2013 07:53:01 +0000 (07:53 +0000)]
Accept [[gnu::*]] for all __attribute__((*))s which are:
 1) Supported by Clang, and
 2) Supported by GCC, and
 3) Documented in GCC's manual.

g++ allows its C++11-style attributes to appertain only to the entity being
declared, and never to a type (even for a type attribute), so we do the same.

llvm-svn: 172382

12 years agoasan: add missing file
Dmitry Vyukov [Mon, 14 Jan 2013 07:52:01 +0000 (07:52 +0000)]
asan: add missing file

llvm-svn: 172381

12 years agoasan/tsan: move blocking mutex from asan to sanitizer_common
Dmitry Vyukov [Mon, 14 Jan 2013 07:51:39 +0000 (07:51 +0000)]
asan/tsan: move blocking mutex from asan to sanitizer_common

llvm-svn: 172380

12 years agoSimplify nested strconcats in X86 td files since strconcat can take more than 2 argum...
Craig Topper [Mon, 14 Jan 2013 07:46:34 +0000 (07:46 +0000)]
Simplify nested strconcats in X86 td files since strconcat can take more than 2 arguments.

llvm-svn: 172379

12 years agoCreate a single multiclass for SSE and AVX version of MOVL/MOVH. Prevents needing...
Craig Topper [Mon, 14 Jan 2013 07:26:58 +0000 (07:26 +0000)]
Create a single multiclass for SSE and AVX version of MOVL/MOVH. Prevents needing to specify everything twice. No functional change intended

llvm-svn: 172378

12 years agoFormatter: Add a test for bitfields.
Nico Weber [Mon, 14 Jan 2013 05:49:49 +0000 (05:49 +0000)]
Formatter: Add a test for bitfields.

They work fine, but this fifth use of colons (after labels, in ?:,
in initalizer lists in constructors, in objc method expressions, and in
bitfields) wasn't covered by tests yet.

llvm-svn: 172377

12 years agoPR12008: defer adding the implicit 'const' to a constexpr member function until
Richard Smith [Mon, 14 Jan 2013 05:37:29 +0000 (05:37 +0000)]
PR12008: defer adding the implicit 'const' to a constexpr member function until
we know whether it is static.

llvm-svn: 172376

12 years ago*this is const in a trailing-return-type for a constexpr member function.
Richard Smith [Mon, 14 Jan 2013 01:55:13 +0000 (01:55 +0000)]
*this is const in a trailing-return-type for a constexpr member function.

llvm-svn: 172375