Commit Graph

131001 Commits

Author SHA1 Message Date
Nuno Lopes 89702e94b5 make all Emit*() functions consult the TargetLibraryInfo information before creating a call to a library function.
Update all clients to pass the TLI information around.
Previous draft reviewed by Eli.

llvm-svn: 160733
2012-07-25 16:46:31 +00:00
Sid Manning 1a60141f99 Implement the ELF reader. The original implementation was by Hemant Kulkarni
with subsequent changes to use lower level interfaces done by me.

llvm-svn: 160732
2012-07-25 16:27:21 +00:00
Rafael Espindola 73173c55c2 Fix typos. Thanks to Matt Beaumont-Gay for noticing it.
llvm-svn: 160731
2012-07-25 15:42:45 +00:00
Sid Manning d5c8fe3eea Trivial reformatting
llvm-svn: 160730
2012-07-25 15:16:02 +00:00
Dmitry Vyukov 55b405ef42 tsan: allow environment to override OnReport() and OverrideFlags()
llvm-svn: 160728
2012-07-25 14:30:51 +00:00
Axel Naumann 7b44fbb95b Twine: fix link to source, add link to class doc and container section.
80 char lines.

llvm-svn: 160726
2012-07-25 13:46:11 +00:00
Rafael Espindola 11c38b9657 When a return struct pointer is passed in registers, the called has nothing
to pop.

llvm-svn: 160725
2012-07-25 13:41:10 +00:00
Rafael Espindola 2caee7f4d2 Factor a long list of conditions into a predicate function. No functionality
change.

llvm-svn: 160724
2012-07-25 13:35:45 +00:00
Dmitry Vyukov dfc8e52400 tsan: suport for Go finalizers
llvm-svn: 160723
2012-07-25 13:16:35 +00:00
Dmitry Vyukov d654f06644 tsan: expect that Go symbolizer can return NULLs
llvm-svn: 160722
2012-07-25 11:50:37 +00:00
Alexey Samsonov 5062359502 cmake for compiler-rt: add a function to set output dirs for compiler runtimes equal to directory used by Clang driver. Use it for ASan runtime. Also, make sure that ASan unit tests depend on the ASan runtime.
llvm-svn: 160721
2012-07-25 11:15:00 +00:00
NAKAMURA Takumi 2538bf111e test/PCH/objc_stmts.m: Suppress stderr to be fed to FileCheck.
llvm-svn: 160720
2012-07-25 11:14:11 +00:00
Kostya Serebryany bb0ade6daa [asan] don't return from a never-return function. fix a test that had a chain of bugs instead of just one
llvm-svn: 160719
2012-07-25 10:56:09 +00:00
Alexey Samsonov c145b02607 [ASan] fixup for r160712: provide a default definition for weak __asan_default_options()
llvm-svn: 160718
2012-07-25 10:40:57 +00:00
Filipe Cabecinhas f4156d496e Make git not delete some empty dirs. Otherwise a git checkout would be different from an svn checkout.
llvm-svn: 160717
2012-07-25 10:34:53 +00:00
Manuel Klimek e923569b1b Introduces the 'decl' matcher which was missing for a while
and became necessary with the change to require BindableMatchers
for binding.

Also fixes PR 13445: "hasSourceExpression only works for implicit casts".

llvm-svn: 160716
2012-07-25 10:02:02 +00:00
NAKAMURA Takumi e1efe31948 test/Analysis/iterators.cpp: Mark as REQUIRES:asserts. It crashes due to assertion failure.
I saw the case it XPASSes.

llvm-svn: 160715
2012-07-25 09:47:24 +00:00
Duncan Sands 77a1f3b564 Don't perform an overaligned load in this test, since that's undefined
behaviour that might be exploited one day.

llvm-svn: 160714
2012-07-25 09:45:37 +00:00
Alexander Potapenko 9bac1cedbc Make __asan_default_options a weak function that returns a const char*.
Users may define it to override the default ASan options.
This function has to be marked with __attribute__((no_address_safety_analysis)), because it is called before ASan is fully initialized.

Add an output test checking the __asan_default_options functionality.

llvm-svn: 160712
2012-07-25 09:18:43 +00:00
Duncan Sands 0b875a0c29 When folding a load from a global constant, if the load started in the middle
of an array element (rather than at the beginning of the element) and extended
into the next element, then the load from the second element was being handled
wrong due to incorrect updating of the notion of which byte to load next.  This
fixes PR13442.  Thanks to Chris Smowton for reporting the problem, analyzing it
and providing a fix.

llvm-svn: 160711
2012-07-25 09:14:54 +00:00
Timur Iskhodzhanov ff7ff3f30b Add a FIXME to revisit the performance of BackRefMap later
llvm-svn: 160709
2012-07-25 08:16:41 +00:00
Manuel Klimek 587bcca66d Adds a introductionary document to the Clang AST.
Next steps are adding information about types & source location handling.

llvm-svn: 160708
2012-07-25 07:28:11 +00:00
Ted Kremenek 875a402dc3 Turn -Wobjc-root-class on by default. <rdar://problem/11203649>.
llvm-svn: 160707
2012-07-25 07:26:32 +00:00
Ted Kremenek 2b619662ee Promote warn_unknown_analyzer_checker to an error. Addresses <rdar://problem/10987863>.
llvm-svn: 160706
2012-07-25 07:12:13 +00:00
Richard Smith 2589b9808e PR12057: Allow variadic template pack expansions to cross lambda boundaries.
Rather than adding a ContainsUnexpandedParameterPack bit to essentially every
AST node, we tunnel the bit directly up to the surrounding lambda expression
when we reach a context where an unexpanded pack can not normally appear.
Thus any statement or declaration within a lambda can now potentially contain
an unexpanded parameter pack.

llvm-svn: 160705
2012-07-25 03:56:55 +00:00
Jason Molenda c42d243ace Provide subdir of StopInfoMachException.h in #include.
llvm-svn: 160704
2012-07-25 03:40:06 +00:00
Akira Hatanaka 5a69c235ae Eliminate the stack slot used to save the global base register.
The long branch pass (fixed in r160601) no longer uses the global base register
to compute addresses of branch destinations, so it is not necessary to reserve
a slot on the stack.

llvm-svn: 160703
2012-07-25 03:16:47 +00:00
Dmitri Gribenko e6af54af9b Make comments::Parser and comments::Sema noncopyable.
llvm-svn: 160702
2012-07-25 00:02:45 +00:00
Rafael Espindola a92cf29f0d Add a cpu to the test. Should fix the atom bot.
llvm-svn: 160701
2012-07-24 22:56:06 +00:00
Dmitri Gribenko 3c54128715 Comment parsing tests: fix test
llvm-svn: 160700
2012-07-24 21:56:59 +00:00
Jordan Rose 68449acea4 Add __has_feature(attribute_availability_with_message).
This tests for the ability to include a "message" field in availability
attributes, like so:

  extern void ATSFontGetName(const char *oName)
    __attribute__((availability(macosx,introduced=8.0,deprecated=9.0,
                                message="use CTFontCopyFullName")));

This was actually supported in Clang 3.1, but we got a request for a
__has_feature so that header files can use this more safely. It's
unfortunate that the 3.1 release doesn't include this, however.

<rdar://problem/11886458>

llvm-svn: 160699
2012-07-24 21:55:34 +00:00
Rafael Espindola f30e9bfb90 Add a triple to the test.
llvm-svn: 160698
2012-07-24 21:55:04 +00:00
Dmitri Gribenko 5b8a1d4854 Comment diagnostics tests: add a function with zero arguments, for completeness.
llvm-svn: 160697
2012-07-24 21:46:24 +00:00
Dmitri Gribenko 8f0f1b0c41 Comment diagnostics: add warning for multiple \param commands with duplicate
parameter names.

llvm-svn: 160696
2012-07-24 21:44:16 +00:00
Rafael Espindola a44e193a11 In order to correctly compile
struct s {
  double x1;
  float x2;
};
__attribute__((regparm(3))) struct s f(int a, int b, int c);
void g(void) {
  f(41, 42, 43);
}

We need to be able to represent passing the address of s to f (sret) in a
register (inreg). Turns out that all that is needed is to not mark them as
mutually incompatible.

llvm-svn: 160695
2012-07-24 21:40:17 +00:00
Kevin Enderby 216ac31971 Fix a bug in the x86 disassembler's symbolic disassembly support for Jcc-Jump
if Condition Is Met instuctions that was not correctly determining the target
instruction.

So for a jne rel32 instruction:

% cat x.s
.byte 0x0f, 0x85, 0x09, 0x00, 0x00, 0x00
% as x.s

it was incorrectly deterining the target:

% otool -q -tv a.out 
a.out:
(__TEXT,__text) section
0000000000000000	jne	0xd

and with the fix it gets this correct as:

% otool -q -tv a.out
a.out:
(__TEXT,__text) section
0000000000000000	jne	0xf

rdar://11505997

llvm-svn: 160694
2012-07-24 21:40:01 +00:00
Nick Lewycky 38be931223 Don't delete one more instruction than we're allowed to. This should fix the
Darwin bootstrap. Testcase exists but isn't fully reduced, I expect to commit
the testcase this evening.

llvm-svn: 160693
2012-07-24 21:33:00 +00:00
Michael J. Spencer 041c0d4c21 [Object] Remove unneeded const_cast.
llvm-svn: 160692
2012-07-24 21:07:56 +00:00
Richard Smith f676e45e5f When a && or || appears as the condition of a ?:, perform appropriate
short-circuiting when building the CFG. Also be sure to skip parens before
checking for the && / || special cases. Finally, fix some crashes in CFG
printing in the presence of calls to destructors for array of array of class
type.

llvm-svn: 160691
2012-07-24 21:02:14 +00:00
Nuno Lopes 342cf787ef add a few more functions to TargetLibraryInfo:
fputc, memchr, memcmp, putchar, puts, strchr, strncmp

llvm-svn: 160690
2012-07-24 21:00:36 +00:00
Dmitri Gribenko 52cb218149 CommentSema: simplify functions, per Jordan's comment.
llvm-svn: 160689
2012-07-24 20:58:46 +00:00
Richard Smith 7ac3c6af87 Pedantic -pedantic correction. Duplicate cv-qualifiers are permitted in C++11
unless they appear in a decl-specifier-seq.

llvm-svn: 160688
2012-07-24 20:24:58 +00:00
David Chisnall 5b8c1680de ELF does not imply GNU/Linux. Do not assume GNU conventions just because we
are targeting an ELF platform.  Only fold gs-relative (and fs-relative) loads
if it is actually sensible to do so for the target platform.

This fixes PR13438.

llvm-svn: 160687
2012-07-24 20:04:16 +00:00
Rafael Espindola a8842b4884 Don't use a temporary file.
llvm-svn: 160686
2012-07-24 20:00:35 +00:00
Anshuman Dasgupta eefe7c9cf9 Add new interfaces to support ldd's ReaderElf.cpp.
Patch by Sid Manning!

llvm-svn: 160685
2012-07-24 19:48:24 +00:00
Rafael Espindola 4d3487b44b ABIArgInfo's constructor is private and only used by the static get* methods.
No need to abuse default arguments.

llvm-svn: 160684
2012-07-24 19:30:23 +00:00
Dmitri Gribenko 35b0c09b6c Comment parsing: allow newlines between \param, direction specification (e.g.,
[in]), parameter name and description paragraph.

llvm-svn: 160682
2012-07-24 18:23:31 +00:00
Hans Wennborg 84ce606b91 Tweak warning text for returning incomplete type from extern "C" functions.
A warning was added in r150128 for returning non-C compatible
user-defined types from functions with C linkage.

This makes the text more clear for the case when the type isn't
decidedly non-C compatible, but incomplete.

llvm-svn: 160681
2012-07-24 17:59:41 +00:00
Dmitri Gribenko 0a36302ae0 Comment parsing: couple TextTokenRetokenizer and comment parser together to
remove one of the two variable-length lookahead buffers.  Now retokenizer will
ask for more tokens when it needs them.

llvm-svn: 160680
2012-07-24 17:52:18 +00:00
Dmitri Gribenko 1bfd9dadda Move TextTokenRetokenizer from CommentLexer.h to CommentParser.cpp since it is
an implementation detail of the parser.

llvm-svn: 160679
2012-07-24 17:43:18 +00:00