Commit Graph

140675 Commits

Author SHA1 Message Date
Tim Northover b3cfb28e4d Remove locale-dependence of enum mangling and use existing function.
llvm-svn: 172077
2013-01-10 16:47:31 +00:00
Manuel Klimek 0ddd57a17b Fixes layout of right braces.
We now decide whether a newline should go before the closing brace
depending on whether a newline was inserted after the opening brace.

For example, we now insert a newline before '};' in:
static SomeClass WithALoooooooooooooooooooongName = {
  100000000, \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"
};
... while not inserting a newline here:
static SomeClass = { a, b, c, d, e, f, g, h, i, j,
                     looooooooooooooooooooooooooooooooooongname,
                     looooooooooooooooooooooooooooooong };

Also fixes the formating of (column limit 25):
int x = {
  avariable,
  b(alongervariable)
};

llvm-svn: 172076
2013-01-10 15:58:26 +00:00
Alexander Kornienko 92465285ab Format what you can when errors are found
llvm-svn: 172075
2013-01-10 15:19:44 +00:00
Edwin Vane 86c63d94bb Removing loop-convert tool
cpp11-migrate now contains the loop convert transform code and tests.
Cleaning up the old code/tests and updating build system files as
necessary.

Reviewers: klimek
llvm-svn: 172074
2013-01-10 15:19:11 +00:00
Tim Northover 8f1c8ebb0d Make TableGen mangle operand method names before putting in enum.
The purpose of this patch is to allow PredicateMethods to be set to something
like "isUImm<8>", calling a C++ template method to reduce code duplication. For
this to work, the PredicateMethod must be mangled into a valid C++ identifier
for insertion into an enum.

llvm-svn: 172073
2013-01-10 15:17:36 +00:00
Alexander Kornienko 5b64279192 Improved clang-format integration support for diagnostic messages output
llvm-svn: 172072
2013-01-10 15:06:57 +00:00
Alexander Kornienko 5b7157ac8d Basic support for diagnostics.
Summary: Uses DiagnosticsEngine to output diagnostics.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

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

llvm-svn: 172071
2013-01-10 15:05:09 +00:00
Manuel Klimek 73a2fdf232 Fixes formatting of function calls etc inside an initializer list.
We're now formatting (column limit 25):
int x = {
  avariable,
  b(alongervariable) };

This also fixes:
Aaa({
  int i;
}, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
                                    ccccccccccccccccc));
... where we would previously break after the '},'.

Putting the closing curly into an extra line when there's a break
directly after the first curly will be done in a subsequent patch.

Paired with djasper.

llvm-svn: 172070
2013-01-10 14:36:46 +00:00
Kostya Serebryany fdcfbda750 [sanitizer] better statistics for the large allocator
llvm-svn: 172069
2013-01-10 13:38:38 +00:00
Kostya Serebryany e1be48fe64 [sanitizer] fix the non-cmake build (2-nd attempt)
llvm-svn: 172068
2013-01-10 13:33:15 +00:00
Manuel Klimek e7d10a1f50 Do not add newline in empty blocks.
void f() {}
now gets formatted in one line.

llvm-svn: 172067
2013-01-10 13:24:24 +00:00
Daniel Jasper 494394d817 Let clang-format binary use same LangOpts as test.
llvm-svn: 172066
2013-01-10 13:09:09 +00:00
Daniel Jasper c1fa281325 Improvements to function type and ObjC block formatting.
Before: int (^myBlock) (int) = ^(int num) {}
        A<void ()>;
	int (*b)(int);

After:  int (^myBlock)(int) = ^(int num) {}
        A<void()>;
	int(*b)(int);

For function types and function pointer types, this patch only makes
the behavior consistent (for types that are keywords and other types).
For the latter function pointer type declarations, we'll probably
want to add a space after "int".

Also added LangOpts.Bool = 1, so we handle "A<bool()>" appropriately
Moved the LangOpts-settings to a public place for use by tests
and clang-format binary.

llvm-svn: 172065
2013-01-10 13:08:12 +00:00
Dmitry Vyukov 22c53df947 asan/tsan: fix comment
llvm-svn: 172064
2013-01-10 13:06:35 +00:00
Kostya Serebryany 1199dc0327 [sanitizer] fix the non-cmake build
llvm-svn: 172063
2013-01-10 13:05:16 +00:00
Simon Atanasyan 81c423cc97 [Mips] Pass a combination of +soft-float and -mips16-hard-float flags to
the backend if hard float ABI is selected under -mips16 mode.

llvm-svn: 172062
2013-01-10 12:36:19 +00:00
Kostya Serebryany 4f6e4ae44a [sanitizer] add standalone_malloc_test
llvm-svn: 172061
2013-01-10 12:34:12 +00:00
Dmitry Vyukov 1bc29bd7bf tsan: add check for invalid fd
llvm-svn: 172060
2013-01-10 12:28:58 +00:00
Kostya Serebryany e54a9e6fbf [asan] don't fail the test if prctl(PR_SET_NAME) is not supported
llvm-svn: 172059
2013-01-10 11:55:43 +00:00
Manuel Klimek 8e07a1b64b Fix layout of blocks inside statements.
Previously, we would not indent:
SOME_MACRO({
  int i;
});
correctly. This is fixed by adding the trailing }); to the unwrapped
line starting with SOME_MACRO({, so the formatter can correctly match
the braces and indent accordingly.

Also fixes incorrect parsing of initializer lists, like:
int a[] = { 1 };

llvm-svn: 172058
2013-01-10 11:52:21 +00:00
Evgeniy Stepanov 9b52ce94db [msan] Set program exit code in keep-going mode.
llvm-svn: 172057
2013-01-10 11:17:55 +00:00
Daniel Jasper 7194e1818e Improve clang-format's understanding of casts.
This fixes llvm.org/PR14684.

Before: int *pa = (int *) & a;
After:  int *pa = (int *)&a;

We still don't understand all kinds of casts. I added a FIXME to
address that.

llvm-svn: 172056
2013-01-10 11:14:08 +00:00
Evgeniy Stepanov ab111fa511 [asan] Add soname to the dynamic runtime.
llvm-svn: 172055
2013-01-10 10:58:14 +00:00
Joey Gouly 5fad3e9ad6 Fix a copy/paste error in the IR Linker, casting an ArrayType instead of a VectorType.
llvm-svn: 172054
2013-01-10 10:49:36 +00:00
David Tweed c38f11de40 r172047 lacked a test (due to incomplete OpenCL support in clang). Use a modified
version of a test by Joey Gouly to use attributes to materialise the unsupported
types and test vector shifts.

llvm-svn: 172053
2013-01-10 10:42:08 +00:00
Guy Benyei 03e61960c8 Enable intel_ocl_bicc for x86_64 target only. Remove fix from 171969 that enabled this extension for multiple targets.
llvm-svn: 172052
2013-01-10 10:41:05 +00:00
Joey Gouly 58bf951dec Fix TryToShrinkGlobalToBoolean in GlobalOpt, so that it does not discard address spaces.
llvm-svn: 172051
2013-01-10 10:31:11 +00:00
Manuel Klimek fba4bb114b Introduce a define to switch on debug output.
After re-writing the same loop multiple times, we deicided it's time to
add this as an optional debugging help.

llvm-svn: 172050
2013-01-10 10:05:08 +00:00
Daniel Jasper 83a54d23d3 Do more error checking for '{}'.
This fixes llvm.org/PR14883, where clang-format would run into an
assertion on:

void f() { return } 42

llvm-svn: 172049
2013-01-10 09:26:47 +00:00
Kostya Serebryany 8cc7b627b4 [asan] asan_allocator2: do less work under the quarantine lock; make the strcasecmp test more resistant to the contents of unaddressable memory
llvm-svn: 172048
2013-01-10 09:25:16 +00:00
David Tweed 9fb566c076 Testing with a full OpenCL compiler (based on clang) reveals r71734 missed
difference between type widths of a vector and the width of one of its elements
in the case of vector shifts. Use correct witdth in the vector case.

llvm-svn: 172047
2013-01-10 09:11:33 +00:00
Sean Silva 8e68b792b4 docs: fix broken link.
PR14889

llvm-svn: 172046
2013-01-10 06:39:37 +00:00
Kostya Serebryany 4dd086841f [asan] better protect the tests from memset/memcpy inlining, explicitly include unistd.h
llvm-svn: 172045
2013-01-10 06:38:43 +00:00
NAKAMURA Takumi acfc1f21d4 Signal.h: Add <cstdio> for FILE*, since r171989.
llvm-svn: 172044
2013-01-10 05:23:59 +00:00
Alex Rosenberg eb8360003b Add .arcconfig for Arcanist support for Phabricator
llvm-svn: 172043
2013-01-10 04:12:08 +00:00
Alex Rosenberg 0b18a095cf Fix comment
llvm-svn: 172042
2013-01-10 04:12:06 +00:00
Will Dietz e4b1d2e32c [ubsan] Give entry methods default (not hidden) visibility.
Fixes using ubsan on shared libraries in linux, for example.

llvm-svn: 172041
2013-01-10 03:37:30 +00:00
Shankar Easwaran 2ca8e7d733 support for adding linker defined symbols
llvm-svn: 172040
2013-01-10 03:16:27 +00:00
Enrico Granata c921e34c81 <rdar://problem/11146929>
Enabling support for the wchar_t type.
Without the proper language option setup, clang's ASTContexts will be configured to have wchar_t == int
This patch enables the correct options to make sure that we report wchar_t as itself
Added a test case to make sure we do not regress 

Adding files missing from the previous commit

llvm-svn: 172039
2013-01-10 02:37:22 +00:00
Enrico Granata b4e2e93c61 <rdar://problem/11146929>
Enabling support for the wchar_t type.
Without the proper language option setup, clang's ASTContexts will be configured to have wchar_t == int
This patch enables the correct options to make sure that we report wchar_t as itself
Added a test case to make sure we do not regress 

llvm-svn: 172038
2013-01-10 02:36:16 +00:00
NAKAMURA Takumi eacd667238 clang-c/Index.h: Clarify empty argument with (void) for C89.
llvm-svn: 172037
2013-01-10 02:12:38 +00:00
Douglas Gregor 0f2b4635be Be more careful about updating the failed-modules set
llvm-svn: 172035
2013-01-10 02:04:18 +00:00
Michael Gottesman a6cb018bb5 [ObjCARC Debug Message] Added debug message when we convert an autorelease into an autoreleaseRV.
llvm-svn: 172034
2013-01-10 02:03:50 +00:00
Douglas Gregor 056eafd420 Fix a race condition in the lock-file manager: once the lock file is
gone, check for the actual file we care about.

llvm-svn: 172033
2013-01-10 02:01:35 +00:00
Douglas Gregor 95585ab6a4 Fix a race condition in llvm::sys::path::unique_file: when we end up
failing to create the unique file because the path doesn't exist,
don't fail if someone else manages to create the path before we do.

llvm-svn: 172032
2013-01-10 01:58:46 +00:00
Nick Lewycky 230203c949 Don't assert in codegen on static data members which have NoLinkage. Fixes
PR14825!

llvm-svn: 172031
2013-01-10 01:46:29 +00:00
Douglas Gregor 4ddf2221b4 Rework the realpath nonsense for framework lookups to deal more
uniformly with symlinks between top-level and embedded frameworks.

llvm-svn: 172030
2013-01-10 01:43:00 +00:00
Jakob Stoklund Olesen 55a7be237e Support headerless bundles in MachineInstr::hasProperty().
This function can still work without a BUNDLE header instruction.

llvm-svn: 172029
2013-01-10 01:29:42 +00:00
Michael J. Spencer ad5f00ea2d [Archive] Use a hash map to lookup symbols in archives. Increases performance of linking lua by ~6x.
llvm-svn: 172028
2013-01-10 01:27:45 +00:00
Manman Ren 207bcbacca Stack Alignment: throw error if we can't satisfy the minimal alignment
requirement when creating stack objects in MachineFrameInfo.

Add CreateStackObjectWithMinAlign to throw error when the minimal alignment
can't be achieved and to clamp the alignment when the preferred alignment
can't be achieved. Same is true for CreateVariableSizedObject.
Will not emit error in CreateSpillStackObject or CreateStackObject.

As long as callers of CreateStackObject do not assume the object will be
aligned at the requested alignment, we should not have miscompile since
later optimizations which look at the object's alignment will have the correct
information.

rdar://12713765

llvm-svn: 172027
2013-01-10 01:10:10 +00:00