Commit Graph

17515 Commits

Author SHA1 Message Date
Daniel Dunbar 00f8a397c6 Rename PreprocessorInitOptions to PreprocessorOptions for consistency, and fix
filenames.

Also, move InitializePreprocessor to Utils.h.

llvm-svn: 86335
2009-11-07 04:20:15 +00:00
Daniel Dunbar b10ac0d708 Lift compiler builtin include path logic higher.
llvm-svn: 86334
2009-11-07 04:19:57 +00:00
Ted Kremenek ae3361de2d Remove Checker::CheckType() (and instead using CheckerVisitor::PreVisitDeclStmt()), and refactor VLASizeChecker to have only one Checker subclass (not two) and to not use the node builders directly (and instead use the newer CheckerContext).
llvm-svn: 86329
2009-11-07 03:56:57 +00:00
John McCall 554e857cf4 Test case for -Wconversion.
llvm-svn: 86327
2009-11-07 03:30:38 +00:00
John McCall fceb64bd04 Implement -Wconversion. Off by default, in the non-gcc group. There's
significant work left to be done to reduce the false-positive rate here.

llvm-svn: 86326
2009-11-07 03:30:10 +00:00
Steve Naroff eae650366d Add basic code completion support for ObjC messages.
Still a work in progress...

llvm-svn: 86323
2009-11-07 02:08:14 +00:00
Anders Carlsson 3d888e4548 Revert r86315 and add Type::FixedWidthInt to the FIXME cases.
llvm-svn: 86320
2009-11-07 01:19:37 +00:00
Devang Patel 22053c0f46 MIPS linkage name confuses gdb here. Generate and test DW_AT_name here.
llvm-svn: 86318
2009-11-07 00:41:37 +00:00
Devang Patel 5b39e2382f Do not assert if debug info for certain type is not generated.
llvm-svn: 86315
2009-11-07 00:29:05 +00:00
Devang Patel eef461c230 Do not emit linkage name for global variables. It confuses gdb, because it picks up AT_MIPS_linkage_name and ignores AT_name.
llvm-svn: 86308
2009-11-07 00:10:18 +00:00
Eli Friedman 01cad4c6b0 Make sure isCopyAssignment is only true for actual copy assignment operators,
instead of all assignment operators.  The mistake messes up IRGen because
it ends up assuming that the assignment operator is actually the implicit
copy assignment operator, and therefore tries to emit the RHS as an lvalue.

llvm-svn: 86307
2009-11-07 00:02:45 +00:00
Douglas Gregor 9eb7701dff Various improvements to Clang's code-completion infrastructure:
- Introduce more code-completion string "chunk" kinds that describe
  symbols, the actual text that the user is expected to type, etc.
  - Make the generation of macro results optional, since it can be
  slow
  - Make code-completion accessible through the C API, marshalling the
  code-completion results through a temporary file (ick) to maintain
  process separation.

The last doesn't have tests yet.

llvm-svn: 86306
2009-11-07 00:00:49 +00:00
Mike Stump cd6f9ed906 Refine the non-virtual this adjustment. Optimize out virtual this
adjustments of zero.

llvm-svn: 86300
2009-11-06 23:27:42 +00:00
Fariborz Jahanian 3600f41a3a Since default writable attribute is 'assign', allow
specification of 'assign' (no warning to be issued),
when a continuation class makes a 'readonly' attribute
'readwrite' but also specifies the 'assign' attribute.
(this matches gcc's behavior and prevents exessive 
 warnings)/

llvm-svn: 86297
2009-11-06 22:59:12 +00:00
Fariborz Jahanian 2f487126ce Make fragile-abi test run happy.
llvm-svn: 86293
2009-11-06 22:15:27 +00:00
Ted Kremenek 795c611cfa Make the VLASizeChecker implementation private, and its creation only known to GRExprEngineInternalChecks.cpp.
llvm-svn: 86292
2009-11-06 21:51:50 +00:00
Fariborz Jahanian 95239110cd Fix a bogus objective-c warning with -pedantic.
(radar 7370882).

llvm-svn: 86291
2009-11-06 21:48:47 +00:00
Ted Kremenek 53a70c055d Make the implementation of DivZeroChecker private.
llvm-svn: 86288
2009-11-06 20:47:51 +00:00
Fariborz Jahanian e8e631c912 Prevent a code gen. crash on empty unions - pr5408.
llvm-svn: 86287
2009-11-06 20:47:40 +00:00
Ted Kremenek e3423e84a9 testing: Merge PR3135.c into misc-ps-region-store.m.
llvm-svn: 86286
2009-11-06 20:32:38 +00:00
Ted Kremenek df9ca633b6 Sentence-case bug type, and pull tests from region-only-test.c into misc-ps-region.store.m (removing an extra unneeded test file). Also add a bunch of FIXME comments for future enhancements.
llvm-svn: 86282
2009-11-06 20:16:31 +00:00
Anders Carlsson 443f677302 Simplify the debug info code, handle lvalue references and template specializations.
llvm-svn: 86277
2009-11-06 19:19:55 +00:00
Fariborz Jahanian c2d71b531c This patch fixes code gen. part of pr5333 (Conversion
using elipsis conversion).

llvm-svn: 86276
2009-11-06 18:47:57 +00:00
Anders Carlsson 8a6512961f Handle QualifiedNameType and SubstTemplateTypeParmType types in CGDebugInfo::CreateTypeNode.
llvm-svn: 86274
2009-11-06 18:45:16 +00:00
Nuno Lopes ac5eba93ca add test case for PR3135 which was already fixed
llvm-svn: 86273
2009-11-06 18:42:13 +00:00
Anders Carlsson 25ed5c2f42 Don't assert when trying to generate debug info for vector types. This needs to be fixed eventually...
llvm-svn: 86268
2009-11-06 18:24:04 +00:00
John McCall e2c91e6b26 Don't warn -Wsign-compare if we're in an unevaluated context, and fixed
a typo pointed out by Fariborz.

llvm-svn: 86265
2009-11-06 18:16:06 +00:00
Chris Lattner 353fc1e447 update comment, pointed out by Gabor
llvm-svn: 86263
2009-11-06 18:10:47 +00:00
Chris Lattner 45540e91d1 add some const qualifiers, patch by Kovarththanan Rajaratnam!
llvm-svn: 86260
2009-11-06 18:01:14 +00:00
Chris Lattner 4f24225e8e indirectbr seems to work! Rip out the old code.
llvm-svn: 86256
2009-11-06 17:38:18 +00:00
Anders Carlsson eb9bc2ba82 Instead of returning a null DIType for unhandled types, assert.
llvm-svn: 86254
2009-11-06 17:01:39 +00:00
Zhongxing Xu 167bce9cf1 Add a checker for CWE-466: Return of Pointer Value Outside of Expected Range.
llvm-svn: 86252
2009-11-06 13:30:44 +00:00
John McCall e46fd8531c compare.c also needs a target triple now, and improve some comments while we're
at it.

llvm-svn: 86243
2009-11-06 08:53:51 +00:00
John McCall 99ce6bfe28 Improve the -Wsign-compare heuristics:
* If the unsigned type is smaller than the signed type, never warn, because
    its value will not change when zero-extended to the larger type.
  * If we're testing for (in)equality, and the unsigned value is an integer
    constant whose sign bit is not set, never warn, because even though the
    signed value might change, it can't affect the result of the equality.

Also make the comparison test cases much more rigorous, and have them expose
the subtle differences between C and C++ here.

llvm-svn: 86242
2009-11-06 08:49:08 +00:00
John McCall d59dd65fa4 Create a warning group "non-gcc" for diagnostics which are not enabled
by default in GCC.  Users who want to emulate gcc's warning behavior
exactly should be able to use CC="clang -Wno-non-gcc";  this should help
projects to transition.

llvm-svn: 86241
2009-11-06 07:53:21 +00:00
Chris Lattner 3e4fac7408 add some fixit hints.
llvm-svn: 86240
2009-11-06 06:40:12 +00:00
Douglas Gregor d82ae38d53 Rework the fix-it hint for code like
get_origin->x

where get_origin is actually a function and the user has forgotten the
parentheses. Instead of giving a lame note for the fix-it, give a
full-fledge error, early, then build the call expression to try to
recover. 

llvm-svn: 86238
2009-11-06 06:30:47 +00:00
Douglas Gregor f4f2ff773b Improve recovery when we fail to parse the operand of a C++ named cast. Fixes PR5210
llvm-svn: 86234
2009-11-06 05:48:00 +00:00
Douglas Gregor 6af6c3ee56 Turn off -Wsign-compare warnings by default
llvm-svn: 86233
2009-11-06 05:24:12 +00:00
Anders Carlsson 421a5c9651 If a member variable of reference type is bound to a temporary in its member initializer it needs to be destroyed at the end of the constructor.
llvm-svn: 86230
2009-11-06 04:19:02 +00:00
Anders Carlsson 5852b13827 If a member initializer create temporaries we need to destroy them. Fixes PR5077.
llvm-svn: 86225
2009-11-06 04:11:09 +00:00
Anders Carlsson a7cb98b202 More cleanup.
llvm-svn: 86224
2009-11-06 03:23:06 +00:00
Anders Carlsson 438cf92533 Cleanup ctor/dtor emission.
llvm-svn: 86222
2009-11-06 02:55:43 +00:00
Anders Carlsson 9e4e0237e4 Handle ParenExprs in mangleExpression.
llvm-svn: 86218
2009-11-06 02:50:19 +00:00
Mike Stump 72431bd9ea Refine the vcall for a function that is defined in a virtual base
class that is overridden in a base that isn't morally virtual.

llvm-svn: 86217
2009-11-06 02:38:24 +00:00
Ted Kremenek bee01e5b61 static analyzer: refactor checking logic for returning the address of a stack variable or a garbage
value into their own respective subclasses of Checker (and put them in .cpp files where their
implementation details are hidden from GRExprEngine).

llvm-svn: 86215
2009-11-06 02:24:13 +00:00
Douglas Gregor ad8b22269e If we have a C-style cast, functional cast, or a static_cast to a
class type, don't perform the array-to-pointer or function-to-pointer
conversions, because we may end up binding a reference to a function
or array.

With this change, FileCheck now passes -fsyntax-only!

llvm-svn: 86211
2009-11-06 01:14:41 +00:00
Douglas Gregor 02ba0ea461 When we encounter a derived-to-base conversion when performing an
implicit conversion sequence, check the validity of this conversion
and then perform it.

llvm-svn: 86210
2009-11-06 01:02:41 +00:00
Fariborz Jahanian eec642f8ab Minor cleanup of my last patch.
llvm-svn: 86209
2009-11-06 00:55:14 +00:00
Ted Kremenek 2980b975ee Minor cleanup: use BuiltinBug (which will soon be renamed) for DeferenceChecker and friends so that they always report the same bug type.
llvm-svn: 86208
2009-11-06 00:44:32 +00:00
Fariborz Jahanian 5582451e91 This patch implements Sema for clause 13.3.3.1p4.
It has to do with vararg constructors used as conversion
functions. Code gen needs work. This is WIP.

llvm-svn: 86207
2009-11-06 00:23:08 +00:00
Mike Stump aea4b8a0c3 Convert file over to checking the .ll file for codegen. Also, we
speed up this file by not doing twice the checking.

llvm-svn: 86205
2009-11-06 00:18:25 +00:00
John Thompson a8cb86bfd4 Update clang web pages with respect to Windows
llvm-svn: 86200
2009-11-06 00:06:29 +00:00
Douglas Gregor b2186fe23c Make sure that EnumConstantDecls always get a type, even when they have type-dependent initializers.
llvm-svn: 86197
2009-11-06 00:03:12 +00:00
Douglas Gregor 4c25ce723f Strip off the /clang/tools/clang at the end of the Subversion URL, if it's there
llvm-svn: 86195
2009-11-05 23:46:05 +00:00
John Thompson 864bf7562f Eliminate tabls
llvm-svn: 86183
2009-11-05 22:03:02 +00:00
Chris Lattner e4a8c64731 clean up integer preprocessor type definitions, patch by Ken Dyck!
llvm-svn: 86177
2009-11-05 21:21:32 +00:00
Sebastian Redl 87869bc435 Make ASTContext::getIntWidth return 1 for all boolean type variations, not just for the unqualified, unaliased bool.
llvm-svn: 86174
2009-11-05 21:10:57 +00:00
Sebastian Redl 0b7c85fc5a The signed/unsigned checker should not warn for value-dependent expressions, and should especially not try to evaluate them.
llvm-svn: 86173
2009-11-05 21:09:23 +00:00
Douglas Gregor 4ebb7f3e4c Be a little more careful when trying to extract a TypeDecl from a enum/class/struct/union specifier; in invalid code, we may also see ClassTemplateDecls.
llvm-svn: 86171
2009-11-05 20:54:04 +00:00
John Thompson ed4e2950bc Adding -fshort-wchar option.
llvm-svn: 86167
2009-11-05 20:14:16 +00:00
Douglas Gregor 866ad5d8ea De-FIXME a test
llvm-svn: 86166
2009-11-05 20:02:41 +00:00
Sebastian Redl 1060067dd1 Don't allow definitions of array variables without some size information in C++. Fixed PR5401
llvm-svn: 86165
2009-11-05 19:47:47 +00:00
Devang Patel ba3c6681f0 Enable debug info for global variables at -O1+
llvm-svn: 86156
2009-11-05 19:13:29 +00:00
Fariborz Jahanian c5a044e057 Adds doxygen comment for HasSideEffects method.
llvm-svn: 86150
2009-11-05 18:47:38 +00:00
Fariborz Jahanian 4127b8ef97 Added support for static variables which require
initialization before main. Fixes pr5396.

llvm-svn: 86145
2009-11-05 18:03:03 +00:00
Douglas Gregor 13a2c03801 Eliminate some false positives due to a thinko in the "'blah' is
always zero in this context" warning logic. Also, make the diagnostic
itself more precise when referring to pointer values ("NULL" vs. "zero").

llvm-svn: 86143
2009-11-05 17:49:26 +00:00
Sebastian Redl fec61e2111 Add Ubuntu 9.10 libstdc++ install location.
llvm-svn: 86142
2009-11-05 17:44:49 +00:00
Sebastian Redl 65ae200a13 When collecting types for built-in candidates, make arrays decay to pointers. Otherwise, subscripting an array leads to no candidates at all. Fixes PR5360.
llvm-svn: 86140
2009-11-05 16:36:20 +00:00
Daniel Dunbar d3f630f4d5 Add clang_site_config user variable, so that extra tests (e.g., utils/C++Syntax)
can always find the main clang site config (when invoked via CMake/Makefiles, at
least).

llvm-svn: 86139
2009-11-05 16:36:19 +00:00
Sebastian Redl 2dfdb820ca Allow the element type of arrays to be incomplete in C++.
This fixes PR5048. Also fix a bug where zero-sized arrays weren't warned about when the size was unsigned.

llvm-svn: 86136
2009-11-05 15:52:31 +00:00
Sebastian Redl 39c2a8bbbc Parse C++0x constexpr. Test case follows when this does something useful.
llvm-svn: 86135
2009-11-05 15:47:02 +00:00
Daniel Dunbar 2fd33fe701 Don't run anything other than the compiler in these tests.
llvm-svn: 86134
2009-11-05 15:28:24 +00:00
Douglas Gregor 3ec1bf240d Fixed two places where we needed to force completion of a type
(without complaining if it fails) to get proper semantics: reference
binding with a derived-to-base conversion and the enumeration of
constructors for user-defined conversions. There are probably more
cases to fix, but my prior attempt at statically ensuring that
complete-type checking always happens failed. Perhaps I'll try again.

With this change, Clang can parse include/llvm/*.h!

llvm-svn: 86129
2009-11-05 13:06:35 +00:00
John McCall 1fa36b7cab Implement the conditional-operator part of -Wsign-compare. Turn
DiagnoseSignCompare into Sema::CheckSignCompare and call it from more places.

Add some enumerator tests.  These seem to expose some oddities in the
types we're converting C++ enumerators to;  in particular, they're converting
to unsigned before int, which seems to contradict 4.5 [conv.prom] p2.

Note to self: stop baiting Doug in my commit messages.

llvm-svn: 86128
2009-11-05 09:23:39 +00:00
Ted Kremenek c92ff053e9 Tweak wording and classifications of analyzer diagnostics.
llvm-svn: 86127
2009-11-05 08:30:12 +00:00
Ted Kremenek 8b64a734b8 Update checker build.
llvm-svn: 86126
2009-11-05 08:07:41 +00:00
Daniel Dunbar 377eb21801 Add EXTRA_TESTDIRS variable for specifying additional test directories.
llvm-svn: 86122
2009-11-05 06:55:24 +00:00
Mike Stump c550768a11 References can't be zero; omit zero check for return value adjustments
in covariant thunks that return references.

llvm-svn: 86121
2009-11-05 06:32:02 +00:00
Mike Stump b8da7a046d Refine covariant return value adjustments for thunks when null
pointers are returned.

llvm-svn: 86120
2009-11-05 06:12:26 +00:00
Mike Stump 098da869a7 Testcase for a recent checkin.
llvm-svn: 86118
2009-11-05 05:26:28 +00:00
Mike Stump abcffc3b59 Update.
llvm-svn: 86117
2009-11-05 05:01:19 +00:00
Mike Stump 2b84dd39be Refine layout for indirect virtual base classes.
llvm-svn: 86116
2009-11-05 04:02:15 +00:00
Mike Stump 5ff76e2fa2 Fix 80-col violation.
llvm-svn: 86115
2009-11-05 03:47:55 +00:00
Daniel Dunbar 0231895ce6 Replace DiagnosticClient::setLangOptions with {Begin,End}SourceFile, and clarify
invariants (diagnostics with source informations must occur between
{Begin,End}SourceFile).

llvm-svn: 86113
2009-11-05 02:42:12 +00:00
Daniel Dunbar b5f2025b77 Convert CreateAnalysisConsumer and friends to just take a const Preprocessor&, and simplify.
llvm-svn: 86112
2009-11-05 02:41:58 +00:00
Daniel Dunbar 78eaff4c13 Remove unused SetPreprocessor method.
llvm-svn: 86111
2009-11-05 02:41:44 +00:00
Ted Kremenek 165f5b7421 AnalysisManager: Don't rely on PathDiagnosicClients flushing their diagnostics when they are destroyed.
llvm-svn: 86110
2009-11-05 02:17:33 +00:00
Daniel Dunbar aef52f4c83 Remove clang-cc -html-diags option, this doesn't fit in well and we get plenty
of coverage of this from the analyzer.

If this bothers you, I can add it back in a mode where non-source diagnostics go
to stderr and only source diagnostics use -html-diags, but I don't think anyone
uses this.

llvm-svn: 86109
2009-11-05 02:11:37 +00:00
Ted Kremenek 5e86044ec4 Acting on Daniel's nagging, remove PathDiagnosticClientFactory() and
migrate work in the destructors of PathDiagnosticClients from their
destructors to FlushReports().  The destructors now currently call
FlushReports(); this will be fixed in a subsequent patch.

llvm-svn: 86108
2009-11-05 02:09:23 +00:00
Daniel Dunbar a2ff3b4819 Make html::{SyntaxHighlight,HighlightMacros} take a const Preprocessor.
This is conceptually correct, but adds a huge hack to HighlightMacros which is
in fact doing all sorts of mutation to the Preprocessor. See FIXME.

Chris, please review.

llvm-svn: 86107
2009-11-05 01:54:02 +00:00
Daniel Dunbar 07dcd8b9d8 Make LookUpIdentifierInfo const. This makes the Identifiers table mutable and is
a little fuzzy, but conceptually it's just uniquing the identifier.

Chris, please review. I debated splitting into const/non-const versions where
the const one propogated constness to the resulting IdentifierInfo*.

llvm-svn: 86106
2009-11-05 01:53:52 +00:00
Daniel Dunbar f539bfeb4d StringRefize Preprocessor::getIdentifierInfo.
llvm-svn: 86105
2009-11-05 01:53:39 +00:00
Daniel Dunbar c00be15469 Simplify.
llvm-svn: 86104
2009-11-05 01:53:23 +00:00
Daniel Dunbar b6362c13c9 CreatePreprocessor cannot fail
llvm-svn: 86103
2009-11-05 01:53:12 +00:00
Douglas Gregor 5287f091b2 When instantiating a UnaryOperator, allow the resulting expression to
still be dependent or invoke an overloaded operator. Previously, we
only supported builtin operators.

BinaryOperator/CompoundAssignOperator didn't have this issue because
we always built a CXXOperatorCallExpr node, even when name lookup
didn't find any functions to save until instantiation time. Now, that
code builds a BinaryOperator or CompoundAssignOperator rather than a
CXXOperatorCallExpr, to save some space.

llvm-svn: 86087
2009-11-05 00:51:44 +00:00
Ted Kremenek 209e31b883 Modify GRExprEngine::EvalBind() to take both a "store expression" and
an "assign expression", representing the expressions where the value
binding occurs and the assignment takes place respectively.  These are
largely syntactic clues for better error reporting.

llvm-svn: 86084
2009-11-05 00:42:23 +00:00
John McCall 644a4181c9 Implement -Wsign-compare, or at least the actual comparison part of it.
Conditional operands are next.

Fixes part of rdar://problem/7289584.

llvm-svn: 86083
2009-11-05 00:40:04 +00:00
Douglas Gregor 01df946664 Make sure to grab CVR qualifiers from the canonical type. ARGH!
llvm-svn: 86079
2009-11-05 00:07:36 +00:00
Daniel Dunbar d0ba0e6108 Kill PreprocessorFactory, which was both morally repugnant and totally unused.
llvm-svn: 86076
2009-11-04 23:56:25 +00:00
Daniel Dunbar a5beced60e Turn if chain into switch.
llvm-svn: 86071
2009-11-04 23:41:40 +00:00
Daniel Dunbar 14f00d2e10 Tweak formatting.
llvm-svn: 86070
2009-11-04 23:41:27 +00:00
Douglas Gregor b184f0d32e When instantiating a MemberExpr, be sure to instantiate the
explicitly-specified template arguments, too!

llvm-svn: 86066
2009-11-04 23:20:05 +00:00
John McCall c90f6d76bd Comments, formatting. Based on patch by Brandon Pearcy!
llvm-svn: 86065
2009-11-04 23:13:52 +00:00
Chris Lattner b0966de585 A simple reordering of the definitions in stdint.h and
introduces no new function changes.   Patch by Ken Dyck!

llvm-svn: 86062
2009-11-04 23:03:18 +00:00
John McCall e22a04aba9 Diagnose using a field to initialize itself. Patch by Brandon Pearcy!
llvm-svn: 86061
2009-11-04 23:02:40 +00:00
Douglas Gregor 41127188ac When starting a C++ member access expression, make sure to compute the
type of the object even when it is dependent. Specifically, this makes
sure that we get the right type for "this->", which is important when
performing name lookup into this scope to determine whether an
identifier or operator-function-id is a template name.

llvm-svn: 86060
2009-11-04 22:49:18 +00:00
Chris Lattner b689d0c95e ignore two new -W flags, patch by Tom Jablin!
llvm-svn: 86059
2009-11-04 22:47:56 +00:00
Douglas Gregor b082bab69e Give DeclarationName's operator< a more predictable, useful ordering
llvm-svn: 86055
2009-11-04 22:24:30 +00:00
John Thompson f174268a1f Fixed for running on Windows.
llvm-svn: 86053
2009-11-04 21:52:17 +00:00
Douglas Gregor 4d0c38ad95 Fix a little canonical-types issue with non-type template arguments.
Fixes PR5349. 

llvm-svn: 86052
2009-11-04 21:50:46 +00:00
Daniel Dunbar 181aaee165 InitializePreprocessor cannot fail.
llvm-svn: 86048
2009-11-04 21:13:15 +00:00
Daniel Dunbar b27ec09a7e Move -undef flag into PreprocessorInitOptions
llvm-svn: 86047
2009-11-04 21:13:02 +00:00
Fariborz Jahanian 18bc195473 Add code gen for pointer-to-member function in
ctor's initializer. Fixes pr5178.

llvm-svn: 86040
2009-11-04 19:13:37 +00:00
Douglas Gregor 3552259059 Properly replace (cxxscope, template-id) annotation tokens with a
single typename annotation token when backtracing. Fixes PR5350.

llvm-svn: 86034
2009-11-04 18:18:19 +00:00
Fariborz Jahanian 09cc10f9f8 This patch extends CleanupScope to support destruction
of array objects on block exit. Patch is by Anders Calrsson.

llvm-svn: 86032
2009-11-04 17:57:40 +00:00
Douglas Gregor 2de8f4149e Don't try to check the initialization of fields with dependent
types. Fixes PR5352.

Fariborz, please review.

llvm-svn: 86031
2009-11-04 17:16:11 +00:00
Douglas Gregor 615ac67fb8 Store the unresolved class type in MemberPointerType's Class field,
from Peter Collingbourne!

llvm-svn: 86030
2009-11-04 16:49:01 +00:00
Chris Lattner b73beb36f5 this test has started failing due to an optimizer change. Clang tests
should only look at -O0 IR output not -O3 assembly output.  XFAIL it for
now.

llvm-svn: 86029
2009-11-04 16:37:13 +00:00
Douglas Gregor e7b5f81ba5 Eliminate the "old" ways of parsing operator-function-ids and
conversion-function-ids; all clients have moved on to
ParseUnqualifiedId.

llvm-svn: 86028
2009-11-04 16:32:12 +00:00
Douglas Gregor 220f4277bd Switch parsing of using declarations over to ParseUnqualifiedId.
llvm-svn: 86027
2009-11-04 16:30:06 +00:00
John McCall 4c98fd8953 Preserve type source information in sizeof/alignof expressions, and pass it
through to indexing.

llvm-svn: 86018
2009-11-04 07:28:41 +00:00
Douglas Gregor c95a1fa7f6 When performing template instantiation (transformation) of
expressions, keep track of whether we are immediately taking the
address of the expression. Pass this flag when building a declaration
name expression so that we handle pointer-to-member constants
properly.

llvm-svn: 86017
2009-11-04 07:01:15 +00:00
Daniel Dunbar a9be734c24 Fix commento.
llvm-svn: 86016
2009-11-04 06:57:08 +00:00
Daniel Dunbar 0300bbcf80 Update CMake.
llvm-svn: 86015
2009-11-04 06:39:40 +00:00
Daniel Dunbar 5ec950218a Move -fcolor-diagnostics logic to driver.
llvm-svn: 86014
2009-11-04 06:24:57 +00:00
Daniel Dunbar 2c9784769a Move logic for selection -fmessage-length= to driver.
llvm-svn: 86013
2009-11-04 06:24:47 +00:00
Daniel Dunbar 1c7577c9bd Fix indentation.
llvm-svn: 86011
2009-11-04 06:24:38 +00:00
Daniel Dunbar c2e6a4709e Factor out a diagnostic options class.
llvm-svn: 86010
2009-11-04 06:24:30 +00:00
Ted Kremenek 9346a56793 Add FIXME.
llvm-svn: 86004
2009-11-04 04:24:44 +00:00
Ted Kremenek ef910047b2 Catch uses of undefined values when they are used in assignment, thus catching such bugs closer to the source.
llvm-svn: 86003
2009-11-04 04:24:16 +00:00
Ted Kremenek 9db38f6f83 Add mising #ifdef guards.
llvm-svn: 86002
2009-11-04 04:03:43 +00:00
John McCall 4976fd4ea9 Diagnose the use of 'fastcall' on functions without prototypes or with
varargs prototypes.

llvm-svn: 86001
2009-11-04 03:36:09 +00:00
John McCall 9eff4e60ae Diagnose __builtin_offsetof on incomplete types. Fixes
rdar://problem/7222956

llvm-svn: 85999
2009-11-04 03:03:43 +00:00
John McCall 28a6aeab7e Change our basic strategy for avoiding deprecation warnings when the decl use
appears in a deprecated context.  In the new strategy, we emit the warnings
as usual unless we're currently parsing a declaration, where "declaration" is
restricted to mean a decl group or a few special cases in Objective C.  If
we *are* parsing a declaration, we queue up the deprecation warnings until
the declaration has been completely parsed, and then emit them only if the
decl is not deprecated.
We also standardize the bookkeeping for deprecation so as to avoid special cases.

llvm-svn: 85998
2009-11-04 02:18:39 +00:00
Zhongxing Xu 259d46407a Merge ZeroSizedVLAChecker and UndefSizedVLAChecker.
llvm-svn: 85996
2009-11-04 01:43:07 +00:00
Tanya Lattner f9d41df093 Merge constant array and structures. This will create a global variables for arrays and structs that are constant and their initializer is constant. It is on by default but can be disable with the flag -fno-merge-all-constants.
llvm-svn: 85991
2009-11-04 01:18:09 +00:00
Mike Stump b9c9b351e9 Fix 80-col violations.
llvm-svn: 85990
2009-11-04 01:11:15 +00:00
Douglas Gregor 71395fa1d5 Implement support for parsing dependent template-ids that refer to
overloaded operators, e.g.,

  p->template operator+<T>()

llvm-svn: 85989
2009-11-04 00:56:37 +00:00
Mike Stump 71609a2874 Split out return adjustments in thunks from this adjustment in thunks
so the optimizer can tailcall into the return value adjustment thunk.
This improves codesize for complex hierarchies.

llvm-svn: 85988
2009-11-04 00:53:51 +00:00
Daniel Dunbar caa00adafd Use unsigned char instead of unsigned : 8 to make the optimizer happier.
llvm-svn: 85985
2009-11-04 00:34:40 +00:00
Ted Kremenek b006b82daf Refactor StoreManager::BindDecl() to take a VarRegion* instead of a VarDecl*, and modify GRExprEngine::EvalBind() to handle decl initialization as well. This paves the way for adding "checker" visitation in EvalBind().
llvm-svn: 85983
2009-11-04 00:09:15 +00:00
Mike Stump 8117848174 Misc cleanups.
llvm-svn: 85978
2009-11-03 23:50:34 +00:00
Mike Stump 6de15a8881 Test case for recent checkin.
llvm-svn: 85972
2009-11-03 23:32:42 +00:00
Ted Kremenek 0fbbb0877d Change GRTransferFuncs::RegisterChecks() to take a GRExprEngine& instead of a BugReporter&. This paves the way for pulling some of the retain/release checker into a "Checker" class.
llvm-svn: 85971
2009-11-03 23:30:34 +00:00
Mike Stump 53f9ded62b Refine volatile handling, specifically, we must have the canonical
type to look at the volatile specifier.  I found these all from just
hand auditing the code.

llvm-svn: 85967
2009-11-03 23:25:48 +00:00
Douglas Gregor 3cf81317e4 Parsing and semantic analysis for template-ids that name overloaded
operators, e.g., 

  operator+<int>

which now works in declarators, id-expressions, and member access
expressions. This commit only implements the non-dependent case, where
we can resolve the template-id to an actual declaration.

llvm-svn: 85966
2009-11-03 23:16:33 +00:00
Nuno Lopes f94d35387e make 'make clean' work on Solaris, per Gabor Greif comment
llvm-svn: 85958
2009-11-03 22:39:56 +00:00
Nuno Lopes 6a20b2df3e make 'make clean' clean everything
llvm-svn: 85957
2009-11-03 22:21:28 +00:00
Mike Stump 96638affa6 We have to ensure we have the canonical type to do this. This is but
one instance of a large problem.  assert for non-canoical types would
help track down these things.

llvm-svn: 85956
2009-11-03 22:20:01 +00:00
Douglas Gregor 127ea59872 Tweak some comments about unqualified-id and id-expression parsing. No functionality change
llvm-svn: 85942
2009-11-03 21:24:04 +00:00
John McCall 5e6253bbd0 CFieldCallback doesn't need to create an ExtensionRAIIObject: it's actually
automatically shadowed by the ExtensionRAIIObject created by
ParseStructDeclaration.

llvm-svn: 85941
2009-11-03 21:13:47 +00:00
Douglas Gregor 7f4d7ea3a9 Remove a bunch of #if 0'd code made irrelevant by the latest ParseUnqualifiedId changes
llvm-svn: 85938
2009-11-03 20:53:48 +00:00
Fariborz Jahanian 7ad3616659 Remove previous patch for pr5296 due to further clarification
of value-initialization and trivial constructors.

llvm-svn: 85935
2009-11-03 20:38:53 +00:00
Chris Lattner e9d7d78ab3 Implement support for the -undef command line option, patch by
Roman Divacky! PR5363

llvm-svn: 85932
2009-11-03 19:50:27 +00:00
Chris Lattner 4f10559ba8 silence a warning.
llvm-svn: 85931
2009-11-03 19:48:51 +00:00
Douglas Gregor 30d60cb36e Replace the code that parses member access expressions after "." or
"->" with a use of ParseUnqualifiedId. Collapse
ActOnMemberReferenceExpr, ActOnDestructorReferenceExpr (both of them),
ActOnOverloadedOperatorReferenceExpr,
ActOnConversionOperatorReferenceExpr, and
ActOnMemberTemplateIdReferenceExpr into a single, new action
ActOnMemberAccessExpr that does the same thing more cleanly (and can
keep more source-location information).

llvm-svn: 85930
2009-11-03 19:44:04 +00:00
John McCall 37958aa864 Silence a warning by giving Parser::FieldCallback a virtual destructor, and
anchor the vtable to Parser.cpp for good measure.

llvm-svn: 85927
2009-11-03 19:33:12 +00:00
Mike Stump f6968a5749 vtable testcase for recent work on vcall/vbase offsets.
llvm-svn: 85925
2009-11-03 19:28:52 +00:00
John McCall d5a36321b9 Reorganize the parsing of decl groups / function definitions so that
declarators are parsed primarily within a single function (at least for
these cases).  Remove some excess diagnostics arising during parse failures.

llvm-svn: 85924
2009-11-03 19:26:08 +00:00
Mike Stump 4627132ebc Refine codegen for covariant thunks that return references.
llvm-svn: 85916
2009-11-03 19:03:17 +00:00
Ted Kremenek 8d43a6ac3d Merge NullDerefChecker.[h,cpp] and UndefDerefChecker.[h,cpp]. They are essentially two parts of the same check.
llvm-svn: 85911
2009-11-03 18:41:06 +00:00
Daniel Dunbar eec7d75a4e Fix tests to not depend on /dev/null existing.
llvm-svn: 85908
2009-11-03 17:56:18 +00:00
Mike Stump 77738205e6 Refine return value adjustments for thunks.
llvm-svn: 85905
2009-11-03 16:59:27 +00:00
Douglas Gregor a121b75d9d Use ParseUnqualifiedId when parsing id-expressions. This eliminates
yet another copy of the unqualified-id parsing code.

Also, use UnqualifiedId to simplify the Action interface for building
id-expressions. ActOnIdentifierExpr, ActOnCXXOperatorFunctionIdExpr,
ActOnCXXConversionFunctionExpr, and ActOnTemplateIdExpr have all been
removed in favor of the new ActOnIdExpression action.

llvm-svn: 85904
2009-11-03 16:56:39 +00:00
Mike Stump 462a4aa787 Fix documentation.
llvm-svn: 85901
2009-11-03 16:11:57 +00:00
Benjamin Kramer 8a712c7866 Update CMakeLists.
llvm-svn: 85898
2009-11-03 13:37:33 +00:00
Zhongxing Xu 27fee83ec4 Pull VLA size checker into its own files.
Split it to two checkers, one for undefined size, 
the other for zero size, so that we don't need to query the size
when emitting the bug report.

llvm-svn: 85895
2009-11-03 12:13:38 +00:00
Daniel Dunbar 865418a462 Add link to FatELF project.
llvm-svn: 85888
2009-11-03 08:18:34 +00:00
Ted Kremenek 18c7ceee16 Implement: <rdar://problem/6250216> Warn against using -[NSAutoreleasePool release] in GC mode
llvm-svn: 85887
2009-11-03 08:03:59 +00:00
Ted Kremenek 924316d7d7 Move 'static inline' functions GetNullarySelector() and GetUnarySelector() from CFRefCount.cpp to ASTContext.h. These functions are likely to be generally useful.
llvm-svn: 85886
2009-11-03 08:00:42 +00:00
Daniel Dunbar 83e3714902 XFAIL Driver/hello.c on Windows.
llvm-svn: 85885
2009-11-03 07:49:31 +00:00
Zhongxing Xu 9b9d731a8b Pull AttrNonNullChecker into its own files.
llvm-svn: 85883
2009-11-03 07:35:33 +00:00
Daniel Dunbar a3b52d7fb4 Add target_triple to Clang site configuration.
llvm-svn: 85881
2009-11-03 07:25:53 +00:00
Daniel Dunbar a530841b4f Switch XFAIL format to match LLVM.
llvm-svn: 85880
2009-11-03 07:25:45 +00:00
Zhongxing Xu b42929d773 Update CMake file.
llvm-svn: 85879
2009-11-03 07:14:39 +00:00
Ted Kremenek df8016aabb Rename NSErrorCheck to NSErrorChecker.
llvm-svn: 85877
2009-11-03 06:59:59 +00:00
Ted Kremenek 3684c65ded Update CMake file.
llvm-svn: 85876
2009-11-03 06:46:41 +00:00
Zhongxing Xu ab162e1873 Pull UndefinedArgChecker into its own files.
llvm-svn: 85875
2009-11-03 06:46:03 +00:00
Ted Kremenek 66791d5dc5 Fix buffer overflow in PrintMacroDefinition() by inverting the check to see if the target buffer needs to be resized. Fixes <rdar://problem/7255377>.
llvm-svn: 85872
2009-11-03 06:18:05 +00:00
Zhongxing Xu 0deca3486e Pull BadCallChecker into its own files.
llvm-svn: 85868
2009-11-03 05:48:04 +00:00
Ted Kremenek 43edaa8432 retain/release checker: CGBitmapContextCreateWithData() returns an owned object.
llvm-svn: 85867
2009-11-03 05:39:12 +00:00
Ted Kremenek d1b67db2e8 retain/release checker: Add special handling of CGBitmapContextCreateWithData().
Fixes: <rdar://problem/7358899>
llvm-svn: 85864
2009-11-03 05:34:07 +00:00
Chris Lattner 3deabca934 pr5371 likely has nothing to do with this.
llvm-svn: 85862
2009-11-03 05:11:39 +00:00
Mike Stump 92e5f8cb39 Refine codegen for non-virtual this adjustments for thunks.
llvm-svn: 85856
2009-11-03 03:16:46 +00:00
John McCall cfefb6d197 Switch ParseStructDeclaration to a callback-based API. This will make
it easier to track within Sema whether the parser is parsing a declaration.

llvm-svn: 85855
2009-11-03 02:38:08 +00:00
John Thompson 616798c31f Fixed for running on Windows.
llvm-svn: 85854
2009-11-03 02:36:47 +00:00
Mike Stump f358972fdc Add virtual adjustments for this for thunks.
llvm-svn: 85852
2009-11-03 02:12:59 +00:00
Douglas Gregor 7861a80346 Introduce a new class, UnqualifiedId, that provides a parsed
representation of a C++ unqualified-id, along with a single parsing
function (Parser::ParseUnqualifiedId) that will parse all of the
various forms of unqualified-id in C++.

Replace the representation of the declarator name in Declarator with
the new UnqualifiedId class, simplifying declarator-id parsing
considerably and providing more source-location information to
Sema. In the future, I hope to migrate all of the other
unqualified-id-parsing code over to this single representation, then
begin to merge actions that are currently only different because we
didn't have a unqualified notion of the name in the parser.

llvm-svn: 85851
2009-11-03 01:35:08 +00:00
Fariborz Jahanian a386d9533b Assortment of property attributes declared in continuation
class must match those of same property declared
in its primary class. (Fixes radar 7352425)

llvm-svn: 85843
2009-11-03 00:01:38 +00:00
Mike Stump 31e1d43729 Add basic codegen for thunks that return values.
llvm-svn: 85842
2009-11-02 23:47:45 +00:00
Mike Stump 33ccd9e354 Refine codegen for thunks.
llvm-svn: 85839
2009-11-02 23:22:01 +00:00
Ted Kremenek fac290d359 Remove GRExprEngine::CheckerVisitLocation(). It was only called in one place, so we inlined it in to GRExprEngine::EvalLocation().
llvm-svn: 85838
2009-11-02 23:19:29 +00:00
Fariborz Jahanian de8db16a7d Property declared in continuation class can only be used to
change a readonly property declared in the class (and its inherited protocols)
to writable property. (Fixes radar 7350645).

llvm-svn: 85836
2009-11-02 22:45:15 +00:00
John Thompson ac0b098d4d Added __has_include and __has_include_next.
llvm-svn: 85834
2009-11-02 22:28:12 +00:00
Ted Kremenek f639b84bc5 Hopefully make gcc-4.0 happy with respect to the following warning:
warning: 'class clang::StackFrameContext' has virtual functions but non-virtual destructor
llvm-svn: 85833
2009-11-02 22:24:53 +00:00
Daniel Dunbar cb68cdfb03 Sort export list.
llvm-svn: 85832
2009-11-02 22:23:08 +00:00
Daniel Dunbar 1e6add1fbb Remove unused header.
llvm-svn: 85828
2009-11-02 22:11:26 +00:00
Chris Lattner 3fab58d867 clean up namespace.
llvm-svn: 85826
2009-11-02 21:48:09 +00:00
Edward O'Callaghan 06231460b3 Add note to FIXME about PR5371.
llvm-svn: 85825
2009-11-02 21:25:11 +00:00
Ted Kremenek 69e584d12b Add "virtual" keywords for clarity.
llvm-svn: 85815
2009-11-02 18:54:58 +00:00
Fariborz Jahanian ec344ed2f5 Diagnose implementation of a property declared in a category
in its class implementation instead of crashing. Fixes radar 7350345.

llvm-svn: 85813
2009-11-02 18:45:36 +00:00
Douglas Gregor 0840cc02ce When determining whether a reference to a static data member is an
integral constant expression, make sure to find where the initializer
was provided---inside or outside the class definition---since that can
affect whether we have an integral constant expression (and, we need
to see the initializer itself).

llvm-svn: 85741
2009-11-01 20:32:48 +00:00
Douglas Gregor 5897e097a6 Within a template, qualified name lookup can refer to a non-dependent type
that is not known to be a base class at template definition time due
to some dependent base class. Treat qualified name lookup that refers
to a non-static data member or function as implicit class member
access when the "this" type would be dependent.

llvm-svn: 85718
2009-11-01 17:08:18 +00:00
Benjamin Kramer 170a56f135 Add missing colons for FileCheck.
llvm-svn: 85683
2009-10-31 20:42:26 +00:00
Mike Stump 0a65b636ce Fix -pthread on dragonfly. Patch by Sascha Wildner.
llvm-svn: 85679
2009-10-31 20:11:46 +00:00
Mike Stump 75ce573815 Refine vcall/vbase ordering with vtable construction.
llvm-svn: 85677
2009-10-31 20:06:59 +00:00
Douglas Gregor 954de17977 Implement "incremental" template instantiation for non-type template
parameters and template type parameters, which occurs when
substituting into the declarations of member templates inside class
templates. This eliminates errors about our inability to "reduce
non-type template parameter depth", fixing PR5311.

Also fixes a bug when instantiating a template type parameter
declaration in a member template, where we weren't properly reducing
the template parameter's depth.

LLVM's StringSwitch header now parses.

llvm-svn: 85669
2009-10-31 17:21:17 +00:00
Douglas Gregor bff4e7d180 Fix the type of __builtin_expect, from Ed Schouten!
llvm-svn: 85666
2009-10-31 16:04:14 +00:00
Douglas Gregor 249c121883 Add two missing CINDEX_LINKAGE uses, in libCIndex, from Kovarththanan
Rajaratnam!

llvm-svn: 85665
2009-10-31 15:48:08 +00:00
Benjamin Kramer 6b289a9cf6 Update CMake file.
llvm-svn: 85652
2009-10-31 12:15:23 +00:00
Zhongxing Xu b1c24724dd Move CheckDivZero into its own files.
llvm-svn: 85651
2009-10-31 10:02:37 +00:00
Zhongxing Xu 358ced08d0 Move UndefDerefChecker into its own file.
llvm-svn: 85645
2009-10-31 08:44:33 +00:00
Zhongxing Xu 2261bcadd1 Add header comments.
llvm-svn: 85644
2009-10-31 04:12:21 +00:00
Zhongxing Xu 5f5c954329 fix 80-col.
llvm-svn: 85642
2009-10-31 03:36:08 +00:00
Douglas Gregor 326b2fa03e Fix a crazy canonical-types bug because canonicalizing a
dependently-sized array type with a given expression might end up
returning a non-canonical type; see through that non-canonical type to
the underlying canonical type. Yes, I have a test case; no, I can't
reduce it to the point where it's worth checking in :(

llvm-svn: 85633
2009-10-30 22:56:57 +00:00
Douglas Gregor 62b885d43c When looking for a copy-assignment operator to determine the cv-qualifiers on its argument type, ignore assignment operator templates
llvm-svn: 85629
2009-10-30 22:48:49 +00:00
Douglas Gregor bb3b46eb74 When a friend is declared in a dependent context, don't even try to
match it up with a declaration in the outer scope.

llvm-svn: 85628
2009-10-30 22:42:42 +00:00
Douglas Gregor 1d0015f8e1 Improved fix for PR3844, which recovers better for class template
partial specializations and explicit instantiations of non-templates.

llvm-svn: 85620
2009-10-30 22:09:44 +00:00
Ted Kremenek 5c2040b182 Tighten computation of ExprVal using ?: expression. No functionality change.
llvm-svn: 85618
2009-10-30 22:01:29 +00:00
Douglas Gregor 916462b2f7 Improve diagnostics when parsing something like
template<> struct foo<int> { ... };

where "foo" does not refer to a template. Fixes PR3844.

llvm-svn: 85616
2009-10-30 21:46:58 +00:00
Douglas Gregor 412e8bc56d Instantiate class template friends better; fixes PR5332.
llvm-svn: 85612
2009-10-30 21:07:27 +00:00
Daniel Dunbar f3355a61c4 Remove clang-cc code for handling -mmacosx-version-min and
-miphoneos-version-min.

llvm-svn: 85601
2009-10-30 18:12:31 +00:00
Daniel Dunbar 624c21b029 Change the driver to do the Darwin triple mangling itself instead of forwarding
-mmacosx-version-min and -miphoneos-version-min to clang-cc.

llvm-svn: 85600
2009-10-30 18:12:20 +00:00
John McCall edf97c4b02 Finally suppress a compiler warning from gcc on release-asserts. Also fixes
a crash on <vector> in same, which bears additional investigation.

llvm-svn: 85598
2009-10-30 17:53:18 +00:00
Ted Kremenek 6f2a705a24 Make checkers run in deterministic order.
llvm-svn: 85597
2009-10-30 17:47:32 +00:00
Ted Kremenek 89f5c189db Move NullDerefChecker.h instead a 'Checkers' subdirectory.
llvm-svn: 85596
2009-10-30 17:28:40 +00:00
Ted Kremenek f613e89617 Move all logic for the null dereference checker from GRExprEngineInternalChecks.cpp to a separate .cpp file.
llvm-svn: 85595
2009-10-30 17:24:47 +00:00
Douglas Gregor f329c7c3c0 Include macros in code-completion results
llvm-svn: 85594
2009-10-30 16:50:04 +00:00
Benjamin Kramer 53ba5f21ff Doug says this is medium done.
llvm-svn: 85592
2009-10-30 14:54:38 +00:00
Benjamin Kramer c1dea5dded cxx_status: fix some missing/wrong cells.
llvm-svn: 85591
2009-10-30 14:41:58 +00:00
John Thompson b535352681 Re-arranged some internal functions for coming __has_include changes.
llvm-svn: 85589
2009-10-30 13:49:06 +00:00
Benjamin Kramer 305f9f8fed Add C++ include paths for Exherbo. Patch by Daniel Mierswa!
llvm-svn: 85588
2009-10-30 12:57:13 +00:00
Zhongxing Xu b9eda67380 Fix PR5316: make assignment expressions can be visited as lvalue. Then we
can get the correct base lvalue.
Revert r85578.

llvm-svn: 85579
2009-10-30 07:19:39 +00:00
Ted Kremenek e96a30a531 Handle loading of field values from LazyCompoundVals in GRExprEngine::VisitMemberExpr().
This fixes the crash reported in PR 5316.

llvm-svn: 85578
2009-10-30 05:48:30 +00:00
Chris Lattner 252d36e74c warn about returning the address of a label.
llvm-svn: 85576
2009-10-30 04:01:58 +00:00
Anders Carlsson 32e1b1c169 Get throws limping along, still a bunch of FIXMEs. Too bad we don't support catching anything yet :)
llvm-svn: 85574
2009-10-30 02:27:02 +00:00
Anders Carlsson 958c9f8524 Fix thinko, mangleCXXRtti should obviously take a QualType!
llvm-svn: 85565
2009-10-30 01:52:02 +00:00
Anders Carlsson 4b08db7a62 Add CGException.cpp, to be used for exception related code generation.
llvm-svn: 85560
2009-10-30 01:42:31 +00:00
Anders Carlsson 430046321b mangleCXXRtti obviously needs to take a type, what was I thinking...
llvm-svn: 85555
2009-10-30 01:26:12 +00:00
Fariborz Jahanian 6c5a8e2555 This patch computes composite type of two objective-c expressions
used in a conditional expression by finding the most-derived common
super class of the two and qualifies the resulting type by the
intersection of the protocl qualifier list of the two objective-c
pointer types. ( this is continuation of radar 7334235).

llvm-svn: 85554
2009-10-30 01:13:23 +00:00
Anders Carlsson 3f0db2beb1 Add a CK_DerivedToBaseMemberPointer cast kind and use it in Sema (Still no codegen).
llvm-svn: 85552
2009-10-30 00:46:35 +00:00
John McCall 41b215eef6 Include pointee type information in the diagnostic for creating bad pointers or
arrays.

llvm-svn: 85550
2009-10-30 00:37:20 +00:00
John McCall 70dd5f6574 Report accurate source-location information when rebuilding types during
template instantiation.

llvm-svn: 85545
2009-10-30 00:06:24 +00:00
Mike Stump f3eb5ec2c0 Fix one more bug with __builtin_object_size.
llvm-svn: 85538
2009-10-29 23:34:20 +00:00
Mike Stump dc28a8b997 Add yet more testcases.
llvm-svn: 85535
2009-10-29 23:29:54 +00:00
Mike Stump eb5c92b399 Add some more testcases.
llvm-svn: 85534
2009-10-29 23:22:14 +00:00
John McCall 314681a338 Silence a gcc warning where it notices that default-constructing a class
doesn't initialize anything.

llvm-svn: 85533
2009-10-29 23:20:43 +00:00
Douglas Gregor e6fb91f2cb We may need to instantiate a class template specialization as part of a derived-to-base pointer case
llvm-svn: 85532
2009-10-29 23:08:22 +00:00
Douglas Gregor 07cc4ac606 Slightly improve source-location information during template instantiation
llvm-svn: 85529
2009-10-29 22:21:39 +00:00
Steve Naroff f406f4d99b - Add/tweak some comments.
- change ObjCCategoryImplDecl::getCategoryClass() to getCategoryDecl().

No functionality change.

llvm-svn: 85528
2009-10-29 21:11:04 +00:00
Daniel Dunbar 7ad807f248 Move some clang-cc errors to use diagnostics, and simplify.
llvm-svn: 85527
2009-10-29 21:05:18 +00:00
Mike Stump fa50290b49 Fix some issues Daniel pointed out.
llvm-svn: 85526
2009-10-29 20:48:09 +00:00
Sebastian Redl adba46edc2 Properly instantiate usage of overloaded operator []. Fixes PR5345.
llvm-svn: 85524
2009-10-29 20:17:01 +00:00
Steve Naroff a4aeed6958 clang_getDeclSpelling(): For category implementations, make sure we hand back the category name (not the class name). This fixes <rdar://problem/7297518>.
llvm-svn: 85521
2009-10-29 18:55:50 +00:00
John McCall 0d07eb32de A few TemplateArgumentLoc clean-ups. Try to remember the Expr for a declaration.
Provide an API for getting the SourceRange of a TAL and use it judiciously.

llvm-svn: 85520
2009-10-29 18:45:58 +00:00
Douglas Gregor ba91b89711 Yet more instantiation-location information. Fixes PR5336.
llvm-svn: 85516
2009-10-29 17:56:10 +00:00
Fariborz Jahanian c9076fecdf Patch for destruction of array of objects on block exit.
llvm-svn: 85512
2009-10-29 16:22:54 +00:00
Ted Kremenek a4bb75e486 Update checker build.
llvm-svn: 85511
2009-10-29 16:18:45 +00:00
Anders Carlsson 561f793890 Make sure to call CompleteConstructorCall for bases and members that are initialized implicitly in constructors so that default arguments etc are set correctly. Fixes PR5283.
llvm-svn: 85510
2009-10-29 15:46:07 +00:00
Douglas Gregor 2b09590321 Fix Release-Asserts build breakage
llvm-svn: 85509
2009-10-29 15:25:40 +00:00
Nuno Lopes 09bd8656c3 make clang emit undefs for padding of structs and unions instead of zeros. this enables constant compaction optimizations.
llvm-svn: 85504
2009-10-29 11:27:06 +00:00
John McCall 901668f306 Apparently when is now.
llvm-svn: 85501
2009-10-29 08:17:34 +00:00
John McCall 0ad166672f Track source information for template arguments and template specialization
types.  Preserve it through template instantiation.  Preserve it through PCH,
although TSTs themselves aren't serializable, so that's pretty much meaningless.

llvm-svn: 85500
2009-10-29 08:12:44 +00:00
John McCall 588d2d585d Extract TemplateArgument into a new header just for common template
classes.  Move its implementation into a new module.

This will seem marginally more justified in a bit.

llvm-svn: 85499
2009-10-29 07:48:15 +00:00
Zhongxing Xu aa4121d062 Add an assertion to ensure NullDerefChecker exists.
llvm-svn: 85497
2009-10-29 05:56:54 +00:00
Ted Kremenek 1dbdbcc04c Fix accidental use of CheckSVal instead of CheckLocation, and add a
small test case to show we handle dereferences of undefined values.

llvm-svn: 85492
2009-10-29 05:33:39 +00:00
Douglas Gregor 98261735b4 StringSwitch-ify attribute name mapping.
llvm-svn: 85491
2009-10-29 05:26:58 +00:00
Chris Lattner 08bb9ef7f7 make this interpretable.
llvm-svn: 85487
2009-10-29 05:25:27 +00:00
Ted Kremenek 1f0a56e4c9 Fix an insidious bug in RegionStore::RemoveDeadBindings() pointed out
by Zhongxing Xu.  RemoveDeadBindings() would falsely prune
SymbolicRegions from the store that wrapped derived symbols whose
liveness could only be determined after scanning the store.

llvm-svn: 85484
2009-10-29 05:14:17 +00:00
Chris Lattner e963d092d8 add two new and very exhaustive preprocessor tests, patch by
Ken Dyck!

llvm-svn: 85482
2009-10-29 04:55:36 +00:00
Chris Lattner d0952749f7 simplify intmax setup, patch by Ken Dyck!
llvm-svn: 85481
2009-10-29 04:54:24 +00:00
Daniel Dunbar 1a8a2e8e97 Remove some obsolete or unnecessary FIXMEs.
llvm-svn: 85475
2009-10-29 02:39:57 +00:00
Daniel Dunbar 945577ce93 PR5328: Allow duplicatic -pedantic (and -pedantic-errors) options.
- clang-cc doesn't care about their relative order with other -W options.

llvm-svn: 85473
2009-10-29 02:24:45 +00:00
Daniel Dunbar b0b18615e2 Kill off MakeFormattedString helper function.
llvm-svn: 85472
2009-10-29 02:24:37 +00:00
Zhongxing Xu 6b8bfb376b Move NullDeref and UndefDeref into their own checker.
Add a CheckLocation() interface to Checker.
Now ImplicitNullDeref nodes are cached in NullDerefChecker.
More cleanups follow.

llvm-svn: 85471
2009-10-29 02:09:30 +00:00
Daniel Dunbar 38b6279ce4 Reject -I- in driver instead of clang-cc.
llvm-svn: 85469
2009-10-29 01:53:44 +00:00
Daniel Dunbar 938eb27b25 Formatting fixes.
llvm-svn: 85468
2009-10-29 01:53:18 +00:00
Chris Lattner 29fb551a36 make this more interesting, test the static const array.
llvm-svn: 85464
2009-10-29 01:20:34 +00:00
Ted Kremenek 33335b1504 Add test case for <rdar://problem/7342806>.
llvm-svn: 85462
2009-10-29 00:49:46 +00:00
Douglas Gregor f7b87cb529 [llvm up]
Switch a few ugly switch-on-string-literal constructs to use the new
llvm::StringSwitch.

llvm-svn: 85461
2009-10-29 00:41:01 +00:00
Chris Lattner edc56ef41c optimize out some ifdefs.
llvm-svn: 85453
2009-10-29 00:22:00 +00:00
John Thompson e413e88f2e Fix some Window-isms to get these tests to pass on Windows.
llvm-svn: 85450
2009-10-29 00:10:42 +00:00
Douglas Gregor 21610380de Implement support for semantic checking and template instantiation of
class template partial specializations of member templates. Also,
fixes a silly little bug in the marking of "used" template parameters
in member templates. Fixes PR5236.

llvm-svn: 85447
2009-10-29 00:04:11 +00:00
Chris Lattner 6c4d255bf3 Implement clang support for indirect branch and address of label
using the new LLVM support for this.  This is temporarily hiding
behind horrible and ugly #ifdefs until the time when the optimizer
is stable (hopefully a week or so).  Until then, lets make it "opt in" :)

llvm-svn: 85446
2009-10-28 23:59:40 +00:00
Ted Kremenek 1c9401ec15 Unused ivars checker: also check methods in categories that are defined in the same translation unit. Fixes <rdar://problem/6260004>.
llvm-svn: 85442
2009-10-28 22:18:22 +00:00
Steve Naroff f0c8611d3f Fix <rdar://problem/7330784>. Avoid crashing on 'Class<p>' when generating meta-data for a class.
llvm-svn: 85440
2009-10-28 22:03:49 +00:00
Mike Stump 5179f308a2 Refine __builtin_object_size. Don't try and get a size for things
that don't have sizes.

llvm-svn: 85435
2009-10-28 21:22:24 +00:00
Fariborz Jahanian 29baa2b1ba Minor cleanup.
llvm-svn: 85434
2009-10-28 21:07:28 +00:00
Fariborz Jahanian f1639fffbc Code gen for array construction - WIP
llvm-svn: 85432
2009-10-28 20:55:41 +00:00
Steve Naroff 58bd62d190 Remove _clang_initCXLookupHint() and _clang_getCursorWithHint(). Related to <rdar://problem/7310688>.
Localize the optimization to ResolveLocationInAST(). The last valid AST location is now stored with ASTUnit. There still isn't optimal, however it's an improvement (with a much cleaner API). Having the client manage an "hint" is error prone and complex.

I wanted to land the major changes before finishing up the optimizations. 

llvm-svn: 85425
2009-10-28 20:44:47 +00:00
Mike Stump 476e2dfe19 Refactor a bit.
llvm-svn: 85424
2009-10-28 20:44:03 +00:00
Ted Kremenek faba9fe5e4 Pull ivar scanning logic into another utility function. This refactoring will enable scanning
categories as well (WIP). No functionality change yet.

llvm-svn: 85423
2009-10-28 20:37:47 +00:00
Chris Lattner a0c0d88ba8 factor a creation of Int32Ty.
llvm-svn: 85422
2009-10-28 20:36:47 +00:00
Fariborz Jahanian d264ee0cba Use array's base element type in getting to its
constructor. WIP.

llvm-svn: 85420
2009-10-28 19:04:36 +00:00
Fariborz Jahanian 57277c5cae Removed an unnecessary arguement passed to InitializeVarWithConstructor
which should come from the variable and wasn't correct for arrays in any case.
No change in functionality.

llvm-svn: 85415
2009-10-28 18:41:06 +00:00
Fariborz Jahanian 370606afee Restored note on pointer to members with a pointer
to issue involved.

llvm-svn: 85409
2009-10-28 18:06:53 +00:00
Chris Lattner ab5e0af8bc random tidying
llvm-svn: 85408
2009-10-28 17:39:19 +00:00
Fariborz Jahanian 7e4e44f5fa Removed a Note related to pointer to member functions which
does not seem to exist any longer.

llvm-svn: 85405
2009-10-28 17:25:01 +00:00
Fariborz Jahanian 42f666342c Diagnose use of data pointer member in a function call
expression instead of crashing.

llvm-svn: 85401
2009-10-28 16:49:46 +00:00