Douglas Gregor
996a735b88
We need a longer long when testing this pathe Microsoft fixed-underlying-type extension for enumeration types
...
llvm-svn: 126250
2011-02-22 21:42:31 +00:00
Devang Patel
b6ed369e77
A constructor call should force class's debug info even if -flimit-debug-info is enabled.
...
llvm-svn: 126246
2011-02-22 20:55:26 +00:00
Chris Lattner
ba9006df9e
improve support for SUSE Linux Enterprise Server 11 SP1 (x86_64).
...
Patch by Csaba Raduly!
llvm-svn: 126245
2011-02-22 20:47:07 +00:00
Douglas Gregor
a1aec29a2d
Enable enumeration types with a fixed underlying type, e.g.,
...
enum X : long { Value = 0x100000000 };
when in Microsoft-extension mode (-fms-extensions). This (now C++0x)
feature has been supported since Microsoft Visual Studio .NET 2003.
llvm-svn: 126243
2011-02-22 20:32:04 +00:00
Matt Beaumont-Gay
7a24210ebd
Use an unused-except-in-Debug variable.
...
llvm-svn: 126240
2011-02-22 20:00:16 +00:00
Devang Patel
d7185b755d
Use LLVM coding standard.
...
llvm-svn: 126232
2011-02-22 18:56:36 +00:00
Douglas Gregor
e2f943b5cb
Implement the GNU C extension which permits the initialization of an
...
array from a constant array compound literal. Fixes PR9261.
llvm-svn: 126230
2011-02-22 18:29:51 +00:00
Argyrios Kyrtzidis
ed35cf271d
[analyzer] Start moving the path-sensitive checkers to CheckerV2.
...
-Migrate ObjCSelfInitChecker to CheckerV2. In the process remove the 'preCallSelfFlags' field
from the checker class and use GRState for storing that info.
-Get ExprEngine to start delegating checker running to CheckerManager.
llvm-svn: 126229
2011-02-22 17:30:38 +00:00
Argyrios Kyrtzidis
98e35dda03
[analyzer] Separate CheckerContext into its own include file. No functionality change.
...
llvm-svn: 126228
2011-02-22 17:30:32 +00:00
Argyrios Kyrtzidis
b9eae65c63
[analyzer] Fix GRStatePartialTrait<bool> and introduce GRStatePartialTrait<unsigned>.
...
llvm-svn: 126227
2011-02-22 17:30:28 +00:00
Joerg Sonnenberger
fe74286a48
Remove the storage for -cxx-system-include. Make libcxx toolchain
...
use -nostdinc++ and -cxx-isystem.
llvm-svn: 126223
2011-02-22 15:19:35 +00:00
Peter Collingbourne
f29ce975ba
Reimplement __pragma support using a TokenLexer
...
llvm-svn: 126221
2011-02-22 13:49:06 +00:00
Peter Collingbourne
2c9f966600
Make TokenLexer capable of storing preprocessor directive tokens
...
llvm-svn: 126220
2011-02-22 13:49:00 +00:00
Oscar Fuentes
e16dc2a6e7
CMAKE_EXECUTABLE_SUFFIX is undefined when a cmake script is executed
...
with cmake -P ... so we need to deduce the correct executable prefix.
Fixes PR9286.
llvm-svn: 126219
2011-02-22 13:05:15 +00:00
John McCall
9e2e22f5c6
Establish the iteration variable of an ObjC for-in loop before
...
emitting the collection expression. Fixes some really, really broken
code.
llvm-svn: 126193
2011-02-22 07:16:58 +00:00
John McCall
c533cb7008
Reorganize the emission of local variables.
...
llvm-svn: 126189
2011-02-22 06:44:22 +00:00
Ted Kremenek
fb1a79af7a
Add CStringChecker support for strncpy. Patch by Lenny Maiorani!
...
llvm-svn: 126188
2011-02-22 04:58:34 +00:00
Ted Kremenek
280a01fa1b
Add CStringChecker support for strnlen. Patch by Lenny Maiorani!
...
llvm-svn: 126187
2011-02-22 04:55:05 +00:00
NAKAMURA Takumi
f8a6e802f9
lib/CodeGen/TargetInfo.cpp: On Win64, arg i128 should be emitted as INDIRECT.
...
mingw-w64's i128 tweak should be done with x86_64-mingw32.
llvm-svn: 126186
2011-02-22 03:56:57 +00:00
Douglas Gregor
6cd5ae4dfa
Fix a little bug in the handling of enumeration types with a fixed
...
underlying type: we weren't parsing unnamed enumeration types with a
fixed underlying type.
llvm-svn: 126184
2011-02-22 02:55:24 +00:00
Douglas Gregor
a78f193e7e
Warn about implicit conversions between values of different, named
...
enumeration types. Fixes <rdar://problem/8559831>.
llvm-svn: 126183
2011-02-22 02:45:07 +00:00
Anders Carlsson
3320e1575f
Make clang -cc1 disable Objective-C exceptions by default, and add a -fobjc-exceptions flag to turn them on.
...
Update all tests accordingly.
llvm-svn: 126177
2011-02-22 01:52:06 +00:00
Anders Carlsson
4fc229ef69
Move some Objective-C tests to SemaObjC and CodeGenObjC.
...
llvm-svn: 126175
2011-02-22 01:23:29 +00:00
Richard Smith
23eb9f707b
In Objective-C, there are no trailing return types, so don't produce diagnostics suggesting they are missing.
...
llvm-svn: 126174
2011-02-22 01:22:29 +00:00
Joerg Sonnenberger
cc9c8eb837
Bug#8945: Add -cxx-isystem option to specify C++ system directories.
...
It works like -isystem and the search path keeps -isystem and
-cxx-isystem in order relative to each other. -cxx-isystem is only used
for C++ sources though. Drop the existing -cxx-system-include option for
cc1 as it is now redundant.
llvm-svn: 126167
2011-02-22 00:40:56 +00:00
Richard Smith
59006e4338
Fix a few auto-related issues:
...
* 'auto' was being rejected on abstract-declarators with trailing return
types and on typedefs with trailing return types. 'auto' is always
allowed in these cases. This was found while testing the fix for PR 9278.
* A very poor diagnostic was being issued for auto (f() -> int): "return
type must be 'auto', not 'auto'". This is closely related to PR 9060.
* Trailing return type handling was happening slightly too late,
resulting in the checks for functions returning arrays and functions
returning functions being missed.
llvm-svn: 126166
2011-02-22 00:36:53 +00:00
Richard Smith
e51cb7dedf
Add reference to PR 9278 for archaeologists.
...
llvm-svn: 126164
2011-02-22 00:19:36 +00:00
Fariborz Jahanian
d7b0cb5388
Warn when type modifiers on objc method declarations in
...
protocols do not match with method implementation.
// rdar://7076235
llvm-svn: 126162
2011-02-21 23:49:15 +00:00
David Chisnall
055f064756
The instance size of a metaclass should be the size of a class. This is not, in fact, 0, even for very small classes. (GNU runtime)
...
llvm-svn: 126161
2011-02-21 23:47:40 +00:00
Richard Smith
27e39b11b1
C++0x's deduced auto is illegal in typedefs.
...
This actually rules out too much, since it also catches typedefs for pointers to functions with trailing return types:
typedef auto (*F)() -> int;
Fix for that (and the same issue in all abstract-declarators) to follow shortly.
llvm-svn: 126153
2011-02-21 23:18:00 +00:00
Daniel Dunbar
13adc7fefd
Targets/Darwin: mcount name on Darwin needs to be unmangled.
...
llvm-svn: 126152
2011-02-21 23:12:51 +00:00
Ted Kremenek
828f631af1
Fix a CFGBuilder bug exposed on convoluted control-flow in the Linux kernel.
...
llvm-svn: 126149
2011-02-21 22:11:26 +00:00
Chris Lattner
93ede02045
add one more case of mismatched input/output constraints.
...
When the mismatch is due to a larger input operand that is
a constant, truncate it down to the size of the output. This
allows us to accept some cases in the linux kernel and elsewhere.
Pedantically speaking, we generate different code than GCC, though
I can't imagine how it would matter:
Clang:
movb $-1, %al
frob %al
GCC:
movl $255, %eax
frob %al
llvm-svn: 126148
2011-02-21 22:09:29 +00:00
Chris Lattner
e3694b166a
more code restructuring, no functionality change.
...
llvm-svn: 126146
2011-02-21 21:50:25 +00:00
Chris Lattner
70a4e9b5e2
split the iteration loop out to a helper function, no functionality change.
...
llvm-svn: 126145
2011-02-21 21:40:33 +00:00
Chris Lattner
169766f306
fix a comment.
...
llvm-svn: 126143
2011-02-21 21:15:10 +00:00
Stuart Hastings
b6a4d3ebd2
Test case for r126127 and r126141. Radar 9012638.
...
llvm-svn: 126142
2011-02-21 21:08:21 +00:00
Richard Smith
5503805555
Mangling of undeduced 'auto' types, as specified by Itanium C++ ABI.
...
llvm-svn: 126140
2011-02-21 20:10:02 +00:00
Richard Smith
b2bc2e6752
Tweaks to C++0x deduced auto type support:
...
* Flag indicating 'we're parsing this auto typed variable's initializer' moved from VarDecl to Sema
* Temporary template parameter list for auto deduction is now allocated on the stack.
* Deduced 'auto' types are now uniqued.
llvm-svn: 126139
2011-02-21 20:05:19 +00:00
Ted Kremenek
bda17491c4
Fix call to send_error() in scan-view. An int error code is expected but a string was being sent. Patch by Andrew Price!
...
llvm-svn: 126138
2011-02-21 19:26:48 +00:00
John McCall
15dd404c46
Don't warn about static const integral data members with in-line constant
...
initializers just because they don't have a proper out-of-line definition.
Such code is technically ill-formed but is too common and too unlikely to be
a problem to be seriously worth worrying about.
llvm-svn: 126137
2011-02-21 19:25:48 +00:00
Fariborz Jahanian
786e04cda5
Turn on 'auto' in plain objc mode.
...
llvm-svn: 126134
2011-02-21 18:37:13 +00:00
Chris Lattner
d0257f79bc
Pass the right linker flag in openbsd::Link::ConstructJob,
...
patch by Matthew Dempsky!
llvm-svn: 126133
2011-02-21 18:36:51 +00:00
Fariborz Jahanian
f5bfc46c95
Remove warning on future change in ivar lookup rule
...
when doing the property default synthesis.
// rdar://9027673.
llvm-svn: 126128
2011-02-21 17:31:28 +00:00
John McCall
5decec97e5
Reorganize subelement initialization checking, no functionality change.
...
llvm-svn: 126116
2011-02-21 07:57:55 +00:00
John McCall
66884dd93c
Small optimization: avoid redundant checks of whether a type is an array
...
when checking an initialization.
llvm-svn: 126115
2011-02-21 07:22:22 +00:00
John McCall
701417a0ac
Pseudo-revirtualize CallExpr::getSourceRange by making it follow the
...
logic from CXXMemberCallExpr and by making it check for
CXXOperatorCallExpr in order to defer. This is not really an awesome solution,
but I don't have a better idea.
llvm-svn: 126114
2011-02-21 06:23:05 +00:00
John McCall
e9dab636df
Bind references to opaque r-values correctly. Add a few test cases
...
for ?: on record types.
llvm-svn: 126113
2011-02-21 05:25:38 +00:00
NAKAMURA Takumi
19c9fb6cbc
CMake: Eliminate duplicate -D__STDC_LIMIT_MACROS and -D__STDC_CONSTANT_MACROS. llvm/cmake/modules/HandleLLVMOptions.cmake defines them.
...
llvm-svn: 126105
2011-02-21 03:19:49 +00:00
John McCall
f2e9110a9f
Rename test/CodeGenCXX/gnu-conditional-scalar-ext.cpp to conditional-gnu-ext.cpp
...
for consistency with other tests (and to remove "scalar" from the name).
llvm-svn: 126104
2011-02-21 02:28:50 +00:00
Chandler Carruth
d05b352b0e
Clean up the tests for warning about unused function results given the
...
appropriate attribute. Add a bit more testing that finds a pretty bad
regression (since ~forever) in this warning. Fix it with a nice 2 line
change. =]
llvm-svn: 126098
2011-02-21 00:56:56 +00:00
Chandler Carruth
468b5cbd40
Allow -Wformat to be enabled without -Wformat-security. GCC gates
...
-Wformat-security on -Wformat, not vice-versa.
Fixes PR8486. Patch by Oleg Slezberg.
llvm-svn: 126096
2011-02-21 00:07:51 +00:00
Oscar Fuentes
15fe190027
Put targets on folders, if the IDE supports the feature.
...
Requires CMake 2.8.3 or newer.
llvm-svn: 126094
2011-02-20 22:06:44 +00:00
Oscar Fuentes
6f72540e46
New function for tablegenning: clang_tablegen.
...
llvm-svn: 126093
2011-02-20 22:06:32 +00:00
Oscar Fuentes
e9c7994669
Correct name of dependent target.
...
CMake complained about this while generating VS project files but was
okay with it while generating makefiles on Linux.
llvm-svn: 126090
2011-02-20 19:41:34 +00:00
Daniel Dunbar
bd466d404a
tests: Fix test on Win32.
...
llvm-svn: 126087
2011-02-20 17:41:24 +00:00
Benjamin Kramer
ae1e5c250c
Remove unused function.
...
llvm-svn: 126084
2011-02-20 16:04:14 +00:00
Richard Smith
7ee0d5664e
Turn on __has_feature(cxx_auto_type). The feature is now fully implemented.
...
llvm-svn: 126078
2011-02-20 12:13:05 +00:00
Daniel Dunbar
67e556249c
Remove a dead variable.
...
llvm-svn: 126073
2011-02-20 06:15:13 +00:00
Richard Smith
30482bc786
Implement the C++0x deduced 'auto' feature.
...
This fixes PR 8738, 9060 and 9132.
llvm-svn: 126069
2011-02-20 03:19:35 +00:00
Ken Dyck
6d90e8937c
Expand use of CharUnits in LayoutField(). No change in functionality
...
intended.
llvm-svn: 126066
2011-02-20 02:06:09 +00:00
Ken Dyck
d24099de04
Add const qualifier to getTypeInfoInChars().
...
llvm-svn: 126064
2011-02-20 01:55:18 +00:00
Richard Smith
1daeacbda8
Test commit.
...
llvm-svn: 126063
2011-02-20 00:59:54 +00:00
Anders Carlsson
08ce5ed1b1
Add a LangOptions::areExceptionsEnabled and start using it.
...
llvm-svn: 126062
2011-02-20 00:20:27 +00:00
Anders Carlsson
ce8dd3a5d4
Add a new ObjCExceptions member variable to LangOptions. This controls whether Objective-C exceptions are enabled or not (they are by default).
...
llvm-svn: 126061
2011-02-19 23:53:54 +00:00
Peter Collingbourne
8f5cf74c77
Re-instate r125819 and r125820 with no functionality change
...
llvm-svn: 126060
2011-02-19 23:03:58 +00:00
Chris Lattner
29eb47bd68
Fix PR9253, allowing attribute(aligned) to reduce the alignment of
...
a typedef.
llvm-svn: 126059
2011-02-19 22:55:41 +00:00
Douglas Gregor
5b05454f24
Don't produce "comparison is always (true|false)" warnings when the
...
comparison itself is a constant expression. Fixes PR7536.
llvm-svn: 126057
2011-02-19 22:34:59 +00:00
Chris Lattner
b0ed51da10
implement a tiny amount of codegen support for gnu array range
...
designators: allowing codegen when the element initializer is a
constant or something else without a side effect. This unblocks
enough to let process.c in the linux kernel build, PR9257.
llvm-svn: 126056
2011-02-19 22:28:58 +00:00
Douglas Gregor
d66828daf6
In addition to in-class member functions marked with the "used"
...
attribute, we also care about those with the "constructor"
attribute. Fixes PR6521.
llvm-svn: 126055
2011-02-19 21:54:50 +00:00
Anders Carlsson
b94ad3ec22
There's no need to return early if we encounter a try/throw and exceptions are disabled.
...
llvm-svn: 126053
2011-02-19 21:53:09 +00:00
Rafael Espindola
a6d2bff0c5
Revert 125820 and 125819 to fix PR9266.
...
llvm-svn: 126050
2011-02-19 21:39:31 +00:00
Oscar Fuentes
f7fa56f25f
Fix some add_dependencies.
...
The syntax is (add_dependencies target-name depend-target1 ...).
llvm-svn: 126049
2011-02-19 21:38:48 +00:00
Douglas Gregor
b491ed36b4
Handle the resolution of a reference to a function template (which
...
includes explicitly-specified template arguments) to a function
template specialization in cases where no deduction is performed or
deduction fails. Patch by Faisal Vali, fixes PR7505!
llvm-svn: 126048
2011-02-19 21:32:49 +00:00
Peter Collingbourne
5de2850efb
Reimplement Token::isAnnotation() using TokenKinds.def. No functionality change.
...
llvm-svn: 126045
2011-02-19 20:06:59 +00:00
Anders Carlsson
68b36aff46
Disallow try/catch/throw when exceptions are disabled.
...
llvm-svn: 126039
2011-02-19 19:26:44 +00:00
Douglas Gregor
bf2b26d805
The member classes of a current instantiation aren't necessarily a
...
current instantiation, even though we have a RecordDecl describing
them. Fixes PR9255.
Amusingly, I've had this patch sitting around for a month or two
because it was "obviously" wrong, but hadn't gotten around to writing
a test case to submit the fix :)
llvm-svn: 126038
2011-02-19 19:24:40 +00:00
Anders Carlsson
479d6f51e3
Pass -fexceptions to all tests that use try/catch/throw.
...
llvm-svn: 126037
2011-02-19 19:23:03 +00:00
Douglas Gregor
0cf82f6ad0
Teach the virtual-functions-without-virtual-destructor warning to only
...
warn about polymorphic classes (which have virtual functions) rather
than dynamic classes (which are polymorphic or have virtual bases).
llvm-svn: 126036
2011-02-19 19:14:36 +00:00
Douglas Gregor
f05c0958e2
Remove the Fix-It for "main must return 'int'", which is not always
...
correct and is not worth fixing. Fixes PR8396.
llvm-svn: 126035
2011-02-19 19:04:23 +00:00
Ken Dyck
85ef0431a7
Expand use of CharUnits for alignments further. No change in functionality
...
intended.
llvm-svn: 126034
2011-02-19 18:58:07 +00:00
Douglas Gregor
b11aad8cba
Revert all of my commits that devirtualized the Decl hierarchy, which
...
lead to a serious slowdown (4%) on parsing of Cocoa.h. This memory
optimization should be revisited later, when we have time to look at
the generated code.
llvm-svn: 126033
2011-02-19 18:51:44 +00:00
Jeffrey Yasskin
39a5820059
Use PARSE_ARGUMENTS to clean up add_clang_unittest's calling convention.
...
It would be nice to propagate this into the other functions to replace
LLVM_LINK_COMPONENTS and friends, but I don't plan to do that.
llvm-svn: 126032
2011-02-19 18:06:01 +00:00
Argyrios Kyrtzidis
3b1b3fe039
[analyzer] '-analyzer-check-objc-mem' can go through the llvm/clang codebase without crashing; enable it for C++.
...
llvm-svn: 126026
2011-02-19 08:03:21 +00:00
Argyrios Kyrtzidis
eb8357c1d8
[analyzer] Fix crash when analyzing C++ code.
...
llvm-svn: 126025
2011-02-19 08:03:18 +00:00
Jeffrey Yasskin
ecdd68d760
Remove support and mc from the clang unittests' dependencies because they're not
...
needed or provided by the libraries under test.
The next step is to import http://www.itk.org/Wiki/CMakeMacroParseArguments to
make the empty string parameter unnecessary.
llvm-svn: 126024
2011-02-19 06:07:17 +00:00
Daniel Dunbar
1094bb101b
Driver/Darwin: Support -Wl, with -Xarch_. This doesn't work naturally because of
...
the special way we model "linker input" arguments.
llvm-svn: 126023
2011-02-19 05:33:51 +00:00
Argyrios Kyrtzidis
12f146a3ef
Use PointerUnion::getAddrOf instead of messing with PointerUnion & reinterpret_cast.
...
llvm-svn: 126021
2011-02-19 04:02:34 +00:00
Ted Kremenek
ff6fd0f4b0
Change 'StoreRef' back to 'Store' in GRState, shrinking the size of GRState back by one pointer.
...
llvm-svn: 126020
2011-02-19 03:56:19 +00:00
John McCall
68cc3350a8
Fix a -Wuninitialized warning; it's actually a false positive,
...
but it's not reasonable for the diagnostic to figure that out.
Pointed out by Benjamin Kramer.
Also clarify the logic here.
llvm-svn: 126017
2011-02-19 03:13:26 +00:00
John McCall
8377967543
Warn about code that uses variables and functions with internal linkage
...
without defining them. This should be an error, but I'm paranoid about
"uses" that end up not actually requiring a definition. I'll revisit later.
Also, teach IR generation to not set internal linkage on variable
declarations, just for safety's sake. Doing so produces an invalid module
if the variable is not ultimately defined.
Also, fix several places in the test suite where we were using internal
functions without definitions.
llvm-svn: 126016
2011-02-19 02:53:41 +00:00
Argyrios Kyrtzidis
21f347e729
[analyzer] Fix crash when analyzing C++ code.
...
llvm-svn: 126013
2011-02-19 01:59:41 +00:00
Ted Kremenek
fda3687515
Add 'StoreRef' smart pointer to allow more fine-grain memory lifetime control of Store objects.
...
This yields a minor memory reduction (for larger functions) on Sqlite at the cost of slightly
higher memory usage on some functions because of the increased size of GRState (which can be optimized).
I expect the real memory savings from this enhancement will come when we aggressively
canabilize more of the ExplodedGraph.
llvm-svn: 126012
2011-02-19 01:59:33 +00:00
Argyrios Kyrtzidis
e34245b30b
[analyzer] Fix crash when analyzing C++ code.
...
llvm-svn: 126007
2011-02-19 01:08:41 +00:00
Argyrios Kyrtzidis
1227f3afca
[analyzer] Disable a test until inlining CXXConstructExprs is fully investigated.
...
llvm-svn: 126006
2011-02-19 01:08:37 +00:00
Chandler Carruth
4c4f8de421
Improve bool and char integral template argument printing in
...
diagnostics, resolving PR9227.
Patch originally by Mihai Rusu and Stephen Hines with some minimal style
tweaks from me.
llvm-svn: 125999
2011-02-19 00:21:00 +00:00
Chandler Carruth
9c9127eace
Fix a missed case in the NULL operand to conditional operator
...
diagnostics.
Patch by Stephen Hines.
llvm-svn: 125998
2011-02-19 00:13:59 +00:00
Chandler Carruth
fc1ad1f371
Update the test error messages to match the update I made to the actual
...
messages.
llvm-svn: 125997
2011-02-19 00:12:23 +00:00
Chandler Carruth
98e3c568bf
Fix PR8767, improve diagnostic wording when allocating an object of an
...
abstract class type.
Patch by Stephen Hines, with a wording tweak from Doug applied by me.
llvm-svn: 125996
2011-02-18 23:59:51 +00:00
Chandler Carruth
a8bea4b90e
Initial steps to improve diagnostics when there is a NULL and
...
a non-pointer on the two sides of a conditional expression.
Patch by Stephen Hines and Mihai Rusu.
llvm-svn: 125995
2011-02-18 23:54:50 +00:00
Chandler Carruth
241b31378d
Check for NULL child expressions before visiting them, as the first
...
thing the visit does is dyn_cast<>, which leads to a nasty segfault.
llvm-svn: 125993
2011-02-18 23:42:00 +00:00
Douglas Gregor
3a69eafa88
When code-completing a case statement for a switch on a value of
...
enumeration type, prioritize the enumeration constants and don't
provide completions for any other expressions. Fixes <rdar://problem/7283668>.
llvm-svn: 125991
2011-02-18 23:30:37 +00:00
Devang Patel
2d6390d47b
Start using enums from DIBuilder.
...
llvm-svn: 125990
2011-02-18 23:29:22 +00:00
Daniel Dunbar
5423b497ab
More correct fix for CMake breakage I was seeing, my buildbots use
...
LLVM_INCLUDE_TESTS:=OFF, which may no longer be necessary for all I know.
llvm-svn: 125985
2011-02-18 22:55:32 +00:00
Ted Kremenek
dcc45f6ec1
Update text for where to file analyzer bugs.
...
llvm-svn: 125983
2011-02-18 22:42:04 +00:00
Fariborz Jahanian
0dcb2a0d99
Test case for // rdar://8850818
...
llvm-svn: 125982
2011-02-18 22:37:54 +00:00
Chris Lattner
fa222dfbed
If -fno-builtin is passed, tell TargetLibraryInfo to
...
turn off all builtin optimizations.
llvm-svn: 125979
2011-02-18 22:34:47 +00:00
Douglas Gregor
af2a6ae429
Selector::getIdentifierInfoForSlot() can return NULL values, a fact
...
that was ignored in a few places (most notably, code
completion). Introduce Selector::getNameForSlot() for the common case
where we only care about the name. Audit all uses of
getIdentifierInfoForSlot(), switching many over to getNameForSlot(),
fixing a few crashers.
Fixed <rdar://problem/8939352>, a code-completion crasher.
llvm-svn: 125977
2011-02-18 22:29:55 +00:00
Daniel Dunbar
7ba92d716a
Unbreak CMake build on MSVC9, chapuni please check.
...
Without this I get:
--
-- Generating done
CMake Error: Unknown Target referenced : check.deps
CMake Error: Target: check-all depends on unknown target: check.deps
--
llvm-svn: 125976
2011-02-18 22:24:23 +00:00
Chris Lattner
d98cec5ca2
install a TargetLibraryInfo configured with the appropriate
...
target triple. This would be a decent place to add -fno-builtin
info for example.
llvm-svn: 125971
2011-02-18 22:20:38 +00:00
Argyrios Kyrtzidis
ec016464ca
[analyzer] Fix crash when analyzing C++ code.
...
llvm-svn: 125963
2011-02-18 21:24:56 +00:00
Chris Lattner
9ba479bd2c
fix rdar://9024687, a crash on invalid that we used to silently ignore.
...
llvm-svn: 125962
2011-02-18 21:16:39 +00:00
Argyrios Kyrtzidis
32d1040519
[analyzer] Fix a crash when analyzing C++ code.
...
llvm-svn: 125958
2011-02-18 20:55:19 +00:00
Argyrios Kyrtzidis
1bdd68871e
Introduce ASTContext::getLogicalOperationType() to return bool or int, depending on language.
...
No functionality change.
llvm-svn: 125957
2011-02-18 20:55:15 +00:00
Fariborz Jahanian
302a3d4e4d
Objective-c armv7 API for atomic properties of
...
scalar types. // rdar://7761305
llvm-svn: 125946
2011-02-18 19:15:13 +00:00
Chris Lattner
0ddd0ae50e
accept and ignore a few things for better OpenBSD compatibility,
...
patch by Amit Kulkarni!
llvm-svn: 125944
2011-02-18 17:05:55 +00:00
NAKAMURA Takumi
dba4ed3502
[Heikki Kultala] This patch contains the ABI changes for the TCE target.
...
TCE target has some too strict alignment rules (that the HW really does not require, but which caused problems elsewhere) for data types and an ABI change was decided.
llvm-svn: 125833
2011-02-18 08:44:38 +00:00
Chris Lattner
c4ef61af9a
we now support __label__
...
llvm-svn: 125826
2011-02-18 04:12:08 +00:00
Douglas Gregor
b327eac117
Implement C++0x [expr.static.cast]p9, which permits explicitly casting
...
a scoped enumeration type to an integral or floating type,
properly. There was an over-eager assertion, and it was missing the
floating-point case.
Fixes PR9107/<rdar://problem/8937402>.
llvm-svn: 125825
2011-02-18 03:01:41 +00:00
John McCall
a9a2e8a58d
The flags we're supposed to write into a byref struct are *not* the
...
_Block_object_* flags; it's just BLOCK_HAS_COPY_DISPOSE or not.
Also, we don't need to chase forwarding pointers prior to calling
_Block_object_dispose; _Block_object_dispose in fact already does
this.
rdar://problem/9006315
llvm-svn: 125823
2011-02-18 02:58:31 +00:00
Douglas Gregor
e10f36db2f
When building a qualified reference to a member of an anonymous struct
...
or union, place the qualifier on the outermost member reference
expression, which actually contains the entity name.
Fixes PR9188/<rdar://problem/8990184>.
llvm-svn: 125822
2011-02-18 02:44:58 +00:00
Ted Kremenek
a7ced2cb4c
Fix assertion failure on -Warray-bounds for 32-bit builds of Clang.
...
llvm-svn: 125821
2011-02-18 02:27:00 +00:00
Peter Collingbourne
14a552b2d7
Move CompilerInstance::LLVMContext and LLVMContext ownership to CodeGenAction
...
This removes the final dependency edge from any lib outside of CodeGen
to core. As a result we can, and do, trim the dependency on core
from libclang, PrintFunctionNames, the unit tests and c-index-test.
While at it, review and trim other unneeded dependencies.
llvm-svn: 125820
2011-02-18 02:25:12 +00:00
Peter Collingbourne
3ae6caaf1b
Move TargetInfo::adjustInlineAsmType to TargetCodeGenInfo
...
llvm-svn: 125819
2011-02-18 02:24:56 +00:00
Douglas Gregor
9543c40df1
When we're creating an expression for an integral template argument of
...
enumeration type, we were generating an integer literal implicitly
casted to the appropriate enumeration type. However, later checks on
that expression would strip the implicit cast.
This commit tweaks the lame hack, by creating an explicit cast instead
of an implicit cast. The right answer is to introduce a
SubstNonTypeTemplateParmExpr expression that acts like the substituted
result. I'll investigate that soon.
llvm-svn: 125818
2011-02-18 02:12:44 +00:00
Chris Lattner
43e7f31f11
implement basic support for __label__. I wouldn't be shocked if there are
...
bugs from other clients that don't expect to see a LabelDecl in a DeclStmt,
but if so they should be easy to fix.
This implements most of PR3429 and rdar://8287027
llvm-svn: 125817
2011-02-18 02:08:43 +00:00
Chris Lattner
4ba77fa976
rename test
...
llvm-svn: 125816
2011-02-18 02:05:32 +00:00
Argyrios Kyrtzidis
951e22e2c9
Handle UsingDecl in CFGRecStmtDeclVisitor.
...
llvm-svn: 125814
2011-02-18 01:44:17 +00:00
Chris Lattner
ebb5c6c717
Switch labels over to using normal name lookup, instead of their
...
own weird little DenseMap. Hey look, we now emit unused label
warnings deterministically, amazing.
llvm-svn: 125813
2011-02-18 01:27:55 +00:00
Francois Pichet
f9e7f09c84
Unbreak the MSVC build
...
std::make_pair is unreliable under MSVC 2010.
Ref: http://stackoverflow.com/questions/2691680/why-does-visual-studio-2010-throw-this-error-with-boost-1-42-0
llvm-svn: 125811
2011-02-18 01:25:16 +00:00
Chris Lattner
0f79084117
break testcase over multiple lines to make it easier to read.
...
llvm-svn: 125810
2011-02-18 01:25:14 +00:00
Chris Lattner
d12b480e29
handle labeldecls.
...
llvm-svn: 125806
2011-02-18 00:52:55 +00:00
Chris Lattner
60f844916c
make block bodies handle undefined labels just like functions.
...
llvm-svn: 125799
2011-02-17 23:58:47 +00:00
Chris Lattner
fb59c7c7d8
improve support for big endian targets, fixing PR8171, patch
...
by Heikki Kultala!
llvm-svn: 125784
2011-02-17 22:09:58 +00:00
Oscar Fuentes
79b52bfc46
CMake: updated source file list.
...
llvm-svn: 125783
2011-02-17 22:07:39 +00:00
Ted Kremenek
48d9626055
Add -Warray-bounds test showing how the warning currently interoperates with macros.
...
llvm-svn: 125781
2011-02-17 21:40:51 +00:00
Argyrios Kyrtzidis
57d736fd46
[analyzer] Use the new registration mechanism for the debugging info "checks".
...
The relative checker package is 'debug':
'-dump-live-variables' is replaced by '-analyzer-checker=debug.DumpLiveVars'
'-cfg-view' is replaced by '-analyzer-checker=debug.ViewCFG'
'-cfg-dump' is replaced by '-analyzer-checker=debug.DumpCFG'
llvm-svn: 125780
2011-02-17 21:39:39 +00:00
Argyrios Kyrtzidis
af45aca670
[analyzer] Use the new registration mechanism on the non-path-sensitive-checkers:
...
DeadStoresChecker
ObjCMethSigsChecker
ObjCUnusedIvarsChecker
SizeofPointerChecker
ObjCDeallocChecker
SecuritySyntaxChecker
llvm-svn: 125779
2011-02-17 21:39:33 +00:00
Argyrios Kyrtzidis
24ffc08f39
[analyzer]
...
-Introduce CheckerV2, a set of templates for convenient declaration & registration of checkers.
Currently useful just for checkers working on the AST not the path-sensitive ones.
-Enhance CheckerManager to actually collect the checkers and turn it into the entry point for
running the checkers.
-Use the new mechanism for the LLVMConventionsChecker.
llvm-svn: 125778
2011-02-17 21:39:24 +00:00
Argyrios Kyrtzidis
507ff53e39
[analyzer] Pass CheckerManager to the registration functions.
...
llvm-svn: 125777
2011-02-17 21:39:17 +00:00
Chandler Carruth
1af88f12a3
Enhance the array bounds checking to work for several other constructs,
...
especially C++ code, and generally expand the test coverage.
Logic adapted from a patch by Kaelyn Uhrain <rikka@google.com> and
another Googler.
llvm-svn: 125775
2011-02-17 21:10:52 +00:00
Chandler Carruth
2a666fc2c7
Clean up the style of this function to match the conventions in the rest
...
of Clang, and reflows the code a bit to make it easier to read.
llvm-svn: 125773
2011-02-17 20:55:08 +00:00
Chris Lattner
d28cc8113b
add a fixme
...
llvm-svn: 125772
2011-02-17 20:54:00 +00:00
Chris Lattner
cab02a60d2
Step #2/N of __label__ support: keep pushing LabelDecl forward,
...
making them be template instantiated in a more normal way and
make them handle attributes like other decls.
This fixes the used/unused label handling stuff, making it use
the same infrastructure as other decls.
llvm-svn: 125771
2011-02-17 20:34:02 +00:00
Chris Lattner
50c3c1316a
Inline LocalInstantiationScope::getInstantiationOf into its one
...
client, making room for future hacking.
llvm-svn: 125770
2011-02-17 19:47:42 +00:00
Chris Lattner
15a776fff7
remove some defensive code: LocalInstantiationScope::getInstantiationOf
...
and findInstantiationOf can never return null, even on invalid code.
llvm-svn: 125769
2011-02-17 19:38:27 +00:00
Chris Lattner
bdc1a42aef
remove some dead overloads.
...
llvm-svn: 125768
2011-02-17 19:37:28 +00:00
Douglas Gregor
d6f8124c9c
Eliminate the internal command-line option for viewing inheritance in C++ classes, since it's only really worked for the trivial cases anyway due to lame pseudo-parsing of the class name. The viewInheritance() function is still available for use in the debugger, where this is far more useful
...
llvm-svn: 125762
2011-02-17 19:04:40 +00:00
John McCall
e6be5e1c0d
Remove the "conditional save" hashtables from IR generation.
...
llvm-svn: 125761
2011-02-17 19:02:56 +00:00
Douglas Gregor
428d75ffd9
The internal -fdump-record-layouts flag already dumps the layout when it was computed; no need to do so again at the end of the translation unit
...
llvm-svn: 125760
2011-02-17 18:59:06 +00:00
Argyrios Kyrtzidis
9d5235d527
When building StaticAnalyzer/Frontend add -I "<Checkers build dir>" to allow Checkers.inc to be
...
included without '..', thus being compatible with build systems of *BSDs.
Patch by Joerg Sonnenberger!
llvm-svn: 125758
2011-02-17 18:40:33 +00:00
Douglas Gregor
65f57fe6ea
Replace a FIXME with a comment describing why we did what we did
...
llvm-svn: 125757
2011-02-17 18:32:37 +00:00
Douglas Gregor
e5de7013c7
Remove the last virtual member function from the Decl hierarchy,
...
reducing the size of all declarations by one pointer. For a 64-bit
Clang parsing Cocoa.h, this saves ~630k of memory (about 3.5% of
ASTContext's memory usage for this header).
llvm-svn: 125756
2011-02-17 18:14:32 +00:00
Douglas Gregor
b494173c93
Devirtualize TagDecl::completeDefinition().
...
llvm-svn: 125755
2011-02-17 18:06:05 +00:00
Douglas Gregor
fe590dfa84
Devirtualize DeclaratorDecl::getInnerLocStart() and TagDecl::getInnerLocStart().
...
llvm-svn: 125754
2011-02-17 17:39:40 +00:00
Fariborz Jahanian
5fc74804a6
Improve diagnostics on missing property decl.
...
llvm-svn: 125752
2011-02-17 17:30:05 +00:00
Douglas Gregor
a991f3a4e9
Devirtualize NamedDecl::getNameForDiagnostic().
...
llvm-svn: 125751
2011-02-17 17:23:19 +00:00
Douglas Gregor
0215459c37
Devirtualize RedeclarableTemplateDecl::newCommon().
...
llvm-svn: 125750
2011-02-17 17:10:20 +00:00
Chandler Carruth
22c7a79a1d
Implement a sub-group of -Wconversion: -Wliteral-conversion. This
...
specifically targets literals which are implicitly converted, a those
are more often unintended and trivial to fix. This can be especially
helpful for diagnosing what makes 'const int x = 1e6' not an ICE.
Original patch authored by Jim Meehan with contributions from other
Googlers and a few cleanups from myself.
llvm-svn: 125745
2011-02-17 11:05:49 +00:00
John McCall
c07a0c7e48
Change the representation of GNU ?: expressions to use a different expression
...
class and to bind the shared value using OpaqueValueExpr. This fixes an
unnoticed problem with deserialization of these expressions where the
deserialized form would lose the vital pointer-equality trait; or rather,
it fixes it because this patch also does the right thing for deserializing
OVEs.
Change OVEs to not be a "temporary object" in the sense that copy elision is
permitted.
This new representation is not totally unawkward to work with, but I think
that's really part and parcel with the semantics we're modelling here. In
particular, it's much easier to fix things like the copy elision bug and to
make the CFG look right.
I've tried to update the analyzer to deal with this in at least some
obvious cases, and I think we get a much better CFG out, but the printing
of OpaqueValueExprs probably needs some work.
llvm-svn: 125744
2011-02-17 10:25:35 +00:00
NAKAMURA Takumi
49ddc3646f
lib/Frontend/InitHeaderSearch.cpp: Add mingw-w64's include paths.
...
llvm-svn: 125743
2011-02-17 08:51:47 +00:00
NAKAMURA Takumi
31ea2f14bc
Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.
...
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32.
llvm-svn: 125742
2011-02-17 08:51:38 +00:00
NAKAMURA Takumi
029d74b264
Fix whitespace.
...
llvm-svn: 125741
2011-02-17 08:50:50 +00:00
Douglas Gregor
133edddd82
Devirtualize Decl::getNextRedeclaration().
...
llvm-svn: 125740
2011-02-17 08:47:29 +00:00
Chandler Carruth
712563bba4
Implement -Wenum-compare, which warns when comparing two enums of
...
different types. We omit the warning when the enum types are anonymous.
Unlike GCC, this warning does not distinguish between C++ and C/ObjC for
controling whether it is on by default, it is always on by default.
Original patch contributed by Richard Trieu (@ Google), I fixed some
style issues, and cleaned it up for submission.
llvm-svn: 125739
2011-02-17 08:37:06 +00:00
Douglas Gregor
5ee06f02f9
Simple little optimization to Decl::getCanonicalDecl(), eliminating some heavyweight machinery and indirection that we don't need
...
llvm-svn: 125737
2011-02-17 08:14:56 +00:00
Douglas Gregor
00716e8bd3
Devirtualize Decl::getSourceRange()
...
llvm-svn: 125736
2011-02-17 08:12:32 +00:00
Douglas Gregor
7edc20ac24
Devirtualize Decl::getCanonicalDecl().
...
llvm-svn: 125735
2011-02-17 07:58:36 +00:00
Chris Lattner
c8e630e4db
Step #1/N of implementing support for __label__: split labels into
...
LabelDecl and LabelStmt. There is a 1-1 correspondence between the
two, but this simplifies a bunch of code by itself. This is because
labels are the only place where we previously had references to random
other statements, causing grief for AST serialization and other stuff.
This does cause one regression (attr(unused) doesn't silence unused
label warnings) which I'll address next.
This does fix some minor bugs:
1. "The only valid attribute " diagnostic was capitalized.
2. Various diagnostics printed as ''labelname'' instead of 'labelname'
3. This reduces duplication of label checking between functions and blocks.
Review appreciated, particularly for the cindex and template bits.
llvm-svn: 125733
2011-02-17 07:39:24 +00:00
Douglas Gregor
f7b2c93b2f
Devirtualize Decl::getBody() and Decl::hasBody().
...
llvm-svn: 125731
2011-02-17 07:13:24 +00:00
Douglas Gregor
a43942a48e
De-virtualize Decl::isOutOfLine().
...
llvm-svn: 125730
2011-02-17 07:02:32 +00:00
Douglas Gregor
b0f2ea9e9e
When printing a qualified type, look through a substituted template
...
parameter type to see what's behind it, so that we don't end up
printing silly things like "float const *" when "const float *" would
make more sense. Also, replace the pile of "isa" tests with a simple
switch enumerating all of the cases, making a few more obvious cases
use prefix qualifiers.
llvm-svn: 125729
2011-02-17 06:52:25 +00:00
Chris Lattner
5a9b1ec94c
simplify a bit.
...
llvm-svn: 125724
2011-02-17 05:38:27 +00:00
Chris Lattner
e281e99f76
tidy up
...
llvm-svn: 125723
2011-02-17 05:19:40 +00:00
Douglas Gregor
230a7e60b1
Improve parser recovery in "for" statements, from Richard Smith!
...
llvm-svn: 125722
2011-02-17 03:38:46 +00:00
Douglas Gregor
0e5d72f164
I will not hold on to temporary StringRefs.
...
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
llvm-svn: 125718
2011-02-17 03:19:26 +00:00
Douglas Gregor
9c1f1bfedc
When Parser::ParseExpressionList isn't given a completer, fall back to
...
normal "expression" completion. Fixes the most annoying
code-completion bug I've found.
llvm-svn: 125715
2011-02-17 03:09:23 +00:00
Matt Beaumont-Gay
956fc1cb81
Fix PR9025 and add a diagnostic (and sometimes a fixit) for an overloaded
...
function name used as the base of a member expression. Early feedback from
Chandler Carruth, and code review from Nick Lewycky.
llvm-svn: 125714
2011-02-17 02:54:17 +00:00
Ted Kremenek
06e2474d51
Bump up IdentifierInfo::ObjCOrBuiltinID to use 11 bits instead of 10. Fixes PR 9231.
...
Apparently we can blow out the number of builtin IDs on FreeBSD with only 10 bits.
llvm-svn: 125713
2011-02-17 02:43:00 +00:00
Ted Kremenek
42ec914ff8
Begin overhaul of scan-build/ccc-analyzer's handling of checker options.
...
We now rely on 'clang --analyze' to provide the default set of checkers. We're
still working on the new '-analyzer-checker <checker>' interface, and once
that's ready we'll wire it up to scan-build.
llvm-svn: 125712
2011-02-17 02:28:30 +00:00
Ted Kremenek
378313944f
Disable default synthesized properties until we can properly re-evaluate the feature.
...
llvm-svn: 125708
2011-02-17 02:17:56 +00:00
Chris Lattner
5df2a4e8df
fix clang -MM output to escape spaces in filenames. This seems to be
...
the only character that GCC escapes. PR9224.
llvm-svn: 125707
2011-02-17 02:14:49 +00:00
Chris Lattner
ffda452fbf
update this test now that reassociate isn't stripping nsw's pointlessly.
...
llvm-svn: 125705
2011-02-17 02:02:42 +00:00
Ken Dyck
02ced6fd19
Convert MaxFieldAlignment to CharUnits from bits. No change in functionality
...
intended.
llvm-svn: 125704
2011-02-17 01:49:42 +00:00
Fariborz Jahanian
05d389f407
Improve diagnostics when property names an object type of
...
a forward class. // rdar://8851803
llvm-svn: 125699
2011-02-17 01:26:14 +00:00
Douglas Gregor
669a25aec3
Implement code completion results for the Objective-C Key-Value Coding
...
(KVC) and Key-Value Observing (KVO) protocols.
llvm-svn: 125696
2011-02-17 00:22:45 +00:00
Nick Lewycky
8d2226208d
Ensure that the NRVO flag has some block to insert into. Fixes PR9178!
...
llvm-svn: 125694
2011-02-16 23:59:08 +00:00
Ted Kremenek
197fcd4418
Fix assertion failure in -Warray-bounds on template parameters used as arrays.
...
llvm-svn: 125693
2011-02-16 23:39:09 +00:00
Fariborz Jahanian
9cd649d376
Block rewriting bug. Don't take address of captured
...
byref variables again when passing them to inner blocks.
// rdar://9006279
llvm-svn: 125690
2011-02-16 22:37:10 +00:00
Ted Kremenek
3a854f8ad2
Placate Doug and change capitalization of diagnostic note.
...
llvm-svn: 125688
2011-02-16 22:08:28 +00:00
Zhanyong Wan
85a203ebdd
Makes most methods in SVals.h conform to the naming guide. Reviewed
...
by kremenek.
llvm-svn: 125687
2011-02-16 21:13:32 +00:00
Chandler Carruth
83ac424574
3000 Sema diagnostics should be enough for anyone.
...
llvm-svn: 125684
2011-02-16 19:41:58 +00:00
Douglas Gregor
d766be689d
Fix a thinko with llvm::Optional, which is clearly the most dangerous class template in the universe
...
llvm-svn: 125679
2011-02-16 19:09:24 +00:00
Douglas Gregor
162b712d38
Teach the CXCodeCompleteResults results structure, which stores
...
code-completion results accessed via libclang, to extend the lifetime
of the allocator used for cached global code-completion results at
least until these completion results are destroyed. Fixes
<rdar://problem/8997369>.
llvm-svn: 125678
2011-02-16 19:08:06 +00:00
Devang Patel
1728c232d5
If preprocessed token introduced empty filename then use main translation unit's filename for debug info entries.
...
llvm-svn: 125672
2011-02-16 18:40:36 +00:00
Douglas Gregor
df7a79a997
Improve the invalidation logic for the cache of global code
...
completions. We now compute a hash of the names of all top-level
declarations and macro definitions, and invalidate the cache when the
hash value changes.
llvm-svn: 125670
2011-02-16 18:16:54 +00:00
Douglas Gregor
012b69d5bb
Teach PPChainedCallbacks to forward the InclusionDirective() callback.
...
llvm-svn: 125669
2011-02-16 18:15:35 +00:00
Argyrios Kyrtzidis
d691ad1680
Warning -> ExtWarn
...
llvm-svn: 125664
2011-02-16 16:23:31 +00:00
John McCall
b5011ab8f9
Remove this FIXME; clear up an unused variable; style.
...
llvm-svn: 125662
2011-02-16 08:39:19 +00:00
John McCall
1bf5846abf
Save a copy expression for non-trivial copy constructions of catch variables.
...
llvm-svn: 125661
2011-02-16 08:02:54 +00:00
Zhanyong Wan
5201b66530
Adds a CMake target for the Basic lib's unit tests. Reviewed by
...
jyasskin and chapuni.
llvm-svn: 125657
2011-02-16 05:45:20 +00:00
Zhanyong Wan
f8a620f8e1
Improves CMakeLists.txt for Clang's unit tests: make "linked
...
components" and "used libs" arguments of add_clang_unittest().
Reviewed by jyasskin and chapuni.
llvm-svn: 125652
2011-02-16 05:19:17 +00:00
Ted Kremenek
108b2d56bf
Tweak -Warray-bounds diagnostics based on feedback from Chandler.
...
llvm-svn: 125649
2011-02-16 04:01:44 +00:00
NAKAMURA Takumi
2ec773f772
CMake: Tweak for Visual Studio 10 quirk at clang-standalone build.
...
llvm-svn: 125647
2011-02-16 03:07:15 +00:00
NAKAMURA Takumi
84f2500eb8
test/CMakeLists.txt: Don't depend on llvm toolchain at clang-standalone build.
...
llvm-svn: 125646
2011-02-16 03:07:10 +00:00
Nick Lewycky
bb1e5079b2
Revert r125642. This broke the build? It should be a no-op.
...
llvm-svn: 125645
2011-02-16 02:34:28 +00:00
Francois Pichet
b3e0886599
test/PCH/headersearch.cpp fails on Win32. Not trivial to fix.
...
llvm-svn: 125644
2011-02-16 02:29:43 +00:00
Ken Dyck
1300b3b357
Convert the UnpackedAlignment field to CharUnits from bits. No change in
...
functionality intended.
llvm-svn: 125643
2011-02-16 02:11:31 +00:00
Nick Lewycky
757515588a
Don't use "../foo" to return to the current directory.
...
llvm-svn: 125642
2011-02-16 02:10:49 +00:00
Ken Dyck
4731d5b65a
Convert Alignment member to CharUnits from bits. No change in functionality
...
intended.
llvm-svn: 125641
2011-02-16 02:05:21 +00:00
Ted Kremenek
64699befcd
Add trivial buffer overflow checking in Sema.
...
llvm-svn: 125640
2011-02-16 01:57:07 +00:00
Ken Dyck
af1c83fbe7
Convert NonVirtualSize to CharUnits from bits. No change in functionality
...
intended.
llvm-svn: 125639
2011-02-16 01:52:01 +00:00
Ken Dyck
a2d3dda041
Convert NonVirtualAlignment to CharUnits. No change in functionality
...
intended.
llvm-svn: 125638
2011-02-16 01:43:15 +00:00
Argyrios Kyrtzidis
034d68e97d
[analyzer] AnalyzerFrontend is dependent on AnalyzerCheckers.
...
llvm-svn: 125637
2011-02-16 01:40:55 +00:00
Argyrios Kyrtzidis
9d4d4f9104
[analyzer] Use the new registration mechanism on the apple checkers:
...
NilArgChecker
CFNumberCreateChecker
NSAutoreleasePoolChecker
CFRetainReleaseChecker
ClassReleaseChecker
llvm-svn: 125636
2011-02-16 01:40:52 +00:00
Douglas Gregor
042465709f
When searching for visible declarations (e.g., for code completion),
...
be sure to look at all of the Objective-C class declarations within a
@class . Fixes <rdar://problem/8876207>.
llvm-svn: 125635
2011-02-16 01:39:26 +00:00
Devang Patel
25468059e5
Simplify test to check an aggregate argument that has non trivial constructor or destructor.
...
This patch rewrites r125142.
llvm-svn: 125632
2011-02-16 01:11:51 +00:00
Douglas Gregor
b5f1e46d30
When trying to provide a code completion item for a call to "super" in
...
Objective-C, also look in the categories and class extensions of our
superclasses. Fixes <rdar://problem/8853540>.
llvm-svn: 125628
2011-02-16 00:51:18 +00:00
John McCall
bf9a86b50f
Don't call objc_read_weak as part of emitting a block literal.
...
Nobody ever gave me a clear reason for why we were doing this, and
now it's apparently causing serious problems, so if *not* having this
causes problems, we get to solve them the right way this time.
llvm-svn: 125627
2011-02-16 00:49:34 +00:00
Fariborz Jahanian
6fd9435f6d
Check for deprecated implementation unconditionally.
...
Warning and its note will be ignored in default case.
llvm-svn: 125621
2011-02-16 00:30:31 +00:00
Fariborz Jahanian
0c87d36d9d
Fix typo (per Chris's comment).
...
llvm-svn: 125619
2011-02-16 00:14:11 +00:00
Argyrios Kyrtzidis
c541ade850
Warn for missing terminating " or ' instead of error for gcc compatibility. Fixed rdar://8914293.
...
llvm-svn: 125616
2011-02-15 23:45:31 +00:00
Devang Patel
49e3348e56
Only c++ class arguments with non trivial constructor or destructor needs a reference.
...
C struct arguments do not need this adjustment.
This fixes 7 failures in callfuncs.exp from gdb testsuite.
llvm-svn: 125615
2011-02-15 23:36:28 +00:00
Argyrios Kyrtzidis
a9215281de
[analyzer] Use the new registration mechanism on some of the experimental internal checkers:
...
CastToStructChecker
FixedAddressChecker
PointerArithChecker
PointerSubChecker
llvm-svn: 125612
2011-02-15 22:55:20 +00:00
Argyrios Kyrtzidis
b2400924d9
[analyzer] Use the new registration mechanism on the IdempotentOperationChecker.
...
llvm-svn: 125611
2011-02-15 22:55:14 +00:00
John McCall
9743e8d84e
Handle delayed access in local declarations. PR9229.
...
llvm-svn: 125609
2011-02-15 22:51:53 +00:00
Douglas Gregor
24bbc46208
Teach code completion to cope with block types written without a
...
prototype, e.g., ^() rather than ^(void). Fixes
<rdar://problem/8875712>.
llvm-svn: 125608
2011-02-15 22:37:09 +00:00
Rafael Espindola
d62acb569c
Add a hack to avoid adding '\01' to asm names when possible. It would be
...
better for clang to always compute the right name, but for now this hack
fixes PR9177 and lets us build firefox with LTO :-)
llvm-svn: 125607
2011-02-15 22:23:51 +00:00
John McCall
4d9f14234f
Refactor CGRecordLayoutBuilder to use CharUnits more consistently.
...
llvm-svn: 125605
2011-02-15 22:21:29 +00:00
Douglas Gregor
f34a6f0fef
Implement a special code-completion pattern for "IBAction". Fixes
...
<rdar://problem/8767704>.
llvm-svn: 125604
2011-02-15 22:19:42 +00:00
Rafael Espindola
41febc658b
Fix the distro name.
...
llvm-svn: 125601
2011-02-15 21:44:06 +00:00
Zhanyong Wan
bc402abcc9
Moves FileManagerTest.cpp to unittests/Basic such that the unit test
...
directory structure matches the library structure. Reviewed by jyasskin.
llvm-svn: 125600
2011-02-15 21:30:27 +00:00
Argyrios Kyrtzidis
f81ff04ba3
[analyzer] Remove ObjCSelfInitCheck from AnalyzerOptions.
...
llvm-svn: 125599
2011-02-15 21:25:07 +00:00
Argyrios Kyrtzidis
2d3905ffac
[analyzer] Use the new registration mechanism on some of the experimental checks. These are:
...
CStringChecker
ChrootChecker
MallocChecker
PthreadLockChecker
StreamChecker
UnreachableCodeChecker
MallocChecker creates implicit dependencies between checkers and needs to be handled differently.
llvm-svn: 125598
2011-02-15 21:25:03 +00:00
Rafael Espindola
65941e50ef
Fix include paths on 32 bit ubuntu 10.10.
...
Original patch by Jonas Bülow.
llvm-svn: 125597
2011-02-15 21:16:43 +00:00
Douglas Gregor
8003924d10
When code-completing within a list of declaration specifiers,
...
separately handle the case of a local declaration-specifier list,
including all types in the set of options. Fixes
<rdar://problem/8790735> and <rdar://problem/8662831>.
llvm-svn: 125594
2011-02-15 20:33:25 +00:00
Peter Collingbourne
e91b2dbdf1
OpenCL: standardise naming of test cases
...
llvm-svn: 125590
2011-02-15 19:46:41 +00:00
Peter Collingbourne
5df20e02af
Serialization/deserialization support for floating point #pragma
...
options, enabled OpenCL extensions and default FP_CONTRACT setting.
llvm-svn: 125589
2011-02-15 19:46:30 +00:00
Peter Collingbourne
e87167b7d8
OpenCL: semantic analysis support for cl_khr_fp64 extension
...
llvm-svn: 125588
2011-02-15 19:46:23 +00:00
Douglas Gregor
d39ae3eec8
When we encounter an Objective-C class name in an expression, followed
...
by the code completion token, treat this as a class message send where
the opening square bracket is missing. Fixes <rdar://problem/6970911>.
llvm-svn: 125587
2011-02-15 19:17:31 +00:00
Fariborz Jahanian
09948f1af6
In -fapple-kext mode, global object construction code
...
ends up in the text segment. // rdar://8825235.
llvm-svn: 125585
2011-02-15 18:54:46 +00:00
Douglas Gregor
e061015de8
Emit in-class member function definitions that are marked
...
"used". Fixes <rdar://problem/8684363>.
llvm-svn: 125579
2011-02-15 18:11:42 +00:00
Argyrios Kyrtzidis
10b2368e9f
Allow resolving headers from a PCH even after headers+PCH were moved to another path.
...
Store in PCH the directory that the PCH was originally created in.
If a header file is not found at the path that we expect it to be and the PCH file
was moved from its original location, try to resolve the file by assuming that
header+PCH were moved together and the header is in the same place relative to the PCH.
llvm-svn: 125576
2011-02-15 17:54:22 +00:00
Fariborz Jahanian
d724a109cf
Refactoring of code to issue warning on implemented
...
deprecated class and methods in objective-c.
llvm-svn: 125573
2011-02-15 17:49:58 +00:00
Douglas Gregor
9892e3545a
Add missing CMake dependency
...
llvm-svn: 125566
2011-02-15 17:09:56 +00:00
Argyrios Kyrtzidis
6fa0d20a6f
Fix the clang-wpa example.
...
llvm-svn: 125565
2011-02-15 16:54:12 +00:00
Argyrios Kyrtzidis
f2ec88ea54
Initialize InlineCall in AnalyzerOptions.
...
llvm-svn: 125564
2011-02-15 16:54:07 +00:00
John McCall
e3dc1707b5
Assorted cleanup:
...
- Have CGM precompute a number of commonly-used types
- Have CGF copy that during initialization instead of recomputing them
- Use TBAA info when initializing a parameter variable
- Refactor the scalar ++/-- code
llvm-svn: 125562
2011-02-15 09:22:45 +00:00
Jeffrey Yasskin
cd3858b103
Add CMake support to the clang unittests.
...
llvm-svn: 125561
2011-02-15 07:54:28 +00:00
Argyrios Kyrtzidis
4e52527c28
[analyzer] Reflect changes for tablegen'ing the checkers.
...
-Update tablegen files for checkers, use the tablegen class name for the checker class name.
-Update ClangSACheckersProvider to not look into hidden checker packages.
llvm-svn: 125560
2011-02-15 07:42:38 +00:00