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
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
Howard Hinnant [Mon, 14 Jan 2013 20:56:22 +0000 (20:56 +0000)]
Make <cmath> classification macros work with integral types.
llvm-svn: 172461
Nick Lewycky [Mon, 14 Jan 2013 20:56:10 +0000 (20:56 +0000)]
Fix typo in comment.
llvm-svn: 172460
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Alexander Kornienko [Mon, 14 Jan 2013 17:01:57 +0000 (17:01 +0000)]
Test source file name in diagnostics
llvm-svn: 172434
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
Daniel Jasper [Mon, 14 Jan 2013 16:26:38 +0000 (16:26 +0000)]
Add support for Chromium style.
llvm-svn: 172432
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
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
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
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
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
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
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
Alexey Samsonov [Mon, 14 Jan 2013 14:52:35 +0000 (14:52 +0000)]
Fix-up copypasto from r172410
llvm-svn: 172419
Dmitry Vyukov [Mon, 14 Jan 2013 14:28:06 +0000 (14:28 +0000)]
asan: fix windows build
llvm-svn: 172415
Edwin Vane [Mon, 14 Jan 2013 14:20:19 +0000 (14:20 +0000)]
Adding a .gitignore to tools-extra
Reviewers: klimek
llvm-svn: 172414
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
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
Evgeniy Stepanov [Mon, 14 Jan 2013 14:08:25 +0000 (14:08 +0000)]
Build rules for sanitizer_common tests on Android.
llvm-svn: 172410
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
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
Alexander Kornienko [Mon, 14 Jan 2013 13:57:05 +0000 (13:57 +0000)]
Added a test for clang-format diagnostics.
llvm-svn: 172407
Alexander Kornienko [Mon, 14 Jan 2013 13:40:44 +0000 (13:40 +0000)]
Fix: correct file name in diagnostics.
llvm-svn: 172405
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
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
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
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
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
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
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
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
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
Dmitry Vyukov [Mon, 14 Jan 2013 10:00:03 +0000 (10:00 +0000)]
tsan: describe stack and TLS addresses
llvm-svn: 172393
Dmitry Vyukov [Mon, 14 Jan 2013 09:03:24 +0000 (09:03 +0000)]
asan: enable allocator version 1 by default
llvm-svn: 172392
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
Dmitry Vyukov [Mon, 14 Jan 2013 08:51:08 +0000 (08:51 +0000)]
asan/tsan: fix memory allocator statistics
llvm-svn: 172390
Dmitry Vyukov [Mon, 14 Jan 2013 08:48:26 +0000 (08:48 +0000)]
asan: fix Android build
llvm-svn: 172389
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
Dmitry Vyukov [Mon, 14 Jan 2013 08:21:34 +0000 (08:21 +0000)]
tsan: fix cmake warning (unused private field)
llvm-svn: 172387
Dmitry Vyukov [Mon, 14 Jan 2013 08:12:47 +0000 (08:12 +0000)]
tsan: add the FIXME
llvm-svn: 172386
Dmitry Vyukov [Mon, 14 Jan 2013 08:01:58 +0000 (08:01 +0000)]
asan: fix compilation errors in mutex
llvm-svn: 172385
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
Kostya Serebryany [Mon, 14 Jan 2013 07:59:09 +0000 (07:59 +0000)]
[asan] add more frames to standalone_malloc_test
llvm-svn: 172383
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
Dmitry Vyukov [Mon, 14 Jan 2013 07:52:01 +0000 (07:52 +0000)]
asan: add missing file
llvm-svn: 172381
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
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
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
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
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
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
Michael Gottesman [Mon, 14 Jan 2013 01:47:53 +0000 (01:47 +0000)]
Fixed some 80+ violations.
llvm-svn: 172374
Dmitri Gribenko [Mon, 14 Jan 2013 00:46:27 +0000 (00:46 +0000)]
libclang: remove a few const_casts
llvm-svn: 172373
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
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
Dmitri Gribenko [Mon, 14 Jan 2013 00:25:25 +0000 (00:25 +0000)]
Remove an unneeded const_cast
llvm-svn: 172370
Michael Gottesman [Sun, 13 Jan 2013 22:17:22 +0000 (22:17 +0000)]
Added bugzilla PR number to test case.
llvm-svn: 172369
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
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
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
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
Nick Lewycky [Sun, 13 Jan 2013 19:03:55 +0000 (19:03 +0000)]
Fix typo in comment.
llvm-svn: 172364
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
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
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
Dmitri Gribenko [Sun, 13 Jan 2013 16:07:49 +0000 (16:07 +0000)]
Documentation: use monospaced font for intrinsics' names
llvm-svn: 172360
Dmitri Gribenko [Sun, 13 Jan 2013 16:06:11 +0000 (16:06 +0000)]
Fix broken link to LangRef
llvm-svn: 172359
Dmitri Gribenko [Sun, 13 Jan 2013 16:01:15 +0000 (16:01 +0000)]
Remove redundant 'llvm::' qualifications
llvm-svn: 172358
Michael J. Spencer [Sun, 13 Jan 2013 16:00:51 +0000 (16:00 +0000)]
Fix LLP64 build.
llvm-svn: 172357
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
Daniel Jasper [Sun, 13 Jan 2013 14:39:04 +0000 (14:39 +0000)]
Format unions like structs and classes.
Note that I don't know whether we should put {} on a single line in this
case, but it is probably a theoretical issue as in practice such
structs, classes or unions won't be empty.
Before: union A {}
a;
After: union A {} a;
llvm-svn: 172355
Chandler Carruth [Sun, 13 Jan 2013 11:46:33 +0000 (11:46 +0000)]
Refactor the x86 CPU name logic in the driver and pass -march and -mcpu
flag information down from the Clang driver into the Gold linker plugin
for LTO. This allows specifying -march on the linker commandline and
should hopefully have it pass all the way through to the LTO optimizer.
Fixes PR14697.
llvm-svn: 172354
Benjamin Kramer [Sun, 13 Jan 2013 11:37:04 +0000 (11:37 +0000)]
X86: Add patterns for X86ISD::VSEXT in registers.
Those can occur when something between the sextload and the store is on the same
chain and blocks isel. Fixes PR14887.
llvm-svn: 172353
NAKAMURA Takumi [Sun, 13 Jan 2013 11:26:44 +0000 (11:26 +0000)]
CGBuiltin.cpp: Fix abuse of ArrayRef in EmitOverflowIntrinsic().
In ArrayRef<T>(X), X should not be temporary value. It could be rewritten more redundantly;
llvm::Type *XTy = X->getType();
ArrayRef<llvm::Type *> Ty(XTy);
llvm::Value *Callee = CGF.CGM.getIntrinsic(IntrinsicID, Ty);
Since it is safe if both XTy and Ty are temporary value in one statement, it could be shorten;
llvm::Value *Callee = CGF.CGM.getIntrinsic(IntrinsicID, ArrayRef<llvm::Type*>(X->getType()));
ArrayRef<T> has an implicit constructor to create uni-entry of T;
llvm::Value *Callee = CGF.CGM.getIntrinsic(IntrinsicID, X->getType());
MSVC-generated clang.exe crashed.
llvm-svn: 172352
Daniel Jasper [Sun, 13 Jan 2013 08:19:51 +0000 (08:19 +0000)]
Always put a space after ",".
I am not aware of a case where that would be wrong. The specific case I
am fixing are function parameters wrapped in parenthesis (e.g. in
macros).
Before: function(a,(b));
After: function(a, (b));
llvm-svn: 172351
Daniel Jasper [Sun, 13 Jan 2013 08:12:18 +0000 (08:12 +0000)]
Don't put spaces around hyphens in include paths.
Before: #include <a - a>
After: #include <a-a>
llvm-svn: 172350
Daniel Jasper [Sun, 13 Jan 2013 08:01:36 +0000 (08:01 +0000)]
Improve identification of c-style casts.
A ")" before any of "=", "{" or ";" won't be a cast. This fixes issues
with the formatting of unnamed parameters.
Before: void f(int *){}
After: void f(int *) {}
llvm-svn: 172349