Jordan Rose [Tue, 16 Oct 2012 00:47:25 +0000 (00:47 +0000)]
[analyzer] ObjCContainersASTChecker: minor cleanup and an extra test case.
Follow-up to r165838, which fixed a potential crash.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166002
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Mon, 15 Oct 2012 22:48:21 +0000 (22:48 +0000)]
[analyzer] CmpRuns - cleaned up the API, added relative path getter
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165995
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Mon, 15 Oct 2012 22:48:19 +0000 (22:48 +0000)]
[analyzer] Embed the analyzer version into the plist output.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165994
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Mon, 15 Oct 2012 22:48:17 +0000 (22:48 +0000)]
[analyzer] Enhance the error message.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165993
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Mon, 15 Oct 2012 22:48:14 +0000 (22:48 +0000)]
[analyzer] Do not warn on direct ivar assignments within copy methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165992
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 15 Oct 2012 22:23:53 +0000 (22:23 +0000)]
Un-revert r164907 and r164902 (+ follow-ups), 10.6 build fix to follow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165988
91177308-0d34-0410-b5e6-
96231b3b80d8
Abramo Bagnara [Mon, 15 Oct 2012 21:08:58 +0000 (21:08 +0000)]
Fixed CXXNamedCast right paren location propagation to instantiations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165977
91177308-0d34-0410-b5e6-
96231b3b80d8
Abramo Bagnara [Mon, 15 Oct 2012 21:07:44 +0000 (21:07 +0000)]
Fixed LabelDecl source range.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165976
91177308-0d34-0410-b5e6-
96231b3b80d8
Abramo Bagnara [Mon, 15 Oct 2012 21:06:42 +0000 (21:06 +0000)]
Fixed ClassTemplateSpecializationDecl source range.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165975
91177308-0d34-0410-b5e6-
96231b3b80d8
Abramo Bagnara [Mon, 15 Oct 2012 21:05:46 +0000 (21:05 +0000)]
Fixed FunctionTypeLoc range for trailing return type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165974
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 15 Oct 2012 20:57:52 +0000 (20:57 +0000)]
Fixes location of overriding declaration with no comment
of their own.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165972
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Mon, 15 Oct 2012 20:37:01 +0000 (20:37 +0000)]
Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.
See PR14013.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165962
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 15 Oct 2012 20:36:26 +0000 (20:36 +0000)]
Move the Attributes::Builder outside of the Attributes class and into its own class named AttrBuilder. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165961
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 15 Oct 2012 19:56:10 +0000 (19:56 +0000)]
[ms-inline asm] Rework the front-end to use the API introduced in r165946.
-The front-end now builds a single assembly string and feeds it to the
AsmParser. The front-end iterates on a per statement basis by calling the
ParseStatement() function. Please note, the calling of ParseStatement() and
and any notion of MCAsmParsedOperands will be sunk into the MC layer in the
near future. I plan to expose more basic APIs such as getClobbers, etc.
-The enumeration of the AsmString expressions have been reworked to use SMLocs
rather than assembly Pieces, which were being parsed in the front-end.
-The test case, t8(), was modified due to r129223. I'll have to find a way to
work around things such as these.
Sorry for the large commit, but breaking this in multiple smaller commits proved
too irritating.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165957
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 15 Oct 2012 18:58:50 +0000 (18:58 +0000)]
structured document comment: patch to provide comment for overriding function
template when comment is comming from overridden declaration.
// rdar://
12378793
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165953
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 15 Oct 2012 16:45:32 +0000 (16:45 +0000)]
Teach TargetInfo to hold on to the TargetOptions with which it was
created.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165943
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Mon, 15 Oct 2012 14:22:56 +0000 (14:22 +0000)]
[asan] make AddressSanitizer to be a FunctionPass instead of ModulePass. clang part: for FunctionPass we need to run asan at a different point, otherwise it will run before inlining
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165937
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Mon, 15 Oct 2012 13:12:24 +0000 (13:12 +0000)]
Only report first error when no compilation database is found.
Review: http://llvm-reviews.chandlerc.com/D62
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165933
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 15 Oct 2012 07:31:59 +0000 (07:31 +0000)]
Use enum values instead of magic numbers for indexing into the attribute list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165925
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 15 Oct 2012 06:28:11 +0000 (06:28 +0000)]
Introduce the notion of excluded headers into the module map
description. Previously, one could emulate this behavior by placing
the header in an always-unavailable submodule, but Argyrios guilted me
into expressing this idea properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165921
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 15 Oct 2012 04:47:45 +0000 (04:47 +0000)]
Attributes Rewrite
Convert the uses of the Attributes class over to the new format. The
Attributes::get method call now takes an LLVM context so that the attributes
object can be uniquified and stored.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165918
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 15 Oct 2012 00:23:07 +0000 (00:23 +0000)]
At -O0, emit an @llvm.trap() call at the end of a value-returning function which
fails to return a value, to make debugging this issue easier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165914
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 14 Oct 2012 19:50:53 +0000 (19:50 +0000)]
Make sure temporary files are deleted when recovering from a crash when compiling modules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165911
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 14 Oct 2012 19:21:21 +0000 (19:21 +0000)]
Delete temporary output files when an error occurs during PCH reading.
This reduces the spam make test leaves behind in /tmp. The assert isn't
particularly useful because it's not run with -disable-free (the default when
using the clang driver) but should cover all -cc1 tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165910
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 14 Oct 2012 11:50:50 +0000 (11:50 +0000)]
Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165905
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 08:54:39 +0000 (08:54 +0000)]
Remove operator cast method in favor of querying with the correct method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165900
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 03:28:14 +0000 (03:28 +0000)]
Use the Builder to create the stack alignment attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165888
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Sat, 13 Oct 2012 22:30:41 +0000 (22:30 +0000)]
"Implement" codegen support for __noop().
Eli discovered that __noop's sema behavior also needs some love. I filed
PR14081 for that and intend to improve it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165886
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Sat, 13 Oct 2012 21:56:05 +0000 (21:56 +0000)]
Simplify. Suggestion by Sean Silva.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165885
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Sat, 13 Oct 2012 05:05:20 +0000 (05:05 +0000)]
[analyzer] Remove the "direct bindings only" Environment lookup.
This was only used by OSAtomicChecker and makes it more
difficult to update values for expressions that the environment
may look through instead (it's not the same as IgnoreParens).
With this gone, we can have bindExpr bind to the inner
expression that getSVal will find.
Groundwork for <rdar://problem/
12137950>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165866
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Sat, 13 Oct 2012 05:05:13 +0000 (05:05 +0000)]
[analyzer] Remove unneeded 'inlineCall' checker callback.
I believe the removed assert in CheckerManager says it best:
InlineCall is a special hacky callback to allow intrusive
evaluation of the call (which simulates inlining). It is
currently only used by OSAtomicChecker and should go away
at some point.
OSAtomicChecker has gone away; inlineCall can now go away as well!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165865
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Sat, 13 Oct 2012 00:26:22 +0000 (00:26 +0000)]
Update for r165858.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165859
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 12 Oct 2012 23:32:10 +0000 (23:32 +0000)]
[ms-inline asm] Remove a bunch of parsing code from the front-end.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165851
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Fri, 12 Oct 2012 23:32:00 +0000 (23:32 +0000)]
Add TargetInfo for r600.
Patch by Tom Stellard.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165850
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Fri, 12 Oct 2012 23:29:20 +0000 (23:29 +0000)]
Make -mms-bitfields behave consistently.
Patch by Jeremiah Zanin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165849
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 12 Oct 2012 22:57:06 +0000 (22:57 +0000)]
-fcatch-undefined-behavior: Trap undefined behavior due to conversions to or
from a floating-point type where the source value is not in the range of
representable values of the destination type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165843
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 12 Oct 2012 22:56:45 +0000 (22:56 +0000)]
Move assertion to not crash tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165842
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 12 Oct 2012 22:56:42 +0000 (22:56 +0000)]
Silence static analyzer issue by documenting that in this context
that a DeclRefExpr can never return a null decl. We possibly should
hoist this into getDecl() itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165841
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 12 Oct 2012 22:56:40 +0000 (22:56 +0000)]
Silence null dereference warnings by documenting context-specific
invariants using assertions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165840
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 12 Oct 2012 22:56:38 +0000 (22:56 +0000)]
Further harden checking that scan-view isn't serving up pages outside
the server root.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165839
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 12 Oct 2012 22:56:36 +0000 (22:56 +0000)]
Fix potential crash in ObjCContainersChecker by properly validating
the number of arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165838
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 12 Oct 2012 22:56:33 +0000 (22:56 +0000)]
Silence dead store warning. It is conceptually possible we will
add more code that references SourceFile, so removing the dead store
doesn't seem appropriate for the long term.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165837
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 12 Oct 2012 22:56:31 +0000 (22:56 +0000)]
Fix potential null deference in CFG printer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165836
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 12 Oct 2012 22:56:26 +0000 (22:56 +0000)]
Remove dead store.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165835
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 12 Oct 2012 22:53:52 +0000 (22:53 +0000)]
Update for r165833.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165834
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Fri, 12 Oct 2012 22:45:14 +0000 (22:45 +0000)]
Fix -ast-print for uses of operator->.
Patch by Grzegorz Jablonski.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165832
91177308-0d34-0410-b5e6-
96231b3b80d8
DeLesley Hutchins [Fri, 12 Oct 2012 21:49:04 +0000 (21:49 +0000)]
Fix warnings introduced by r165826.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165829
91177308-0d34-0410-b5e6-
96231b3b80d8
DeLesley Hutchins [Fri, 12 Oct 2012 21:38:12 +0000 (21:38 +0000)]
Thread-safety analysis: support multiple thread-safety attributes on
declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165826
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 12 Oct 2012 21:37:00 +0000 (21:37 +0000)]
[ms-inline asm] Remove a bunch of parsing code from the front-end, which will be
reimplemented in the AsmParser where it belongs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165825
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 12 Oct 2012 21:17:34 +0000 (21:17 +0000)]
Add missing header from 165821
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165822
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 12 Oct 2012 21:15:50 +0000 (21:15 +0000)]
Sanitize the names of modules determined based on the names of headers
or directories, to make sure that they are identifiers that are not
keywords in any dialect. Fixes <rdar://problem/
12489495>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165821
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Fri, 12 Oct 2012 20:16:26 +0000 (20:16 +0000)]
Remove XFAIL,fix test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165819
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Fri, 12 Oct 2012 20:07:31 +0000 (20:07 +0000)]
XFAIL pending further investigation
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165818
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 12 Oct 2012 20:00:44 +0000 (20:00 +0000)]
Fix typo correction of one qualified name to another.
When suggesting "foo::bar" as a correction for "fob::bar" we mistakenly
replaced only "bar" with "foo::bar" producing "fob::foo::bar" which was broken.
This corrects that replacement in as many places as I could find & provides
test cases for all those cases I could find a test case for. There are a couple
that don't seem to be reachable (one looks entirely dead, the other just
doesn't seem to ever get called with a namespace to namespace change).
Review by Richard Smith ( http://llvm-reviews.chandlerc.com/D57 ).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165817
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Fri, 12 Oct 2012 19:26:17 +0000 (19:26 +0000)]
This patch addresses PR13948.
For 64-bit PowerPC SVR4, an aggregate containing only one
floating-point field (float, double, or long double) must be passed in
a register as though just that field were present. This patch
addresses the issue during Clang code generation by specifying in the
ABIArgInfo for the argument that the underlying type is passed
directly in a register. The included test case verifies flat and
nested structs for the three data types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165816
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 12 Oct 2012 19:16:31 +0000 (19:16 +0000)]
Have scan-view guard against serving up pages outside the root directory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165815
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Fri, 12 Oct 2012 17:48:40 +0000 (17:48 +0000)]
Change (!ptr != 0) to (!ptr) to make the code more readable.
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165811
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 12 Oct 2012 17:39:59 +0000 (17:39 +0000)]
Handle a "#pragma options align" inside a class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165810
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 12 Oct 2012 17:28:36 +0000 (17:28 +0000)]
Add dump support for comments coming from
overridden symbols. OK'ed off-line by Doug.
// rdar://
12378793
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165807
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 12 Oct 2012 14:25:52 +0000 (14:25 +0000)]
c-index-test.c: /* Use C style comment. */
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165797
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 12 Oct 2012 14:11:32 +0000 (14:11 +0000)]
clang/test/Index/index-module.m: Tweak expressions to fit Win32 paths.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165794
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 12 Oct 2012 14:01:58 +0000 (14:01 +0000)]
Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165793
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 12 Oct 2012 05:31:40 +0000 (05:31 +0000)]
[PCH] We only need to record C++ overridden methods once for the canonical decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165788
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 12 Oct 2012 00:18:19 +0000 (00:18 +0000)]
Conditionally use an integral cast for BodyFarm support for OSAtomicCompareAndSwap if the return type is not a boolean.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165774
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 12 Oct 2012 00:16:50 +0000 (00:16 +0000)]
Track which particular submodule #undef's a macro, so that the actual
#undef only occurs if that submodule is imported.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165773
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 12 Oct 2012 00:02:48 +0000 (00:02 +0000)]
Remove dead code introduced in r165751.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165772
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 11 Oct 2012 23:52:50 +0000 (23:52 +0000)]
search for overridden methods with comment when overriding method
has none of its own. Factor in Doug's comments.
// rdar://
12378793
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165771
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Thu, 11 Oct 2012 23:31:23 +0000 (23:31 +0000)]
Remove pointless classof()'s.
Updates to llvm/Support/Casting.h have rendered these classof()'s
irrelevant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165770
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Thu, 11 Oct 2012 23:31:18 +0000 (23:31 +0000)]
Add missing classof().
Somewhat troublingly, without this implemented, the check inside
isa_impl<> would silently use the parent's `classof()` when determining
whether it was okay to downcast from the parent to the child!
Bug analysis:
A build failure after removing the parent's `classof()` initially
alerted me to the bug, after which a little bit of thinking and reading
of the code identified the root cause.
The compiler could be made to prevent this bug from happening if there
were a way to ensure that in the code
template <typename To, typename From, typename Enabler = void>
struct isa_impl {
static inline bool doit(const From &Val) {
return To::classof(&Val);
}
};
that `To::classof` is actually inside the class `To`, and not in a base
class. I am not aware of a way to check this in C++. If there is a means
to perform that check, please bring it up on the list and this will be
fixed.
There is a high likelihood that there are other instances of this same
bug in the codebase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165769
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 11 Oct 2012 22:55:07 +0000 (22:55 +0000)]
Provide a fixit when taking the address of an unqualified member function.
This only applies if the type has a name. (we could potentially do something
crazy with decltype in C++11 to qualify members of unnamed types but that
seems excessive)
It might be nice to also suggest a fixit for "&this->i", "&foo->i",
and "&foo.i" but those expressions produce 'bound' member functions that have
a different AST representation & make error recovery a little trickier. Left
as future work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165763
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 11 Oct 2012 22:48:22 +0000 (22:48 +0000)]
clang/test/Index/index-module.m: Move XFAIL. It was line-number-sensitive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165762
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 11 Oct 2012 22:33:19 +0000 (22:33 +0000)]
clang/test/Index/index-module.m: Mark it as XFAIL:win32 for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165761
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 11 Oct 2012 22:33:14 +0000 (22:33 +0000)]
clang/test/Index/index-pch-with-module.m: Tweak expressions for win32 pathsep.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165760
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 11 Oct 2012 21:44:41 +0000 (21:44 +0000)]
[ms-inline asm] Remove a bunch of parsing code from the front-end, which will be
reimplemented in the AsmParser where it belongs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165752
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 11 Oct 2012 21:28:29 +0000 (21:28 +0000)]
[ms-inline asm] Lookup the IdentifierInfo using the Idents table and remove the
now unused static helper function.
The test case needs to be remove temporarily until I can better filter memory
operands that aren't actual variable reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165751
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 11 Oct 2012 21:07:39 +0000 (21:07 +0000)]
Diagnose the expansion of ambiguous macro definitions. This can happen
only with modules, when two disjoint modules #define the same
identifier to different token sequences.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165746
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 11 Oct 2012 20:58:21 +0000 (20:58 +0000)]
Remove OSAtomicChecker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165744
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 11 Oct 2012 20:58:18 +0000 (20:58 +0000)]
Switch over to BodyFarm implementation of OSAtomicCompareAndSwap and
objc_atomicCompareAndSwap.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165743
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 11 Oct 2012 20:58:14 +0000 (20:58 +0000)]
Teach GetBaseType() about BlockPointerTypes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165742
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Thu, 11 Oct 2012 20:56:57 +0000 (20:56 +0000)]
Add TargetTransformInfo to the clang driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165741
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 11 Oct 2012 19:38:23 +0000 (19:38 +0000)]
[libclang] Make sure the index_data.main_filename field is initialized
in c-index-test. index_enteredMainFile is not invoked when indexing a
module file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165735
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 11 Oct 2012 19:21:21 +0000 (19:21 +0000)]
[libclang] Remove this test while I investigate why it is crashing on release+asserts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165734
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 11 Oct 2012 19:06:43 +0000 (19:06 +0000)]
Add null check for malformed code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165733
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 11 Oct 2012 19:00:44 +0000 (19:00 +0000)]
[libclang] Add tests for indexing modules and PCHs using modules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165732
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Thu, 11 Oct 2012 18:21:13 +0000 (18:21 +0000)]
Fix build failure from r165722
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165731
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 11 Oct 2012 17:41:54 +0000 (17:41 +0000)]
Introduce a simple "hint" scheme to eliminate the quadratic behavior
associated with deserializing macro history for an identifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165729
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 11 Oct 2012 17:31:34 +0000 (17:31 +0000)]
Make the deserialization of PendingMacroIDs deterministic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165727
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 11 Oct 2012 17:21:41 +0000 (17:21 +0000)]
Add in the first iteration of support for llvm/clang/lldb to allow variable per address space pointer sizes to be optimized correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165726
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Thu, 11 Oct 2012 17:02:00 +0000 (17:02 +0000)]
-Warc-repeated-use-of-weak: fix a use-of-uninitialized and add a test case.
Fix-up for r165718, should get the buildbots back online.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165723
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Thu, 11 Oct 2012 16:55:58 +0000 (16:55 +0000)]
Properly factor Native Client defines to support NaCl as an OS
with x86/ARM architecture
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165722
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 11 Oct 2012 16:32:25 +0000 (16:32 +0000)]
Handle gnu_inline in c++ in a gcc compatible way. Original patch by Tobias
Grosser.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165720
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Thu, 11 Oct 2012 16:10:19 +0000 (16:10 +0000)]
-Warc-repeated-use-of-weak: Don't warn on a single read followed by writes.
This is a "safe" pattern, or at least one that cannot be helped by using
a strong local variable. However, if the single read is within a loop,
it should /always/ be treated as potentially dangerous.
<rdar://problem/
12437490>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165719
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Thu, 11 Oct 2012 16:06:21 +0000 (16:06 +0000)]
-Warc-repeated-use-of-weak: Check messages to property accessors as well.
Previously, [foo weakProp] was not being treated the same as foo.weakProp.
Now, for every explicit message send, we check if it's a property access,
and if so, if the property is weak. Then for every assignment of a
message, we have to do the same thing again.
This is a potentially expensive increase because determining whether a
method is a property accessor requires searching through the methods it
overrides. However, without it -Warc-repeated-use-of-weak will miss cases
from people who prefer not to use dot syntax. If this turns out to be
too expensive, we can try caching the result somewhere, or even lose
precision by not checking superclass methods. The warning is off-by-default,
though.
<rdar://problem/
12407765>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165718
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 11 Oct 2012 16:05:00 +0000 (16:05 +0000)]
[libclang] Improve AST serialization done by ASTUnit::Save().
The ASTUnit needs to initialize an ASTWriter at the beginning of
parsing to fully handle serialization of a translation unit that
imports modules. Do this by introducing an option to enable it, which
corresponds to CXTranslationUnit_ForSerialization on the C API side.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165717
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Thu, 11 Oct 2012 16:02:02 +0000 (16:02 +0000)]
ObjCMethodDecl::findPropertyDecl: bail out early if not an instance method.
Currently, Objective-C does not support class properties, even though it
allows calling class methods with dot syntax.
No intended functionality change; purely optimization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165716
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Thu, 11 Oct 2012 15:52:22 +0000 (15:52 +0000)]
Make X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32
and Native Client
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165715
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 11 Oct 2012 11:20:31 +0000 (11:20 +0000)]
clang/test/CodeGenCXX/microsoft-uuidof.cpp: Fix for -Asserts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165712
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Thu, 11 Oct 2012 10:13:44 +0000 (10:13 +0000)]
Add codegen support for __uuidof().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165710
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 11 Oct 2012 06:26:56 +0000 (06:26 +0000)]
Add prologue text for list of potential checkers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165705
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 11 Oct 2012 01:10:04 +0000 (01:10 +0000)]
clang/lib/Headers/CMakeLists.txt: Add f16cintrin.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165688
91177308-0d34-0410-b5e6-
96231b3b80d8