platform/upstream/llvm.git
11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 years agoFixed some 80+ violations.
Michael Gottesman [Mon, 14 Jan 2013 01:47:53 +0000 (01:47 +0000)]
Fixed some 80+ violations.

llvm-svn: 172374

11 years agolibclang: remove a few const_casts
Dmitri Gribenko [Mon, 14 Jan 2013 00:46:27 +0000 (00:46 +0000)]
libclang: remove a few const_casts

llvm-svn: 172373

11 years agoConstify argument of Preprocessor::getMacroInfoHistory and propagate to
Dmitri Gribenko [Mon, 14 Jan 2013 00:36:42 +0000 (00:36 +0000)]
Constify argument of Preprocessor::getMacroInfoHistory and propagate to
callers, removing unneeded const_cast

llvm-svn: 172372

11 years agoUpdated the documentation in ObjCARC.cpp to fit the style guide better (i.e. use...
Michael Gottesman [Mon, 14 Jan 2013 00:35:14 +0000 (00:35 +0000)]
Updated the documentation in ObjCARC.cpp to fit the style guide better (i.e. use doxygen). Still some work to do though.

llvm-svn: 172371

11 years agoRemove an unneeded const_cast
Dmitri Gribenko [Mon, 14 Jan 2013 00:25:25 +0000 (00:25 +0000)]
Remove an unneeded const_cast

llvm-svn: 172370

11 years agoAdded bugzilla PR number to test case.
Michael Gottesman [Sun, 13 Jan 2013 22:17:22 +0000 (22:17 +0000)]
Added bugzilla PR number to test case.

llvm-svn: 172369

11 years agoFixed an infinite loop in the block escape in analysis in ObjCARC caused by 2x blocks...
Michael Gottesman [Sun, 13 Jan 2013 22:12:06 +0000 (22:12 +0000)]
Fixed an infinite loop in the block escape in analysis in ObjCARC caused by 2x blocks each assigned a value via a phi-node causing each to depend on the other.

A test case is provided as well.

llvm-svn: 172368

11 years agoArrayRef'ize Sema APIs related to format string checking
Dmitri Gribenko [Sun, 13 Jan 2013 20:46:02 +0000 (20:46 +0000)]
ArrayRef'ize Sema APIs related to format string checking

llvm-svn: 172367

11 years agoImplement __aeabi_lcmp and ulcmp
Tim Northover [Sun, 13 Jan 2013 19:18:02 +0000 (19:18 +0000)]
Implement __aeabi_lcmp and ulcmp

Patch contributed by Andrew Turner.

llvm-svn: 172366

11 years agoCorrect name of __aeabi_f2lz.
Tim Northover [Sun, 13 Jan 2013 19:18:00 +0000 (19:18 +0000)]
Correct name of __aeabi_f2lz.

Patch contributed by Andrew Turner.

llvm-svn: 172365

11 years agoFix typo in comment.
Nick Lewycky [Sun, 13 Jan 2013 19:03:55 +0000 (19:03 +0000)]
Fix typo in comment.

llvm-svn: 172364

11 years agofix compile-time regression report by Joerg Sonnenberger:
Nuno Lopes [Sun, 13 Jan 2013 18:02:57 +0000 (18:02 +0000)]
fix compile-time regression report by Joerg Sonnenberger:
cache result of Size/OffsetVisitor to speedup analysis of PHI nodes

llvm-svn: 172363

11 years agoDocument behavior of -Wformat-nonliteral, it is different from GCC
Dmitri Gribenko [Sun, 13 Jan 2013 16:37:18 +0000 (16:37 +0000)]
Document behavior of -Wformat-nonliteral, it is different from GCC

llvm-svn: 172362

11 years agoStronger respect the input codes line breaks wrt. comments.
Daniel Jasper [Sun, 13 Jan 2013 16:10:20 +0000 (16:10 +0000)]
Stronger respect the input codes line breaks wrt. comments.

clang-format should not change whether or not there is a line break
before a line comment as this strongly influences the percieved binding.

User input: void f(int a,
                   // b is awesome
   int b);
            void g(int a, // a is awesome
   int b);
Before:     void f(int a, // b is awesome
                   int b);
            void g(int a, // a is awesome
   int b);
After:      <unchanged from input>

llvm-svn: 172361

11 years agoDocumentation: use monospaced font for intrinsics' names
Dmitri Gribenko [Sun, 13 Jan 2013 16:07:49 +0000 (16:07 +0000)]
Documentation: use monospaced font for intrinsics' names

llvm-svn: 172360

11 years agoFix broken link to LangRef
Dmitri Gribenko [Sun, 13 Jan 2013 16:06:11 +0000 (16:06 +0000)]
Fix broken link to LangRef

llvm-svn: 172359

11 years agoRemove redundant 'llvm::' qualifications
Dmitri Gribenko [Sun, 13 Jan 2013 16:01:15 +0000 (16:01 +0000)]
Remove redundant 'llvm::' qualifications

llvm-svn: 172358

11 years agoFix LLP64 build.
Michael J. Spencer [Sun, 13 Jan 2013 16:00:51 +0000 (16:00 +0000)]
Fix LLP64 build.

llvm-svn: 172357

11 years agoUpdate links to "Itanium C++ ABI: Exception Handling" document
Dmitri Gribenko [Sun, 13 Jan 2013 15:53:09 +0000 (15:53 +0000)]
Update links to "Itanium C++ ABI: Exception Handling" document

llvm-svn: 172356