Commit Graph

150812 Commits

Author SHA1 Message Date
Alexey Samsonov 6a65b18992 [ASan] lit tests: create common autogenerated config for running compiler-rt lit tests, and use it in ASan
llvm-svn: 183400
2013-06-06 12:35:48 +00:00
Pavel Labath c3282c0b3c Add support for static analysis to clang-check
Summary:
This adds a command line argument '-analyze' to clang-check which runs the
clang static analyzer on the source files.

Reviewers: klimek

CC: cfe-commits, revane

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

llvm-svn: 183399
2013-06-06 12:35:43 +00:00
Pavel Labath dee20c105b ClangTool: strip -o from the command line
Summary:
This patch creates a new ArgumentsAdjuster, which removes all -o parameters from
the command line. This adjuster is inserted by default into the ClangTool pipeline.

Reviewers: klimek

CC: cfe-commits, revane

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

llvm-svn: 183398
2013-06-06 11:52:19 +00:00
Richard Smith de229235b9 Implement DR1270: braces can be elided in all aggregate initialization, not
just copy-list-initialization in a variable declaration. This effectively
reverts r142147.

llvm-svn: 183397
2013-06-06 11:41:05 +00:00
Alexey Samsonov 2874f70250 [ASan] move all lit_tests under TestCases
llvm-svn: 183395
2013-06-06 09:23:34 +00:00
Hans Wennborg 15439bcf79 Disallow reinterpret_cast from pointer to bool on Windows
This became allowed by accident in r131201, but triggers an assert.
That patch added an exception to allow conversion from pointers to
narrow integral types for MSVC compatibility. However, a pointer can
already be converted to bool in a civilized manner; allowing conversion
via reinterpret_cast is a bad idea.

Fixes PR16222.

llvm-svn: 183394
2013-06-06 09:16:36 +00:00
Daniel Jasper 6dcecb6b33 Fix clang-format's expression parser for leading }s.
The leading "}" in the construct "} else if (..) {" was confusing the
expression parser. Thus, no fake parentheses were generated and the
indentation was broken in some cases.

llvm-svn: 183393
2013-06-06 09:11:58 +00:00
Alexey Samsonov c87e009059 [LSan] remove unneeded empty directory
llvm-svn: 183392
2013-06-06 09:07:42 +00:00
Alexey Samsonov b42b2f5c69 [ASan] Add a few tests for use-after-scope mode
llvm-svn: 183391
2013-06-06 08:30:26 +00:00
Alexey Samsonov 7a75e16c27 [ASan] One more fix for realloc: check that reallocated chunk is valid before calling memcpy
llvm-svn: 183390
2013-06-06 08:25:31 +00:00
Daniel Jasper 058663787e Improve c-style cast detection.
Before:
return (my_int) aaaa;
template <> void f<int>(int i)SOME_ANNOTATION;
f("aaaa" SOME_MACRO(aaaa)"aaaa");

After:
return (my_int)aaaa;
template <> void f<int>(int i) SOME_ANNOTATION;
f("aaaa" SOME_MACRO(aaaa) "aaaa");

llvm-svn: 183389
2013-06-06 08:20:20 +00:00
Richard Smith ea4ad5d841 When a static storage duration temporary appears in a constant expression, it
must be initialized by a constant expression (not just a core constant
expression), because we're going to emit it as a global. Core issue for this is
pending.

llvm-svn: 183388
2013-06-06 08:19:16 +00:00
Alexey Samsonov 87a59e5652 [ASan] make free_hook_realloc test more robust
llvm-svn: 183387
2013-06-06 07:58:00 +00:00
Bill Wendling b91216817f Cast to the correct type. Pointer, not reference.
llvm-svn: 183385
2013-06-06 05:39:29 +00:00
Richard Trieu ea8d370d2a Don't create a StringRef from a temporary string.
llvm-svn: 183372
2013-06-06 02:22:29 +00:00
NAKAMURA Takumi 4a8f079371 R600OptimizeVectorRegisters.cpp: Tweak a warning. [-Wsometimes-uninitialized]
FIXME: Is it false alarm?
llvm-svn: 183371
2013-06-06 02:15:12 +00:00
NAKAMURA Takumi e5555fc238 R600OptimizeVectorRegisters.cpp: Suppress a warning. [-Wunused-variable]
llvm-svn: 183370
2013-06-06 02:15:06 +00:00
NAKAMURA Takumi 372574d447 Trailing linefeed.
llvm-svn: 183369
2013-06-06 02:15:00 +00:00
Jordan Rose 69dd5fce3e [analyzer] Look through ExprWithCleanups to see if an expr's consumed.
We based decisions during analysis and during path generation on whether
or not an expression is consumed, so if a top-level expression has
cleanups it's important for us to look through that.

<rdar://problem/14076125>

llvm-svn: 183368
2013-06-06 01:57:24 +00:00
Jordan Rose d2f8a6a993 [analyzer] Improve debug output for PathDiagnosticPieces.
You can now dump a single PathDiagnosticPiece or PathDiagnosticLocation.

llvm-svn: 183367
2013-06-06 01:57:19 +00:00
NAKAMURA Takumi 5238eba7f5 clang/unittests/Format/FormatTest.cpp: Suppress utf8 literals with _MSC_VER. MS cl.exe is unaware of BOM-less utf8 source files.
FIXME: Encode Cyrillic and CJK characters below to appease MS compilers.
llvm-svn: 183366
2013-06-06 01:14:58 +00:00
Bill Wendling e410576865 Cast to the proper type.
llvm-svn: 183365
2013-06-06 01:04:21 +00:00
Enrico Granata ed4b293b68 <rdar://problem/14064994>
Fixing a test case to correctly check that the class name has changed instead of relying on GetValueDidChange()

llvm-svn: 183364
2013-06-06 00:58:37 +00:00
Jakub Staszak 9de494e0ee Remove unneeded cast<>.
llvm-svn: 183363
2013-06-06 00:49:57 +00:00
Sean Silva 81f83ad93d Add some class documentation to BinaryRef.
llvm-svn: 183362
2013-06-06 00:47:12 +00:00
Bill Wendling f77190855d Cache the TargetLowering info object as a pointer.
Caching it as a pointer allows us to reset it if the TargetMachine object
changes.

llvm-svn: 183361
2013-06-06 00:43:09 +00:00
Jakub Staszak 461d1fe6fc Use IRBuilder instead of ConstantInt methods.
llvm-svn: 183360
2013-06-06 00:37:23 +00:00
Anna Zaks 148974d678 [analyzer] Fix a crash that occurs when processing an rvalue array.
When processing ArrayToPointerDecay, we expect the array to be a location, not a LazyCompoundVal.
Special case the rvalue arrays by using a location to represent them. This case is handled similarly
elsewhere in the code.

Fixes PR16206.

llvm-svn: 183359
2013-06-06 00:19:36 +00:00
Jordan Rose 7a8bd94365 [analyzer; new edges] Don't crash if the top-level entry edge is missing.
We previously asserted that there was a top-level function entry edge, but
if the function decl's location is invalid (or within a macro) this edge
might not exist. Change the assertion to an actual check, and don't drop
the first path piece if it doesn't match.

<rdar://problem/14070304>

llvm-svn: 183358
2013-06-06 00:12:41 +00:00
Jordan Rose b67b7b201f [analyzer; new edges] Ignore self-edges, not all edges with the same location.
The edge optimizer needs to see edges for, say, implicit casts (which have
the same source location as their operand) to uniformly simplify the
entire path. However, we still don't want to produce edges from a statement
to /itself/, which could occur when two nodes in a row have the same
statement location.

This necessitated moving the check for redundant notes to after edge
optimization, since the check relies on notes being adjacent in the path.

<rdar://problem/14061675>

llvm-svn: 183357
2013-06-06 00:12:37 +00:00
Bill Wendling 8db01cb262 Don't cache the TargetLoweringInfo object inside of the FunctionLowering object.
The TargetLoweringInfo object is owned by the TargetMachine. In the future, the
TargetMachine object may change, which may also change the TargetLoweringInfo
object.

llvm-svn: 183356
2013-06-06 00:11:39 +00:00
Eric Christopher 30aa6b6243 If we're splitting the dwarf for fission and don't want to use the
integrated assembler then go ahead and still split the dwarf anyhow.

Add two tests, one to exercise existing behavior of not splitting
when we're just emitting assembly files and the other to test
that we split when we're not in integrated as mode.

llvm-svn: 183355
2013-06-05 23:58:15 +00:00
Sean Silva 2d73d15f83 Rename operator== parameter to `RHS`.
The previous name `Ref` is overly generic.

llvm-svn: 183354
2013-06-05 23:58:14 +00:00
Sean Silva 7ea7d76b72 Remove error-prone methods of BinaryRef.
A user shouldn't care about the internal state, and these methods by
their very nature require asserting a predicate on the internal state.
As such, they cannot be used safely without introducing hidden
long-distance dependencies on the manner of construction of the
BinaryRef.

Use writeAsBinary(raw_ostream &) and writeAsHex(raw_ostream &) if you
need to access the data in a binary or hex format.

llvm-svn: 183353
2013-06-05 23:55:26 +00:00
Sean Silva 42fa38f55b Add writeAsHex(raw_ostream &) method to BinaryRef.
This hides the implementation. A future commit will remove the
error-prone getHex() and getBinary() methods.

llvm-svn: 183352
2013-06-05 23:47:23 +00:00
Tom Stellard acec99c948 R600: Replace predicate loop with predicate function
llvm-svn: 183351
2013-06-05 23:39:50 +00:00
Sean Silva b7e82adb72 Rename BinaryRef::isBinary to more descriptive DataIsHexString.
And add a doxygen comment.

llvm-svn: 183350
2013-06-05 23:32:31 +00:00
Sean Silva 5fbb154d04 Add BinaryRef binary_size() method.
This avoids making assumptions about the data representation.

llvm-svn: 183349
2013-06-05 23:32:27 +00:00
Sean Silva b4e21201d7 Comment BinaryRef::Data.
Also, state an invariant.

llvm-svn: 183348
2013-06-05 23:32:23 +00:00
Rui Ueyama 911d60a1e4 [Driver][Core] Handle -mllvm option.
llvm-svn: 183347
2013-06-05 23:19:18 +00:00
Bill Wendling 6fd15ca02e Add space to assert message.
llvm-svn: 183346
2013-06-05 23:13:26 +00:00
Sean Silva 23f3b82790 Add writeAsBinary(raw_ostream &) method to BinaryRef.
Previously, yaml2coff.cpp had a writeHexData static helper function to
do this, but it is generally useful functionality.

Also, validate hex strings up-front to avoid running having to handle
errors "deep inside" the yaml2obj code (it also gives better diagnostics
than it used to).

llvm-svn: 183345
2013-06-05 22:59:00 +00:00
Sean Callanan 415422ce76 Fixes for the IR interpreter:
- Implemented the SExt instruction, and

 - eliminated redundant codepaths for constant
   handling.

Added test cases.

<rdar://problem/13244258>
<rdar://problem/13955820>

llvm-svn: 183344
2013-06-05 22:07:06 +00:00
Vincent Lejeune dec1875207 R600: Add a pass that merge Vector Register
Previously commited @183279 but tests were failing, reverted @183286
It was broken because @183336 was missing, now it's there.

llvm-svn: 183343
2013-06-05 21:38:04 +00:00
Sean Silva 69fd257802 [docs] Add link to C++ ABI document.
llvm-svn: 183342
2013-06-05 21:11:16 +00:00
Sean Silva ce4bb3cb12 [docs] Add link to SysV ABI document.
llvm-svn: 183341
2013-06-05 21:11:11 +00:00
Daniel Malea 692074622c Add test cases for attaching to a process after fork
- one test case is due to llvm.org/pr16229
- other test case uses a Linux workaround for above by using os.fork() instead of subprocess module

Patch by Andy Kaylor!

llvm-svn: 183340
2013-06-05 21:07:02 +00:00
Sean Silva 23bcd0ad81 [ELF] Add ELFOSABI_GNU.
ELFOSABI_LINUX is a historical alias for ELFOSABI_GNU according to
<http://www.sco.com/developers/gabi/latest/ch4.eheader.html>.

llvm-svn: 183339
2013-06-05 20:55:58 +00:00
Rafael Espindola 0b87956542 Update for llvm's r183337.
llvm-svn: 183338
2013-06-05 20:35:36 +00:00
Rafael Espindola 7c346c2cc9 Don't hide the first ELF symbol.
The first symbol on ELF is dummy, but it has a defined content and readelf
normally displays it. With this change llvm-readobj also displays it and we
can check that llvm-mc output is correct according to the standard.

llvm-svn: 183337
2013-06-05 20:33:54 +00:00