Commit Graph

155145 Commits

Author SHA1 Message Date
Peter Collingbourne e5d5b0c71e DataFlowSanitizer; LLVM changes.
DataFlowSanitizer is a generalised dynamic data flow analysis.

Unlike other Sanitizer tools, this tool is not designed to detect a
specific class of bugs on its own.  Instead, it provides a generic
dynamic data flow analysis framework to be used by clients to help
detect application-specific issues within their own code.

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

llvm-svn: 187923
2013-08-07 22:47:18 +00:00
Hans Wennborg 714e057406 Fix doxygen function name mismatch.
llvm-svn: 187922
2013-08-07 22:34:01 +00:00
Daniel Malea d79ae05080 New settings: target.use-hex-immediates and target.hex-immediates-style
- Immediates can be shown as hex (either Intel or MASM style)
- See TestSettings.py for usage examples
- Verified to cause no regressions on Linux x86_64 (Ubuntu 12.10)

Patch by Richard Mitton!

llvm-svn: 187921
2013-08-07 21:54:09 +00:00
Daniel Dunbar 16606887c4 [lit] Report the traceback when config import fails.
llvm-svn: 187920
2013-08-07 21:43:34 +00:00
Daniel Dunbar df1ed9b886 [lit] Avoid comparisons with None.
llvm-svn: 187919
2013-08-07 21:43:23 +00:00
Daniel Dunbar f6dc230bef [lit] Use list comprehensions instead of map().
llvm-svn: 187918
2013-08-07 21:43:17 +00:00
Daniel Dunbar 1047d9a412 [lit] Avoid deprecated dict.has_key() method.
llvm-svn: 187917
2013-08-07 21:43:12 +00:00
Richard Smith e40f2baa5d PR9992: Serialize and deserialize the token sequence for a function template in
-fdelayed-template-parsing mode. Patch by Will Wilson!

llvm-svn: 187916
2013-08-07 21:41:30 +00:00
Marshall Clow 2c1a894061 N3644 support for <unordered_set> and <unordered_map>
llvm-svn: 187915
2013-08-07 21:30:44 +00:00
Argyrios Kyrtzidis acfbbd77f8 [PCH] Fix a PCH serialization crash, with invalid code related to forward enum references.
The problem was that an enum without closing semicolon could be associated as a forward enum
in an erroneous declaration, leading to the identifier being associated with the enum decl but
without a declaration actually referencing it.
This resulted in not having it serialized before serializing the identifier that is associated with.

Also prevent the ASTUnit from querying the serialized DeclID for an invalid top-level decl; it may not
have been serialized.

rdar://14539667

llvm-svn: 187914
2013-08-07 21:17:33 +00:00
Eric Christopher 7af8baf678 Using the integrated assembler we'd fail to change section to the
.tbss section for zerofill thread locals. Make sure we do this
before emitting the zerofills.

Fixes PR15972.

llvm-svn: 187913
2013-08-07 21:13:06 +00:00
Eric Christopher 42ae459174 Fix a FIXME, on darwin all virtual sections have a zerofill type.
llvm-svn: 187912
2013-08-07 21:13:01 +00:00
Marshall Clow 36b2a3b0e5 N3644 support for vector<bool>
llvm-svn: 187911
2013-08-07 20:53:44 +00:00
Marshall Clow 798061ded6 N3644 support for vector<bool>
llvm-svn: 187910
2013-08-07 20:53:38 +00:00
Marshall Clow 07186a7d2d N3644 support for <string> and <vector>
llvm-svn: 187909
2013-08-07 20:48:48 +00:00
Howard Hinnant 303e27d8ce Correct logic bug in find optimization for vector<bool>. This fixes http://llvm.org/bugs/show_bug.cgi?id=16816
llvm-svn: 187908
2013-08-07 20:42:16 +00:00
Reid Kleckner 11da004ac1 On Windows, autolink advapi32 from Path.inc for CryptAcquireContextW
This allows llvm-tblgen to link successfully when compiling with clang.

Both MSBuild and CMake will automatically add advapi32 as part of a set
of other dlls comprising the win32 API to the link line, but CMake
doesn't do that when compiling with clang.  Until someone adds that info
to cmake upstream, this seems like a reasonable work around.

llvm-svn: 187907
2013-08-07 20:19:31 +00:00
Howard Hinnant d098713aaf War on tabs
llvm-svn: 187906
2013-08-07 19:39:48 +00:00
Howard Hinnant c5582b57c6 Rename time.duration.literals step 3
llvm-svn: 187905
2013-08-07 19:39:11 +00:00
Howard Hinnant 35e09c7ad7 Rename time.duration.literals step 2
llvm-svn: 187904
2013-08-07 19:36:50 +00:00
Howard Hinnant 453ca75d24 Rename time.duration.literals step 1
llvm-svn: 187903
2013-08-07 19:35:46 +00:00
Rafael Espindola b0b1622595 Add the common begin/end naming convention to the coding standard.
llvm-svn: 187902
2013-08-07 19:34:37 +00:00
Manuel Klimek a027f306a6 Fixes a couple of bugs with the Allman brace breaking.
In particular, left braces after an enum declaration now occur on their
own line.  Further, when short ifs/whiles are allowed these no longer
cause the left brace to be on the same line as the if/while when a
brace is included.

Patch by Thomas Gibson-Robinson.

llvm-svn: 187901
2013-08-07 19:20:45 +00:00
Michael Sartain 89c862f298 clean up about 22 warnings messages
llvm-svn: 187900
2013-08-07 19:05:15 +00:00
Eric Christopher ed420bb5c3 Move assert above first use of variable that we'd be asserting on.
llvm-svn: 187899
2013-08-07 18:51:09 +00:00
John Thompson 4ed963a0ba Fixed incorrect header guard/nested header mechanism.
llvm-svn: 187898
2013-08-07 18:49:47 +00:00
Rafael Espindola 885727581c Correctly allign arrays on 32 bit systems.
Before this patch we would align

long long int big[1024];

to 4 bytes on 32 bit systems. The problem is that we were only looking
at the element type when getLargeArrayMinWidth returned non zero.

llvm-svn: 187897
2013-08-07 18:08:19 +00:00
NAKAMURA Takumi 50985962d6 lit/LitConfig.py: Fixup for msys bash.
llvm-svn: 187896
2013-08-07 17:21:23 +00:00
Andrew Trick 2f7667e018 Confusing comment typo.
llvm-svn: 187895
2013-08-07 17:20:32 +00:00
Fariborz Jahanian 3ab6222fd1 Patch to fix doxygen trailing comments for ObjectiveC methods.
// rdar://14258334

llvm-svn: 187893
2013-08-07 16:40:29 +00:00
Daniel Jasper 9613c81fd2 clang-format: Fix corner case in OpenMP pragma formatting.
Before:
  #pragma omp reduction( | : var)
After:
  #pragma omp reduction(| : var)

llvm-svn: 187892
2013-08-07 16:29:23 +00:00
Jordan Rose 54533f73a8 Eliminate CXXConstructorDecl::IsImplicitlyDefined.
This field is just IsDefaulted && !IsDeleted; in all places it's used,
a simple check for isDefaulted() is superior anyway, and we were forgetting
to set it in a few cases.

Also eliminate CXXDestructorDecl::IsImplicitlyDefined, for the same reasons.

No intended functionality change.

llvm-svn: 187891
2013-08-07 16:16:48 +00:00
Daniel Malea 65b4b97f1b Re-enable check previously disabled due to llvm.org/pr16603
llvm-svn: 187890
2013-08-07 15:21:08 +00:00
Alexander Potapenko 0443f1ac72 [TSan] Fix free_race.c by removing `not` from the test invocation that doesn't fail.
llvm-svn: 187889
2013-08-07 13:54:27 +00:00
Rafael Espindola 958297dabf Indicate success for simple options when clang called with -cc1.
Patch by David Wiberg.

llvm-svn: 187888
2013-08-07 12:54:47 +00:00
NAKAMURA Takumi c97b753cf4 Lit: Fixup in r187886.
llvm-svn: 187887
2013-08-07 12:53:53 +00:00
NAKAMURA Takumi aa7cea9369 Lit: Resurrect --no-execute dropped in r187852.
For now, builders in bb.pgr.jp are using it.

llvm-svn: 187886
2013-08-07 12:44:29 +00:00
Alexander Potapenko ce32410097 [TSan] Let the users suppress use-after-free errors using the "race:" suppressions.
If there's a race between a memory access and a free() call in the client program,
it can be reported as a use-after-free (if the access occurs after the free()) or an ordinary race
(if free() occurs after the access).
We've decided to use a single "race:" prefix for both cases instead of introducing a "use-after-free:" one,
because in many cases this allows us to keep a single suppression for both the use-after-free and free-after-use.

This may be misleading if the use-after-free occurs in a non-racy way (e.g. in a single-threaded program).
But normally such bugs shall not be suppressed.

llvm-svn: 187885
2013-08-07 12:39:00 +00:00
Elena Demikhovsky 45c54ad8dc AVX-512 set: Added BROADCAST instructions
with lowering logic and a test.

llvm-svn: 187884
2013-08-07 12:34:55 +00:00
Richard Sandiford 0897fce2f4 [SystemZ] Optimize floating-point comparisons with zero
This follows the same lines as the integer code.  In the end it seemed
easier to have a second 4-bit mask in TSFlags to specify the compare-like
CC values.  That eats one more TSFlags bit than adding a CCHasUnordered
would have done, but it feels more concise.

llvm-svn: 187883
2013-08-07 11:10:06 +00:00
Richard Sandiford 9f11bc1956 [SystemZ] Add floating-point load-and-test instructions
These instructions can also be used as comparisons with zero.

llvm-svn: 187882
2013-08-07 11:03:34 +00:00
Alexey Samsonov f502fd75ab ASan: fix one more test case for pipefail
llvm-svn: 187881
2013-08-07 10:41:49 +00:00
Benjamin Kramer 6a4976d3e0 JumpThreading: Turn a select instruction into branching if it allows to thread one half of the select.
This is a common pattern coming out of simplifycfg generating gross code.

a:                                       ; preds = %entry
  %sel = select i1 %cmp1, double %add, double 0.000000e+00
  br label %b

b:
  %cond5 = phi double [ %sel, %a ], [ %sub, %entry ]
  %cmp6 = fcmp oeq double %cond5, 0.000000e+00
  br i1 %cmp6, label %if.then, label %if.end

becomes

a:
  br i1 %cmp1, label %b, label %if.then

b:
  %cond5 = phi double [ %sub, %entry ], [ %add, %a ]
  %cmp6 = fcmp oeq double %cond5, 0.000000e+00
  br i1 %cmp6, label %if.then, label %if.end

Skipping block b completely if possible.

llvm-svn: 187880
2013-08-07 10:29:38 +00:00
Chandler Carruth 289b7b6969 Commit a no-op change to StringRef to (hopefully) trigger build bots.
r187874 seems to have been missed by the build bot infrastructure, and
the subsequent commits to compiler-rt don't seem to be queuing up new
build requsets. Hopefully this will.

As it happens, having the space here is the more common formatting. =]

llvm-svn: 187879
2013-08-07 09:52:34 +00:00
Alexey Samsonov 15d5eefc65 Distinguish 32-bit ASan from 64-bit ASan in lit configs
llvm-svn: 187878
2013-08-07 09:31:28 +00:00
Alexey Samsonov 4431d2d566 Enable pipefail for ASan tests
llvm-svn: 187877
2013-08-07 09:14:30 +00:00
Evgeniy Stepanov 04b7bff1fe [sanitizer] Intercept sched_getaffinity.
Re-applying with a more reliable test case.

llvm-svn: 187876
2013-08-07 09:10:16 +00:00
Alexey Samsonov b6c8b3de70 Enable pipefail for TSan tests
llvm-svn: 187875
2013-08-07 09:02:37 +00:00
Chandler Carruth cad7e5e0b4 Add support for linking against a curses library when available and
using it to detect whether or not a terminal supports colors. This
replaces a particularly egregious hack that merely compared the TERM
environment variable to "dumb". That doesn't really translate to
a reasonable experience for users that have actually ensured their
terminal's capabilities are accurately reflected.

This makes testing a terminal for color support somewhat more expensive,
but it is called very rarely anyways. The important fast path when the
output is being piped somewhere is already in place.

The global lock may seem excessive, but the spec for calling into curses
is *terrible*. The whole library is terrible, and I spent quite a bit of
time looking for a better way of doing this before convincing myself
that this was the fundamentally correct way to behave. The damage of the
curses library is very narrowly confined, and we continue to use raw
escape codes for actually manipulating the colors which is a much sane
system than directly using curses here (IMO).

If this causes trouble for folks, please let me know. I've tested it on
Linux and will watch the bots carefully. I've also worked to account for
the variances of curses interfaces that I could finde documentation for,
but that may not have been sufficient.

llvm-svn: 187874
2013-08-07 08:47:36 +00:00
Alexey Samsonov fd078b9405 Enable pipefail for LSan tests
llvm-svn: 187873
2013-08-07 08:46:09 +00:00