Richard Smith
acd4d3d52a
-Wc++98-compat warnings for the lexer.
...
This also adds a -Wc++98-compat-pedantic for warning on constructs which would
be diagnosed by -std=c++98 -pedantic (that is, it warns even on C++11 features
which we enable by default, with no warning, in C++98 mode).
llvm-svn: 142034
2011-10-15 01:18:56 +00:00
Douglas Gregor
9e0a5b3900
Teach the ASTImporter to perform DeclContext lookups in a way that
...
avoids loading data from an external source, since those lookups were
causing some "interesting" recursion in LLDB.
This code is not efficient. I plan to remedy this inefficiency in a
follow-up commit.
llvm-svn: 142023
2011-10-15 00:10:27 +00:00
Peter Collingbourne
60188eb8bf
Add c_alignas and cxx_alignas features
...
llvm-svn: 142020
2011-10-14 23:44:46 +00:00
Anton Korobeynikov
f0c267e6e0
Provide half floating point support as a storage only type.
...
Lack of half FP was a regression compared to llvm-gcc.
llvm-svn: 142016
2011-10-14 23:23:15 +00:00
Eli Friedman
1e7a0c6a1d
Attempt to fix Windows buildbot, round 2.
...
llvm-svn: 142014
2011-10-14 23:10:30 +00:00
Eli Friedman
8d3e43ff4a
Add template instantiation support for AtomicExpr.
...
llvm-svn: 142012
2011-10-14 22:48:56 +00:00
Douglas Gregor
03d1ed304b
Teach the ASTImporter not to import redundant fields.
...
llvm-svn: 142009
2011-10-14 21:54:42 +00:00
Eli Friedman
e2c600cf43
Attempt to fix buildbot failure on Windows.
...
llvm-svn: 142008
2011-10-14 21:52:24 +00:00
Argyrios Kyrtzidis
1ac5da1017
Allow calling ASTUnit::LoadFromCompilerInvocationAction with a previously created ASTUnit.
...
llvm-svn: 142004
2011-10-14 21:22:05 +00:00
Eli Friedman
4b72fddd99
Misc fixes for atomics. Biggest fix is doing alignment correctly for _Atomic types.
...
llvm-svn: 142002
2011-10-14 20:59:01 +00:00
Richard Smith
f679b5b6a6
-Wc++98-compat: warn on C++11 attributes and alignas.
...
llvm-svn: 141999
2011-10-14 20:48:27 +00:00
Douglas Gregor
7e1aa5b7ac
Don't try to diagnose anything when we're passing incomplete types
...
through varargs. This only happens when we're in an unevaluated
context, where we don't want to trigger an error anyway. Fixes PR11131
/ <rdar://problem/10288375>.
llvm-svn: 141986
2011-10-14 20:34:19 +00:00
Richard Smith
96bd62f769
Reinstate r141898 (reverted in r141921), without the -Wc++98-compat-variadic-templates flag. Consensus is that -Wc++98-compat is a useful addition to clang, but per-C++11-feature warnings may not be.
...
Original patch by Jeffrey Yasskin.
llvm-svn: 141985
2011-10-14 20:31:37 +00:00
Richard Smith
faa32a9b83
Refactor static analyzer to use simpler interface to constant expression evaluation.
...
llvm-svn: 141983
2011-10-14 20:22:00 +00:00
Richard Smith
465841e48c
[temp.explicit]p1: constexpr cannot be specified in explicit instantiations.
...
llvm-svn: 141982
2011-10-14 19:58:02 +00:00
Rafael Espindola
c0b9791b63
Fix the CXX_INCLUDE_ROOT case that was out of date with ScanLibDirForGCCTriple.
...
llvm-svn: 141980
2011-10-14 19:50:08 +00:00
Benjamin Kramer
b89514a9b8
Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer.
...
Passing a pointer was a bad idea as it collides with the overload for void*.
llvm-svn: 141971
2011-10-14 18:45:37 +00:00
Benjamin Kramer
47b5b31e61
Simplify code to avoid a useless string copy.
...
llvm-svn: 141970
2011-10-14 18:45:16 +00:00
Benjamin Kramer
fd0b05f341
Upgrade to PathV2.
...
llvm-svn: 141969
2011-10-14 18:45:11 +00:00
Benjamin Kramer
13481e27cb
Add parens to pacify GCC.
...
llvm-svn: 141968
2011-10-14 18:45:06 +00:00
Fariborz Jahanian
e1e17cd8e2
Fix misplaced comment.
...
llvm-svn: 141967
2011-10-14 18:35:31 +00:00
Fariborz Jahanian
03df2b2e56
Make value kind based on the return type of the getter, not
...
property type, for when getter may be a reference type.
// rdar://10188258 revised.
llvm-svn: 141966
2011-10-14 18:31:36 +00:00
Argyrios Kyrtzidis
db21596473
[PCH] Serialize info about redeclared objc methods.
...
llvm-svn: 141964
2011-10-14 17:41:52 +00:00
Douglas Gregor
f1404d7d49
Under ARC, merge the bit corresponding to the ns_returns_retained
...
attribute from the first declaration to later declarations. Fixes
<rdar://problem/10142572>.
llvm-svn: 141957
2011-10-14 15:55:40 +00:00
Matt Beaumont-Gay
c622163b0f
Only warn in -Wliteral-conversion if the conversion loses information
...
llvm-svn: 141955
2011-10-14 15:36:25 +00:00
Douglas Gregor
041b084f73
When declaring an out-of-line template, attempt to rebuild any types
...
within the template parameter list that may have changed now that we
know the current instantiation. Fixes <rdar://problem/10194295>.
llvm-svn: 141954
2011-10-14 15:31:12 +00:00
Erik Verbruggen
98ea7f6737
Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations to
...
retrieve annotations from completion string.
llvm-svn: 141953
2011-10-14 15:31:08 +00:00
Argyrios Kyrtzidis
dcaaa21fbe
Really protect from infinite loop when there are objc method redeclarations.
...
Serialization part will come later.
llvm-svn: 141950
2011-10-14 08:02:31 +00:00
Argyrios Kyrtzidis
c5e829cad2
Keep track of objc method redeclarations in the same interface.
...
Avoid possible infinite loop when iterating over an ObjCMethod's redeclarations.
llvm-svn: 141946
2011-10-14 06:48:06 +00:00
Bob Wilson
6524dd33be
Use Triple.isOSDarwin() instead of comparing against Triple::Darwin.
...
There are now separate Triple::MacOSX and Triple::IOS values for the OS
so comparing against Triple::Darwin will fail to match those. Note that
I changed the expected output for the Driver/rewrite-objc.m test, which had
previously not been passing Darwin-specific options with the macosx triple.
llvm-svn: 141944
2011-10-14 05:03:44 +00:00
Eli Friedman
fde961dbf3
PR11124: Don't overwrite memory outside of a base class when performing zero-initialization before running its constructor.
...
llvm-svn: 141933
2011-10-14 02:27:24 +00:00
Douglas Gregor
82e0d728e8
Add a preprocessor callback that is invoked every time the 'defined'
...
operator is seen, from Jason Haslam!
llvm-svn: 141926
2011-10-14 00:49:43 +00:00
Jeffrey Yasskin
de8a104633
Revert the -Wc++98-compat flag because dgregor doesn't like it.
...
llvm-svn: 141921
2011-10-14 00:04:00 +00:00
Fariborz Jahanian
df4f7ca331
objc-arc: 'Class' property is implicitly __unsafe_unretained.
...
// rdar://10239594
llvm-svn: 141915
2011-10-13 23:45:45 +00:00
Richard Smith
31ce793a0b
Rename -Wc++0x-compat, -Wc++0x-extensions and -Wc++0x-narrowing from c++0x to
...
c++11. The old names are kept for backwards-compatibility. Patch by Ahmed
Charles! Names for backwards-compatible DiagGroups removed by me.
llvm-svn: 141913
2011-10-13 23:32:09 +00:00
Nico Weber
39bfed8ad6
Extend -Wno-sizeof-array-argument to strncpy and friends.
...
This finds 2 bugs in chromium and 1 in hunspell, with 0 false positives.
llvm-svn: 141902
2011-10-13 22:30:23 +00:00
Jeffrey Yasskin
a722170eb9
Implement the first piece of a -Wc++98-compat flag so that people can build in
...
C++11 mode but keep their sources compatible with C++98. This patch implements
the -Wc++98-compat-variadic-templates sub-flag and -Wc++98-compat to include
it.
llvm-svn: 141898
2011-10-13 22:18:05 +00:00
Eric Christopher
7cdf948601
Recommit:
...
Start handling debug line and scope information better:
Migrate most of the location setting within the larger API in CGDebugInfo and
update a lot of callers.
Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
and replace it with DILexicalBlockFile usage.
Finishes off the rest of rdar://10246360
after fixing a few bugs that were exposed in gdb testsuite testing.
llvm-svn: 141893
2011-10-13 21:45:18 +00:00
Benjamin Kramer
74a1f91ff7
Add triple for RHEL 5 to the libpath collecting logic.
...
llvm-svn: 141887
2011-10-13 20:45:37 +00:00
Ted Kremenek
596fa16dd3
Tweak -Wuninitialized's handling of 'int x = x' to report that as the root cause of an uninitialized variable IFF there are other uses of that uninitialized variable. Fixes <rdar://problem/9259237>.
...
llvm-svn: 141881
2011-10-13 18:50:06 +00:00
Douglas Gregor
f4a06c2104
HasFormOfMemberPointer implies IsAddressOfOperand for an overload set. Simplify
...
llvm-svn: 141878
2011-10-13 18:26:27 +00:00
Douglas Gregor
cda2270217
Allow calling an overloaded function set by taking the address of the
...
functions, e.g., (&f)(0). Fixes <rdar://problem/9803316>.
llvm-svn: 141877
2011-10-13 18:10:35 +00:00
Peter Collingbourne
adcf7c9203
TCE target: conversion of OpenCL reqd_work_group_size attr to metadata
...
Patch by Pekka Jääskeläinen!
llvm-svn: 141865
2011-10-13 16:24:41 +00:00
Erik Verbruggen
ca98f2a63f
Allow for annotate attributes after access specifiers. When such
...
attributes are found, propagate them to subsequent declarations.
llvm-svn: 141861
2011-10-13 09:41:32 +00:00
David Blaikie
eba32c2229
Fix crash-on-invalid, improve error recovery, and test coverage for missing colon after access specifiers in C++
...
llvm-svn: 141852
2011-10-13 06:08:43 +00:00
Douglas Gregor
ebcfbb5d22
When we determine that a function template specialization produced as
...
part of template argument deduction is ill-formed, we mark it as
invalid and treat it as a deduction failure. If we happen to find that
specialization again, treat it as a deduction failure rather than
silently building a call to the declaration.
Fixes PR11117, a marvelous bug where deduction failed after creating
an invalid specialization, causing overload resolution to pick a
different candidate. Then we performed a similar overload resolution
later, and happily picked the invalid specialization to
call... resulting in a silent link failure.
llvm-svn: 141809
2011-10-12 20:35:48 +00:00
Bob Wilson
73a4deb33d
Change __extension__ to disable only diagnostics controlled by -pedantic.
...
This changes clang to match GCC's behavior for __extension__, which temporarily
disables the -pedantic flag. Warnings that are enabled without -pedantic
are not affected. Besides the general goodness of matching GCC's precedent,
my motivation for this is that macros in the arm_neon.h header need to use
__extension__ to avoid pedantic complaints about their use of statement
expressions, yet we still want to warn about incompatible pointer arguments
for those macros.
llvm-svn: 141804
2011-10-12 19:55:31 +00:00
Rafael Espindola
2d21ab024e
Add returns_twice to functions that are known to return twice. This implements
...
the same behavior of gcc by keeping the attribute out of the function type.
llvm-svn: 141803
2011-10-12 19:51:18 +00:00
Ted Kremenek
a35d67dfd9
Implement built-in macro '__has_warning', which allows one to query if a warning flag is valid. Fixes <rdar://problem/10263428>.
...
llvm-svn: 141802
2011-10-12 19:46:30 +00:00
Douglas Gregor
227c352bae
We do parse hexfloats in C++11; make it actually work.
...
llvm-svn: 141798
2011-10-12 18:51:02 +00:00
Eric Christopher
93663b3c62
Revert file/scope handling patches. gdb testing revealed a couple of bugs.
...
llvm-svn: 141796
2011-10-12 18:39:35 +00:00
Douglas Gregor
3d68aa838b
The Objective-C rewriter uses the fragile ABI, always.
...
llvm-svn: 141795
2011-10-12 18:28:53 +00:00
Ted Kremenek
6effcb5082
Fix typo in name of diagnostic.
...
llvm-svn: 141793
2011-10-12 18:03:37 +00:00
Argyrios Kyrtzidis
f37d0a61c0
Handle the case where preprocessor entities are not received in order,
...
fixes http://llvm.org/PR11120
llvm-svn: 141788
2011-10-12 17:36:33 +00:00
Douglas Gregor
e7a8e3b612
Introduce BalancedDelimiterTracker, to better track open/close
...
delimiter pairs and detect when we exceed the implementation limit for
nesting depth, from Aaron Ballman!
llvm-svn: 141782
2011-10-12 16:37:45 +00:00
Douglas Gregor
6a0e23ff8b
Teach __has_nothrow_assign not to complain about access (GCC and EDG
...
ignore access entirely for it) and not to crash on assignment operator
templates. Fixes PR11110.
llvm-svn: 141777
2011-10-12 15:40:49 +00:00
Jim Goodnow II
5a793d3762
Removed extra line in comment.
...
llvm-svn: 141773
2011-10-12 09:55:01 +00:00
Anton Korobeynikov
804dd056b3
Add target info for Linux on PPC & Sparc.
...
Patch by Hal Finkel!
llvm-svn: 141772
2011-10-12 09:30:58 +00:00
Argyrios Kyrtzidis
7f6b029c4e
Introduce SourceManager::getFileLoc which returns a file location
...
taking into account macro arguments.
llvm-svn: 141771
2011-10-12 07:07:40 +00:00
Richard Smith
fd53aaf7e7
constexpr: don't consider class types with mutable members to be literal types.
...
The standard doesn't allow this, but mutable constexpr variables break the
semantics so badly that we can't reasonably accept them.
llvm-svn: 141768
2011-10-12 05:08:15 +00:00
Eric Christopher
663b7f353e
Remember to set the location in EmitGlobalVariable to the current decl
...
if we're going to delete the setLocation as we did in 141732.
llvm-svn: 141762
2011-10-12 01:11:30 +00:00
Richard Smith
a9e33d44a6
Handle Perforce-style conflict markers like normal conflict markers. Perforce
...
swaps over the <<<< and >>>> markers, and uses shorter markers than traditional
tools.
llvm-svn: 141751
2011-10-12 00:37:51 +00:00
Fariborz Jahanian
fa643c8f3b
objc: note location of the previously declared
...
property in the diagnostic.
llvm-svn: 141745
2011-10-12 00:00:57 +00:00
John McCall
50a2c2c19d
Catch placeholder types in DefaultLvalueConversion
...
and DefaultFunctionArrayLvalueConversion. To prevent
significant regression for should-this-be-a-call fixits,
and to repair some such regression from the introduction of
bound member placeholders, make those placeholder checks
try to build calls appropriately. Harden the build-a-call
logic while we're at it.
llvm-svn: 141738
2011-10-11 23:14:30 +00:00
Fariborz Jahanian
ff4d5e4c20
objc rewriter: Restore objc_msgSend_stret/objc_msgSendSuper_stret declaration
...
to their fragile-abi representation.
llvm-svn: 141735
2011-10-11 23:02:37 +00:00
Eric Christopher
498b7fd7fe
Start handling debug line and scope information better:
...
Migrate most of the location setting within the larger API in CGDebugInfo and
update a lot of callers.
Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
and replace it with DILexicalBlockFile usage.
Finishes off the rest of rdar://10246360
llvm-svn: 141732
2011-10-11 23:00:55 +00:00
Eric Christopher
fefafacf68
80-column and tab cleanup.
...
llvm-svn: 141731
2011-10-11 23:00:51 +00:00
Eric Christopher
fb4cd4082c
Reorder this to make it easier to add more changes for a location set.
...
llvm-svn: 141730
2011-10-11 23:00:45 +00:00
Eli Friedman
94ab9308d7
PR11062: Make C99 inlining work properly for names with associated builtin libcalls.
...
llvm-svn: 141723
2011-10-11 22:09:24 +00:00
Richard Smith
4ce706afc4
Constant expression evaluation: refactor value initialization and scalar list initialization into base class.
...
llvm-svn: 141717
2011-10-11 21:43:33 +00:00
Eli Friedman
c2025567f5
Silence some -Wuninitialized false positives with gcc.
...
llvm-svn: 141701
2011-10-11 20:00:47 +00:00
Richard Smith
4dd85d6fa1
Add a -Wc++0x-compat warning for C++11 keywords used as identifiers when in
...
C++98 mode. Only the first occurrence of each keyword will produce a warning.
llvm-svn: 141700
2011-10-11 19:57:52 +00:00
Douglas Gregor
9d7c1a2a18
Add support for viewing the module graph via Graphviz, for debugging
...
purposes.
llvm-svn: 141697
2011-10-11 19:27:55 +00:00
Daniel Dunbar
0f41eee2a0
Driver: Add support for a new -nostdlibinc option.
...
- This disables the system include directories, but not the compiler builtin
directories. Useful for projects that want to use things like the intrinsic
headers, but are otherwise freestanding.
- I'm willing to reconsider the option naming, I also considered providing an
explicit -builtinc (which would match -nobuiltininc), but this is more
consistent with existing options.
llvm-svn: 141692
2011-10-11 18:20:16 +00:00
Daniel Dunbar
b25bfde52d
Frontend: Replace -nostdinc by -nostdsysteminc (which is just system include
...
paths). The -nostdinc behavior is now -nostdsysteminc + -nobuiltininc.
llvm-svn: 141691
2011-10-11 18:20:10 +00:00
Anna Zaks
fc2b79029c
[analyzer] Remove an unused member variable.
...
llvm-svn: 141690
2011-10-11 18:19:20 +00:00
John McCall
3cec19f925
Rename SemaCXXCast.cpp to SemaCast.cpp.
...
llvm-svn: 141686
2011-10-11 17:38:55 +00:00
Anna Zaks
8c57c4ba27
[analyzer] CheckerContext updates checkDst in it's destructor, so make sure the object is destructed before checkDst is used.
...
llvm-svn: 141683
2011-10-11 17:29:59 +00:00
Argyrios Kyrtzidis
7a70d2f11b
For the FileChanged Preprocessor callback, when exiting a file, pass its FileID.
...
llvm-svn: 141681
2011-10-11 17:29:44 +00:00
Anna Zaks
cc92521066
[analyzer] Fix a typo.
...
llvm-svn: 141678
2011-10-11 16:49:54 +00:00
Alexis Hunt
77c1f9f888
Get rid of ShouldDeleteMoveConstructor.
...
llvm-svn: 141650
2011-10-11 06:43:29 +00:00
Alexis Hunt
1bc6f71ebc
Consolidate copy constructor deletion into ShouldDeleteSpecialMember.
...
llvm-svn: 141645
2011-10-11 04:55:36 +00:00
Anna Zaks
fedf5dfc71
[analyzer] Warn about the use of insecure, deprecated vfork() function PR11053 ( http://llvm.org/bugs/show_bug.cgi?id=11053 ).
...
A patch by Graham Lee!
llvm-svn: 141643
2011-10-11 04:34:54 +00:00
David Meyer
bfdbb25af2
Allow regparm attribute for PNaCl target
...
llvm-svn: 141638
2011-10-11 03:12:01 +00:00
Eli Friedman
df14b3a837
Initial implementation of __atomic_* (everything except __atomic_is_lock_free).
...
llvm-svn: 141632
2011-10-11 02:20:01 +00:00
Francois Pichet
9a57fb5734
[Microsoft] If -fms-compatibility, then downgrade missing typename error to warning at function prototype scope.
...
llvm-svn: 141630
2011-10-11 01:50:09 +00:00
Kaelyn Uhrain
85308c6ecd
Add typo correction for type names.
...
The main motivation was to do typo correction in C++ "new" statements,
though picking it up in other places where type names are expected was
pretty much a freebie.
llvm-svn: 141621
2011-10-11 01:02:41 +00:00
Lang Hames
4f4aa1a03a
Fixed natural stack alignment for Linux x86-32. Thanks Eli.
...
llvm-svn: 141617
2011-10-11 00:52:51 +00:00
Kaelyn Uhrain
8af2c9f5c6
Clean up DiagnoseInvalidRedeclaration a bit
...
llvm-svn: 141612
2011-10-11 00:28:52 +00:00
Kaelyn Uhrain
e1a9ff7934
Move a couple chunks of ActOnFunctionDeclarator to separate functions
...
llvm-svn: 141611
2011-10-11 00:28:49 +00:00
Kaelyn Uhrain
4dc695daea
Move some bool flags out of function parameter lists.
...
llvm-svn: 141610
2011-10-11 00:28:45 +00:00
Kaelyn Uhrain
0a32fcaf65
Only accept a typo correction if it doesn't trigger additional errors
...
llvm-svn: 141609
2011-10-11 00:28:39 +00:00
Eli Friedman
ce3e02a343
Extend lvalue evaluation in ExprConstant.cpp to handle CK_LValueBitCast (which is completely trivial). PR8836.
...
llvm-svn: 141604
2011-10-11 00:13:24 +00:00
Lang Hames
60b2b2ee0d
Update target data strings for ARM and X86 to include the natural stack
...
alignment parameter "S<size>" that was introduced in r141599.
llvm-svn: 141601
2011-10-10 23:44:43 +00:00
Douglas Gregor
2259d85a43
Don't crash in Sema::IsSimplyAccessible if the declaration is not a C++ class member. Fixes PR11108.
...
llvm-svn: 141600
2011-10-10 23:44:35 +00:00
Eli Friedman
192e034aab
A couple random preprocessor changes that got ported from C99 to C++11.
...
llvm-svn: 141596
2011-10-10 23:35:28 +00:00
Douglas Gregor
c7a3107baf
When performing a user-defined conversion via a constructor, be sure
...
to check whether the constructor is accessible. Fixes
<rdar://problem/10202900>.
llvm-svn: 141588
2011-10-10 22:41:00 +00:00
Ted Kremenek
8f34b6999c
[analyzer] Teach the static analyzer about CXXForRangeStmt. Patch by Jim Goodnow II!
...
llvm-svn: 141587
2011-10-10 22:36:31 +00:00
Ted Kremenek
bed648e0b0
Rework construction of CXXForRangeStmt not to recycle the same DeclRefExpr in multiple subexpressions. This breaks the tree structure
...
of the AST and completely breaks the CFG invariants.
Patch by Jim Goodnow II and reviewed by Richard Smith!
llvm-svn: 141586
2011-10-10 22:36:28 +00:00
Argyrios Kyrtzidis
ebf0136956
[libclang] Implement ConcurrencyCheck using a recursive mutex to allow re-entrancy in the same thread.
...
The checks are performed only in DEBUG, it becomes no-op in release mode.
llvm-svn: 141582
2011-10-10 21:57:12 +00:00
Fariborz Jahanian
55b4e5c208
objc: err on a property designated both atomic and
...
nonatomic. // rdar://10260017
llvm-svn: 141580
2011-10-10 21:53:24 +00:00
Francois Pichet
698f019efb
Revert r140009, about disabling clang's builtin in -fms-compatibility mode.
...
llvm-svn: 141577
2011-10-10 20:34:10 +00:00
Roman Divacky
3403a3b28f
Link in Scrt1.o instead of crt1.o when -pie is specified.
...
llvm-svn: 141573
2011-10-10 19:47:45 +00:00
Douglas Gregor
ab96bcf6ea
When substituting into a sizeof parameter pack expression in a context
...
where we can't expand (i.e., multi-level substitution), be sure to
substitute the pack with its level-reduced pack. Fixes PR10230.
llvm-svn: 141568
2011-10-10 18:59:29 +00:00
Bob Wilson
391214aa3a
Partially revert r141374: allow use of libc++ prior to Mac OS X 10.7.
...
Apple only supports libc++ on OS X 10.7 and later but for the open-source
compiler that restriction doesn't make sense.
llvm-svn: 141566
2011-10-10 18:46:10 +00:00
Chad Rosier
fd3c90c620
When an included non-system directory duplicates a system directory the clang
...
frontend removes the non-system directory to maintain gcc compatibility. When
this happens NumAngled needs to be updated.
PR11097
llvm-svn: 141565
2011-10-10 18:44:24 +00:00
Richard Smith
caf3390d44
Constant expression evaluation refactoring:
...
- Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions,
and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert
behaviour.
- Factor out evaluation of bitfield bit widths.
- Fix a few places which would evaluate an expression twice: once to determine
whether it is a constant expression, then again to get the value.
llvm-svn: 141561
2011-10-10 18:28:20 +00:00
Douglas Gregor
0de5720737
Don't suggest 'noreturn' for function template instantiations, because
...
it might be wrong for other instantiations of the same function
template. Fixes PR10801.
llvm-svn: 141559
2011-10-10 18:15:57 +00:00
Kaelyn Uhrain
1a6eb99d45
Give nicer note when a member redeclaration has or lacks 'const'
...
llvm-svn: 141555
2011-10-10 18:01:37 +00:00
Fariborz Jahanian
9a81f848c8
objc: Some refactoring of overriding method decl. code
...
for future work.
llvm-svn: 141553
2011-10-10 17:53:29 +00:00
Douglas Gregor
6e8da6a291
Don't analyze comparisons in type- or value-dependent
...
subexpressions. Fixes PR10291.
llvm-svn: 141552
2011-10-10 17:38:18 +00:00
Douglas Gregor
556e5860f9
Per C++ [class.bit]p2, unnamed bit-fields are not members. Fixes PR10289.
...
llvm-svn: 141549
2011-10-10 17:22:13 +00:00
Richard Smith
f368fb40df
constexpr: Disable checking of constructor member initializer lists for
...
constexpr constructor templates. Such checking is optional, and currently hard
to get right since clang doesn't generate implicit member initializers until
instantiation (even for non-dependent members).
This is needed for clang to accept libstdc++ from g++4.6 in c++0x mode.
llvm-svn: 141547
2011-10-10 16:38:04 +00:00
Douglas Gregor
bcc9539323
Don't complain about qualified property or ivar access when the
...
qualifier itself is invalid. Crasher noticed by Fariborz.
llvm-svn: 141544
2011-10-10 16:09:49 +00:00
Douglas Gregor
b06fa540e8
When adding a direct initializer to a declaration, allow the
...
initializer to update the type of the declaration. For example, this
allows us to determine the size of an incomplete array from its
initializer. Fixes PR10288.
llvm-svn: 141543
2011-10-10 16:05:18 +00:00
Douglas Gregor
728d00b8e7
Parse the initializer for a class member after handling its
...
declarator, so that the declarator is in scope for the
initializer. Fixes PR9989.
llvm-svn: 141539
2011-10-10 14:49:18 +00:00
Douglas Gregor
877d4ebba4
Always add the built-in overload candidates for operators &&, ||, and
...
!. Fixes PR9865.
llvm-svn: 141537
2011-10-10 14:05:31 +00:00
Benjamin Kramer
138ef9ca4a
Another case of HadMultipleCandidates being used uninitialized.
...
llvm-svn: 141532
2011-10-10 12:54:05 +00:00
Alexis Hunt
d6da876bac
Begin work consolidating ShouldDelete* functions.
...
Begin with just default constructors. One note is that as a side effect
of this, a conformance test was removed on the basis that this is almost
certainly a defect as with most of union initialization. As it is, clang
does not implement union initialization close to the standard as it's
quite broken as written. I hope to write a paper addressing the issues
eventually.
llvm-svn: 141528
2011-10-10 06:18:57 +00:00
Tobias Grosser
11ce922456
Parse LLVM command line arguments after plugins have been loaded
...
This fixes a crash due to command line options, that are not available
before the loading of plugins finished.
llvm-svn: 141525
2011-10-10 01:23:06 +00:00
Douglas Gregor
16e65616d6
Implement the restrictions in C++ [class.friend]p6, which disallow
...
defining a friend function with a qualified name or in a local
class. Fixes PR9853.
llvm-svn: 141524
2011-10-10 01:11:59 +00:00
Douglas Gregor
12340e5b18
Diagnose attempts to qualify the name of an instance variable or
...
property in an Objective-C++ member access expression. Fixes PR9759.
llvm-svn: 141522
2011-10-09 23:22:49 +00:00
Douglas Gregor
f7b98957ac
Push "out-of-line" declarations into scope when their lexical/semantic
...
redeclaration contexts are the same, as occurs within linkage
specifications. Fixes PR9162.
llvm-svn: 141521
2011-10-09 22:57:49 +00:00
Douglas Gregor
56636589ff
The effective context of a friend function is its lexical
...
context. Fixes PR9103.
llvm-svn: 141520
2011-10-09 22:38:36 +00:00
Douglas Gregor
f892c7fe60
For the various CF and NS attributes, don't complain if the parameter
...
or return types are dependent. Fixes PR9049.
llvm-svn: 141518
2011-10-09 22:26:49 +00:00
Douglas Gregor
0c83c8128b
Per the note in C++0x [temp.deduct.call]p4, don't attempt template
...
argument deduction against a function parameter that has no deducible
template parameters in it. Fixes PR8598.
llvm-svn: 141517
2011-10-09 22:06:46 +00:00
Peter Collingbourne
1deb5b61f4
OpenCL: add driver/frontend support for precompiled headers
...
llvm-svn: 141516
2011-10-09 22:03:19 +00:00
Douglas Gregor
e9d075e434
A friend template specialization is also dependent if any of its
...
template arguments are dependent. Fixes PR10913.
llvm-svn: 141515
2011-10-09 20:59:17 +00:00
Douglas Gregor
668d362503
Only allow taking the address of an expression of type 'overloaded
...
function type' when that expression is actually an overloaded function
reference (and not the address of an overloaded function
reference). Fixes PR11066.
llvm-svn: 141514
2011-10-09 19:10:41 +00:00
Douglas Gregor
bb64afcc39
Diagnose attempts to declare a non-static data member with a
...
non-identifier name. Fixes PR10839.
llvm-svn: 141513
2011-10-09 18:55:59 +00:00
Douglas Gregor
c4475e8cd6
When building source location information for an _Atomic type, be sure
...
to fill in the source locations for the underlying value type. Fixes
an intermittent crasher (due to uninitialized data) in the PCH test
for _Atomic types.
llvm-svn: 141512
2011-10-09 18:45:17 +00:00
Douglas Gregor
4d328b6e16
After instantiating a 'noexcept' expression, be sure to convert it to
...
a boolean value and check that it is a constant expression. Fixes
PR11084.
llvm-svn: 141511
2011-10-09 18:31:23 +00:00
Benjamin Kramer
ec44099cf8
Initialize the HadMultipleCandidates flag.
...
Found by valgrind.
llvm-svn: 141510
2011-10-09 17:58:25 +00:00
Fariborz Jahanian
9059124b41
objc: Do not warn about mismatch on Super's readonly property attribute,
...
related to a readwrite property, and
Sub's readwrite property. // rdar://9396329
llvm-svn: 141497
2011-10-08 17:45:33 +00:00
Benjamin Kramer
ec173a5c92
Silence a warning about casting away constness.
...
llvm-svn: 141496
2011-10-08 16:15:07 +00:00
NAKAMURA Takumi
0010bd96c9
lib/Frontend/CompilerInstance.cpp: Suppress a "Comparision of unsigned and signed" warning on Cygwin gcc-4.3.4.
...
llvm-svn: 141488
2011-10-08 11:31:58 +00:00
NAKAMURA Takumi
93eafc6ce1
Fix "Uninitialized" warnings.
...
llvm-svn: 141487
2011-10-08 11:31:53 +00:00
NAKAMURA Takumi
82a351197f
Whitespace
...
llvm-svn: 141486
2011-10-08 11:31:46 +00:00
David Chisnall
e0dc7cb2e2
Apparently getPtrToInt() takes an explicit type parameter to allow you to generate invalid bitcode, not so that it can actually produce a value of this type. This should fix PR11085.
...
llvm-svn: 141482
2011-10-08 08:54:36 +00:00
Ted Kremenek
c168e50722
Free 'TheTargetCodeGenInfo' in the class CodeGenModule. This looks like an obvious memory leak that was reported from LLDB devs. The comment indicates the leak is deliberate, but I have no idea why this needs to be so. Please comment/revert if you know otherwise.
...
llvm-svn: 141479
2011-10-08 05:28:26 +00:00
Eli Friedman
235266700a
Fix warning on MSVC. Patch by Aaron Ballman.
...
llvm-svn: 141467
2011-10-08 01:03:47 +00:00
Argyrios Kyrtzidis
741fab1358
[arcmt] Ignore linking errors when doing ARC migration, rdar://10247606
...
llvm-svn: 141434
2011-10-07 22:58:08 +00:00
Ted Kremenek
d79719b144
Provide basic static analyzer support for CXXTemporaryObjectExpr. Patch by Jim Goodnow II.
...
llvm-svn: 141433
2011-10-07 22:48:13 +00:00
Ted Kremenek
dccc2b2277
Remove AnalysisContext::getLiveVariables(), and introduce a templatized mechanism to lazily create analyses that are attached to AnalysisContext objects.
...
llvm-svn: 141425
2011-10-07 22:21:02 +00:00
Argyrios Kyrtzidis
094da739e0
In DeclContext::LoadLexicalDeclsFromExternalStorage don't clear out
...
the fields if they are already loaded, just ignore them when we are building
the chain in BuildDeclChain.
This fixes an lldb issue where fields were removed and not getting re-added
because lldb is based on ASTImporter adding decls to DeclContext and fields
were already added before by the ASTImporter.
We should really simplify the interaction between DeclContext <-> lldb
going forward..
rdar://10246067
llvm-svn: 141418
2011-10-07 21:55:43 +00:00
Anna Zaks
754eafb765
[analyzer] Previously, we were passing to CheckerContext enough info to construct ProgramPoint and it would pass it to NodeBuilder, which in turn would construct the ProgramPoint. Simplify it by just passing the ProgramPoint to CheckerContext. The ProgramPoint can only change if a checker tags it, in which case, we create a copy with the given tag.
...
(A step closer to making CheckerContext work with all node builders, not only StmtNodeBuilder.)
llvm-svn: 141417
2011-10-07 21:52:33 +00:00
Fariborz Jahanian
13d3f86577
objc++: some minor cleanup and a test case
...
for atomic setters which requires assignment operator.
llvm-svn: 141415
2011-10-07 21:08:14 +00:00
Anna Zaks
8de8cfdd21
ProgramPoint cleanup after the previous commit r141408 (remove the copy constructor, mark withTag const).
...
Move getProgramPoint() utility from CoreEngine.cpp into ProgramPoint.
llvm-svn: 141414
2011-10-07 21:01:38 +00:00
Douglas Gregor
6f981006f6
Add braces around do-while body. The lack of them gives me the chills
...
llvm-svn: 141411
2011-10-07 20:35:25 +00:00
Eli Friedman
1f19100451
Add address spaces for TCE target. Patch by Pekka Jääskeläinen.
...
llvm-svn: 141390
2011-10-07 19:51:42 +00:00