Commit Graph

34442 Commits

Author SHA1 Message Date
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
Douglas Gregor
73141fa98d Within the module representation, generalize the notion of an umbrella
header to also support umbrella directories. The umbrella directory
for an umbrella header is the directory in which the umbrella header
resides.

No functionality change yet, but it's coming.

llvm-svn: 146158
2011-12-08 17:39:04 +00:00
Douglas Gregor
2537a36483 Keep track of import dependencies between submodules within the module
that's currently being built. This is important for supporting
transitive dependencies ("export *" in the module map) completely.

llvm-svn: 146156
2011-12-08 17:01:29 +00:00
David Blaikie
ecd8a94acf Decltype in non-pseudo (& non-dependent) dtor calls.
llvm-svn: 146155
2011-12-08 16:13:53 +00:00
Douglas Gregor
ddaa69cb28 Convert paths to native format before constructing a
directory_iterator for them.

llvm-svn: 146154
2011-12-08 16:13:24 +00:00
Hans Wennborg
70a1324428 Only do typo correction for implicit function decls when
they are treated as errors.

Doing typo correction when these are just warnings slows down the
compilation of source which deliberately uses implicit function
declarations.

llvm-svn: 146153
2011-12-08 15:56:07 +00:00
Erik Verbruggen
f988785dc0 Fix: allow @protocol forward declarations inside @implementation-s.
llvm-svn: 146147
2011-12-08 09:58:43 +00:00
Francois Pichet
311084734d Unbreak MSVC build.
llvm-svn: 146146
2011-12-08 09:32:22 +00:00
Francois Pichet
33786cb499 Remove unused parameter from the LateParsedTemplatedFunction constructor.
llvm-svn: 146145
2011-12-08 09:11:52 +00:00
Peter Collingbourne
266e3dda17 Add an experimental MallocSizeofChecker, which reports inconsistencies
between the casted type of the return value of a malloc/calloc/realloc
call and the operand of any sizeof expressions contained within
its argument(s).

llvm-svn: 146144
2011-12-08 08:31:14 +00:00
Hal Finkel
221e11e864 Allow clang to find gcc libs on suse ppc64
llvm-svn: 146142
2011-12-08 05:50:03 +00:00
Rafael Espindola
18c7920d6b Add a minimal unwind.h that knows how to forward to the system one in systems
that have it in /usr/include (only OS X Lion so far).

llvm-svn: 146140
2011-12-08 05:01:39 +00:00
David Blaikie
7491e73709 Use the real end of the decltype expression.
llvm-svn: 146138
2011-12-08 04:53:15 +00:00
Argyrios Kyrtzidis
831411f42b [libclang] When doing clang_findReferencesInFile, make sure we don't crash
if we come up against a null Decl.

No test case unfortunately. rdar://10457799.

llvm-svn: 146127
2011-12-08 01:56:07 +00:00