Commit Graph

34455 Commits

Author SHA1 Message Date
Douglas Gregor 8ca0c6408e Make sure that we infer __strong, etc. when we instantiate variables
under ARC. Fixes <rdar://problem/10530209>.

llvm-svn: 146307
2011-12-10 01:22:52 +00:00
Richard Smith 036e2bd07a Add a fast path to the constant evaluator for integer literals. This speeds up
compilation of some translation units of SPEC's 445.gobmk by ~4%, and does not
seem to cause a measurable slowdown in other cases.

llvm-svn: 146306
2011-12-10 01:10:13 +00:00
Argyrios Kyrtzidis 6c8d29f7d1 Add a sanity check in SourceManager::getColumnNumber, make sure
we don't try to access beyond the buffer.

llvm-svn: 146305
2011-12-10 00:30:38 +00:00
Fariborz Jahanian 88d510da9d Add ability to supply additional message to availability macros,
// rdar://10095131

llvm-svn: 146304
2011-12-10 00:28:41 +00:00
Douglas Gregor ddaae8e4e5 Use the right CHECK prefix so that we actually do this checking. Miraculously, this hasn't broken
llvm-svn: 146303
2011-12-10 00:28:18 +00:00
Douglas Gregor c7f46f20d1 When we manage to re-use an expression during tree transformation (=
template instantiation), and that expression might produce a
temporary, invoke MaybeBindToTemporary. Otherwise, we forget to
destroy objects, release objects, etc. Fixes <rdar://problem/10531073>.

llvm-svn: 146301
2011-12-10 00:23:21 +00:00
Daniel Dunbar 19939cc380 Driver: Handle -f{no-}honor-infinities, -f{no-}honor-nans, and
-ffinite-math-only.
 - No test case yet, I don't know how to construct a situation where this
   matters.

llvm-svn: 146297
2011-12-09 23:41:18 +00:00
Matt Beaumont-Gay e17b7413e1 Fix up doxyments (\arg vs \p).
llvm-svn: 146292
2011-12-09 23:16:01 +00:00
Eli Friedman de6a86b4f6 Make array new on a pointer to data member type work correctly. PR11523.
llvm-svn: 146291
2011-12-09 23:05:37 +00:00
Richard Smith 0765bec2ad Mechanically convert static_assert_fold to static_assert, now we implement the
C++11 ICE rules.

llvm-svn: 146290
2011-12-09 23:00:37 +00:00
Richard Smith f57d8cb131 C++11 constant expressions: Don't use CheckICE in C++11; instead, determine
whether an expression is a (core) constant expression as a side-effect of
evaluation. This takes us from accepting far too few expressions as ICEs to
accepting slightly too many -- fixes for the remaining cases are coming next.

The diagnostics produced when an expression is found to be non-constant are
currently quite poor (with generic wording but reasonable source locations),
and will be improved in subsequent commits.

llvm-svn: 146289
2011-12-09 22:58:01 +00:00
Ted Kremenek b4a8b056f8 Add clang_getDiagnosticSetFromTU() to libclang. Fixes <rdar://problem/10553081>.
llvm-svn: 146287
2011-12-09 22:28:32 +00:00
Ted Kremenek 2d6d886d73 Sort exports list.
llvm-svn: 146286
2011-12-09 22:28:29 +00:00
David Blaikie 10eb4b67d8 Add notes for suppressing and (if it's a zero-arg function returning bool) fixing the function-to-bool conversion warning.
llvm-svn: 146280
2011-12-09 21:42:37 +00:00
Fariborz Jahanian e283346d0b objc-arc: diagnose synthesis of a 'weak unavailable' property.
// rdar://10535245

llvm-svn: 146272
2011-12-09 19:55:11 +00:00
David Blaikie 72b61203f4 Provide a separate warning for weak vtables in explicit template instantiations. There's no (current) way to fix such templates to emit strong symbols/vtables, but perhaps users want to know about the cost being incurred anyway.
llvm-svn: 146265
2011-12-09 18:32:50 +00:00
Douglas Gregor 5ca04bd4e7 When performing subframework header lookup, don't search for
".framework/" in the path name, because it could be ".framework\" on
Windows. This whole function needs to be rewritten with PathV2.

llvm-svn: 146261
2011-12-09 16:48:01 +00:00
Douglas Gregor e32e054279 Use llvm::sys::fs::equivalent rather than comparing inodes, because
comparing inodes doesn't actually work on Windows.

llvm-svn: 146260
2011-12-09 16:22:07 +00:00
Hans Wennborg 0c35326302 Remove unnecessary braces from my previous commit.
llvm-svn: 146259
2011-12-09 15:57:33 +00:00
Hans Wennborg a5b1aa99c7 Make printf warnings refer to wint_t and wchar_t by name
in addition to underlying type.

llvm-svn: 146254
2011-12-09 12:22:12 +00:00
Hans Wennborg a8b042d31a Move definition of ConversionSpecifier::toString() to FormatString.cpp
It's declared in FormatString.h, so it shouldn't be defined in
PrintfFormatString.cpp.

llvm-svn: 146253
2011-12-09 11:11:07 +00:00
Hans Wennborg 2027de3be9 fix format specifier fixit for printf("%ld", "foo");
It should reset the length modifier (unless it's a wchar_t string).

llvm-svn: 146252
2011-12-09 10:51:29 +00:00
Chandler Carruth 222c66db38 Fix a blatant typo or cut/paste-o reported by users of this header.
llvm-svn: 146251
2011-12-09 09:23:55 +00:00
Richard Smith 941aae0e9d Teach isConstantInitializer that numeric literals are constants, rather than
having it evaluate them. No change in functionality, but a speed up of about 5%
on some translation units in SPEC 445.gobmk.

llvm-svn: 146248
2011-12-09 06:47:34 +00:00
Chandler Carruth 0b84291222 Fix the --hash-style option when the target is MIPS as it is
incompatible with the MIPS ABI.

Patch by Simon Atanasyan.

llvm-svn: 146243
2011-12-09 04:45:18 +00:00
Richard Smith eb45aa0b2e Document the updated behaviour of __builtin_constant_p introduced in r146236.
llvm-svn: 146241
2011-12-09 03:40:28 +00:00
Anna Zaks 6af472aa3b [analyzer] Fix inconsistency on when SValBuilder assumes that 2
types are equivalent.

+ A taint test which tests bitwise operations and which was
triggering an assertion due to presence of the integer to integer cast.

llvm-svn: 146240
2011-12-09 03:34:02 +00:00
Argyrios Kyrtzidis fac35c0a9b In ExprEvaluatorBase::VisitOpaqueValueExpr() add a sanity check to avoid
infinite recursion due to bad OpaqueValueExpr.

llvm-svn: 146237
2011-12-09 02:44:48 +00:00
Richard Smith 10c7c9090e Replace the implementation of __builtin_constant_p (which was based on the GCC
documentation) with one based on what GCC's __builtin_constant_p is actually
intended to do (discovered by asking a friendly GCC developer).

In particular, an expression which folds to a pointer is now only considered to
be a "constant" by this builtin if it refers to the first character in a string
literal.

This fixes a rather subtle wrong-code issue when building with glibc. Given:

const char cs[4] = "abcd";
int f(const char *p) { return strncmp(p, cs, 4); }

... the macro magic for strncmp produces a (potentially crashing) call to
strlen(cs), because it expands to an expression starting with:

  __builtin_constant_p(cs) && strlen(cs) < 4 ? /* ... */

Under the secret true meaning of __builtin_constant_p, this is guaranteed to be
safe!

llvm-svn: 146236
2011-12-09 02:04:48 +00:00
Douglas Gregor 7033127b4e Implement the notion of umbrella directories, which implicity cover
all of the headers below that particular directory. Use umbrella
directories as a clean way to deal with (1) directories/frameworks
that don't have an umbrella header, but don't want to enumerate all of
their headers, and (2) PrivateHeaders, which we never want to
enumerate and want to keep separate from the main umbrella header. 

This also eliminates a little more of the "magic" for private headers,
and frameworks in general.

llvm-svn: 146235
2011-12-09 02:04:43 +00:00
Chandler Carruth f887db09e8 Move ChainedIncludesSource into the Frontend library. This never really
belonged in the Serialization library, it's setting up a compilation,
not just deserializing.

This should fix PR11512, making Serialization actually be layered below
Frontend, a long standing layering violation in Clang.

llvm-svn: 146233
2011-12-09 01:55:54 +00:00
Chandler Carruth ae89987ffe Clean up the comments for this file now that its contents are totally
different from what the comments indicated. Also drop a no longer used
include that also violates the layering between Serialization and
Frontend.

llvm-svn: 146230
2011-12-09 01:45:42 +00:00
Chandler Carruth b0ffe50da8 Move a free function from the Frontend library into the Lex library as
part of HeaderSearch. This function just normalizes filenames for use
inside of a synthetic include directive, but it is used in both the
Frontend and Serialization libraries so it needs a common home.

llvm-svn: 146227
2011-12-09 01:33:57 +00:00
Fariborz Jahanian 329b351807 deprecated enum should not warn when used initializing another deprecated enumerator.
// rdar://10535640

llvm-svn: 146218
2011-12-09 01:15:54 +00:00
Argyrios Kyrtzidis 4996f5fba2 Save category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!
llvm-svn: 146213
2011-12-09 00:31:40 +00:00
Argyrios Kyrtzidis fa469d0efd [libclang] Make sure we don't try to handle a CXCursor_NoDeclFound
passed to clang_findReferencesInFile.

llvm-svn: 146211
2011-12-09 00:17:49 +00:00
Argyrios Kyrtzidis c5dbeeadc1 [arcmt] Un-XFAIL a test.
llvm-svn: 146210
2011-12-09 00:17:47 +00:00
Chandler Carruth f459b32322 Teach the Makefile build about the new diagnostic file from r146207.
Amazingly this is all that's required.

llvm-svn: 146209
2011-12-09 00:09:20 +00:00
Rafael Espindola 7a284b2e78 Use default visibility in the the symbols declared in unwind.h. This matches
the behavior of gcc's unwind.h.

llvm-svn: 146208
2011-12-09 00:08:01 +00:00
Chandler Carruth 22a11b7248 Separate the serialization library's diagnostics from the frontend's
diagnostics. Conflating them was highly confusing and makes it harder to
establish a firm layering separation between these two libraries.

llvm-svn: 146207
2011-12-09 00:02:23 +00:00
Eli Friedman 83de51301a Misc Minix-specific changes to clang:
. move compiler-rt to a separate directory so the -L argument only includes compiler-rt (thanks joerg)
. build all clang subdirs
. switches the Minix platform to ELF
. normalizes toolchain invocation

Patch by Ben Gras.

llvm-svn: 146206
2011-12-08 23:54:21 +00:00
Bill Wendling 90118a3c9b Don't get the exception obj from the slot more than once.
llvm-svn: 146202
2011-12-08 23:21:26 +00:00
Anna Zaks 394256cc0d [analyzer] If memory region is tainted mark data as tainted.
+ random comments

llvm-svn: 146199
2011-12-08 22:38:43 +00:00
Eli Friedman 516c2ad731 Fix an edge case in IRGen for conditionals. PR11509.
llvm-svn: 146189
2011-12-08 22:01:56 +00:00
Hal Finkel 6b89a10b45 add tree test for suse on ppc64 (r146142)
llvm-svn: 146176
2011-12-08 20:36:19 +00:00
DeLesley Hutchins f7faa6a69b This patch extends thread safety analysis with support for the scoped_lockable attribute.
llvm-svn: 146174
2011-12-08 20:23:06 +00:00
Lang Hames 34792a8250 Added missing testcase from r145849. Thanks to Dave Blaikie for catching this.
llvm-svn: 146169
2011-12-08 19:26:24 +00:00
Douglas Gregor 524e33e1f8 Implement umbrella directories for modules, which are similar to
umbrella headers in the sense that all of the headers within that
directory (and eventually its subdirectories) are considered to be
part of the module with that umbrella directory. However, unlike
umbrella headers, which are expected to include all of the headers
within their subdirectories, Clang will automatically include all of
the headers it finds in the named subdirectory.

The intent here is to allow a module map to trivially turn a
subdirectory into a module, where the module's structure can mimic the
directory structure.

llvm-svn: 146165
2011-12-08 19:11:24 +00:00
Fariborz Jahanian 8307742d18 More refactoring of objective-C rewriter.
llvm-svn: 146160
2011-12-08 18:25:15 +00:00
Douglas Gregor 322f633c1c Tweak the syntax of umbrella headers, so that "umbrella" is treated as
a modifier for a header declarartion, e.g.,

  umbrella header "headername"

Collapse the umbrella-handling code in the parser into the
header-handling code, so we don't duplicate the header-search logic.

llvm-svn: 146159
2011-12-08 18:00:48 +00:00