]> granicus.if.org Git - clang/log
clang
15 years agoMore cleanup.
Anders Carlsson [Fri, 6 Nov 2009 03:23:06 +0000 (03:23 +0000)]
More cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86224 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCleanup ctor/dtor emission.
Anders Carlsson [Fri, 6 Nov 2009 02:55:43 +0000 (02:55 +0000)]
Cleanup ctor/dtor emission.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86222 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHandle ParenExprs in mangleExpression.
Anders Carlsson [Fri, 6 Nov 2009 02:50:19 +0000 (02:50 +0000)]
Handle ParenExprs in mangleExpression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86218 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRefine the vcall for a function that is defined in a virtual base
Mike Stump [Fri, 6 Nov 2009 02:38:24 +0000 (02:38 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86217 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agostatic analyzer: refactor checking logic for returning the address of a stack variabl...
Ted Kremenek [Fri, 6 Nov 2009 02:24:13 +0000 (02:24 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86215 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIf we have a C-style cast, functional cast, or a static_cast to a
Douglas Gregor [Fri, 6 Nov 2009 01:14:41 +0000 (01:14 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86211 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen we encounter a derived-to-base conversion when performing an
Douglas Gregor [Fri, 6 Nov 2009 01:02:41 +0000 (01:02 +0000)]
When we encounter a derived-to-base conversion when performing an
implicit conversion sequence, check the validity of this conversion
and then perform it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86210 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMinor cleanup of my last patch.
Fariborz Jahanian [Fri, 6 Nov 2009 00:55:14 +0000 (00:55 +0000)]
Minor cleanup of my last patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86209 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMinor cleanup: use BuiltinBug (which will soon be renamed) for DeferenceChecker and...
Ted Kremenek [Fri, 6 Nov 2009 00:44:32 +0000 (00:44 +0000)]
Minor cleanup: use BuiltinBug (which will soon be renamed) for DeferenceChecker and friends so that they always report the same bug type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86208 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThis patch implements Sema for clause 13.3.3.1p4.
Fariborz Jahanian [Fri, 6 Nov 2009 00:23:08 +0000 (00:23 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86207 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoConvert file over to checking the .ll file for codegen. Also, we
Mike Stump [Fri, 6 Nov 2009 00:18:25 +0000 (00:18 +0000)]
Convert file over to checking the .ll file for codegen.  Also, we
speed up this file by not doing twice the checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86205 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate clang web pages with respect to Windows
John Thompson [Fri, 6 Nov 2009 00:06:29 +0000 (00:06 +0000)]
Update clang web pages with respect to Windows

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86200 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake sure that EnumConstantDecls always get a type, even when they have type-dependen...
Douglas Gregor [Fri, 6 Nov 2009 00:03:12 +0000 (00:03 +0000)]
Make sure that EnumConstantDecls always get a type, even when they have type-dependent initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86197 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStrip off the /clang/tools/clang at the end of the Subversion URL, if it's there
Douglas Gregor [Thu, 5 Nov 2009 23:46:05 +0000 (23:46 +0000)]
Strip off the /clang/tools/clang at the end of the Subversion URL, if it's there

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86195 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEliminate tabls
John Thompson [Thu, 5 Nov 2009 22:03:02 +0000 (22:03 +0000)]
Eliminate tabls

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86183 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoclean up integer preprocessor type definitions, patch by Ken Dyck!
Chris Lattner [Thu, 5 Nov 2009 21:21:32 +0000 (21:21 +0000)]
clean up integer preprocessor type definitions, patch by Ken Dyck!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86177 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake ASTContext::getIntWidth return 1 for all boolean type variations, not just for...
Sebastian Redl [Thu, 5 Nov 2009 21:10:57 +0000 (21:10 +0000)]
Make ASTContext::getIntWidth return 1 for all boolean type variations, not just for the unqualified, unaliased bool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86174 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThe signed/unsigned checker should not warn for value-dependent expressions, and...
Sebastian Redl [Thu, 5 Nov 2009 21:09:23 +0000 (21:09 +0000)]
The signed/unsigned checker should not warn for value-dependent expressions, and should especially not try to evaluate them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86173 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoBe a little more careful when trying to extract a TypeDecl from a enum/class/struct...
Douglas Gregor [Thu, 5 Nov 2009 20:54:04 +0000 (20:54 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86171 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdding -fshort-wchar option.
John Thompson [Thu, 5 Nov 2009 20:14:16 +0000 (20:14 +0000)]
Adding -fshort-wchar option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86167 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDe-FIXME a test
Douglas Gregor [Thu, 5 Nov 2009 20:02:41 +0000 (20:02 +0000)]
De-FIXME a test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86166 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't allow definitions of array variables without some size information in C++....
Sebastian Redl [Thu, 5 Nov 2009 19:47:47 +0000 (19:47 +0000)]
Don't allow definitions of array variables without some size information in C++. Fixed PR5401

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86165 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnable debug info for global variables at -O1+
Devang Patel [Thu, 5 Nov 2009 19:13:29 +0000 (19:13 +0000)]
Enable debug info for global variables at -O1+

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86156 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdds doxygen comment for HasSideEffects method.
Fariborz Jahanian [Thu, 5 Nov 2009 18:47:38 +0000 (18:47 +0000)]
Adds doxygen comment for HasSideEffects method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86150 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdded support for static variables which require
Fariborz Jahanian [Thu, 5 Nov 2009 18:03:03 +0000 (18:03 +0000)]
Added support for static variables which require
initialization before main. Fixes pr5396.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86145 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEliminate some false positives due to a thinko in the "'blah' is
Douglas Gregor [Thu, 5 Nov 2009 17:49:26 +0000 (17:49 +0000)]
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").

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86143 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd Ubuntu 9.10 libstdc++ install location.
Sebastian Redl [Thu, 5 Nov 2009 17:44:49 +0000 (17:44 +0000)]
Add Ubuntu 9.10 libstdc++ install location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86142 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen collecting types for built-in candidates, make arrays decay to pointers. Otherwi...
Sebastian Redl [Thu, 5 Nov 2009 16:36:20 +0000 (16:36 +0000)]
When collecting types for built-in candidates, make arrays decay to pointers. Otherwise, subscripting an array leads to no candidates at all. Fixes PR5360.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86140 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd clang_site_config user variable, so that extra tests (e.g., utils/C++Syntax)
Daniel Dunbar [Thu, 5 Nov 2009 16:36:19 +0000 (16:36 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86139 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAllow the element type of arrays to be incomplete in C++.
Sebastian Redl [Thu, 5 Nov 2009 15:52:31 +0000 (15:52 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86136 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoParse C++0x constexpr. Test case follows when this does something useful.
Sebastian Redl [Thu, 5 Nov 2009 15:47:02 +0000 (15:47 +0000)]
Parse C++0x constexpr. Test case follows when this does something useful.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86135 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't run anything other than the compiler in these tests.
Daniel Dunbar [Thu, 5 Nov 2009 15:28:24 +0000 (15:28 +0000)]
Don't run anything other than the compiler in these tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86134 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed two places where we needed to force completion of a type
Douglas Gregor [Thu, 5 Nov 2009 13:06:35 +0000 (13:06 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86129 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement the conditional-operator part of -Wsign-compare. Turn
John McCall [Thu, 5 Nov 2009 09:23:39 +0000 (09:23 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86128 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTweak wording and classifications of analyzer diagnostics.
Ted Kremenek [Thu, 5 Nov 2009 08:30:12 +0000 (08:30 +0000)]
Tweak wording and classifications of analyzer diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86127 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate checker build.
Ted Kremenek [Thu, 5 Nov 2009 08:07:41 +0000 (08:07 +0000)]
Update checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86126 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd EXTRA_TESTDIRS variable for specifying additional test directories.
Daniel Dunbar [Thu, 5 Nov 2009 06:55:24 +0000 (06:55 +0000)]
Add EXTRA_TESTDIRS variable for specifying additional test directories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86122 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoReferences can't be zero; omit zero check for return value adjustments
Mike Stump [Thu, 5 Nov 2009 06:32:02 +0000 (06:32 +0000)]
References can't be zero; omit zero check for return value adjustments
in covariant thunks that return references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86121 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRefine covariant return value adjustments for thunks when null
Mike Stump [Thu, 5 Nov 2009 06:12:26 +0000 (06:12 +0000)]
Refine covariant return value adjustments for thunks when null
pointers are returned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86120 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTestcase for a recent checkin.
Mike Stump [Thu, 5 Nov 2009 05:26:28 +0000 (05:26 +0000)]
Testcase for a recent checkin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86118 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate.
Mike Stump [Thu, 5 Nov 2009 05:01:19 +0000 (05:01 +0000)]
Update.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86117 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRefine layout for indirect virtual base classes.
Mike Stump [Thu, 5 Nov 2009 04:02:15 +0000 (04:02 +0000)]
Refine layout for indirect virtual base classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86116 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix 80-col violation.
Mike Stump [Thu, 5 Nov 2009 03:47:55 +0000 (03:47 +0000)]
Fix 80-col violation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86115 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoReplace DiagnosticClient::setLangOptions with {Begin,End}SourceFile, and clarify
Daniel Dunbar [Thu, 5 Nov 2009 02:42:12 +0000 (02:42 +0000)]
Replace DiagnosticClient::setLangOptions with {Begin,End}SourceFile, and clarify
invariants (diagnostics with source informations must occur between
{Begin,End}SourceFile).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86113 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoConvert CreateAnalysisConsumer and friends to just take a const Preprocessor&, and...
Daniel Dunbar [Thu, 5 Nov 2009 02:41:58 +0000 (02:41 +0000)]
Convert CreateAnalysisConsumer and friends to just take a const Preprocessor&, and simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86112 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove unused SetPreprocessor method.
Daniel Dunbar [Thu, 5 Nov 2009 02:41:44 +0000 (02:41 +0000)]
Remove unused SetPreprocessor method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86111 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAnalysisManager: Don't rely on PathDiagnosicClients flushing their diagnostics when...
Ted Kremenek [Thu, 5 Nov 2009 02:17:33 +0000 (02:17 +0000)]
AnalysisManager: Don't rely on PathDiagnosicClients flushing their diagnostics when they are destroyed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86110 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove clang-cc -html-diags option, this doesn't fit in well and we get plenty
Daniel Dunbar [Thu, 5 Nov 2009 02:11:37 +0000 (02:11 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86109 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoActing on Daniel's nagging, remove PathDiagnosticClientFactory() and
Ted Kremenek [Thu, 5 Nov 2009 02:09:23 +0000 (02:09 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86108 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake html::{SyntaxHighlight,HighlightMacros} take a const Preprocessor.
Daniel Dunbar [Thu, 5 Nov 2009 01:54:02 +0000 (01:54 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86107 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake LookUpIdentifierInfo const. This makes the Identifiers table mutable and is
Daniel Dunbar [Thu, 5 Nov 2009 01:53:52 +0000 (01:53 +0000)]
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*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86106 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStringRefize Preprocessor::getIdentifierInfo.
Daniel Dunbar [Thu, 5 Nov 2009 01:53:39 +0000 (01:53 +0000)]
StringRefize Preprocessor::getIdentifierInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86105 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSimplify.
Daniel Dunbar [Thu, 5 Nov 2009 01:53:23 +0000 (01:53 +0000)]
Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86104 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCreatePreprocessor cannot fail
Daniel Dunbar [Thu, 5 Nov 2009 01:53:12 +0000 (01:53 +0000)]
CreatePreprocessor cannot fail

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86103 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen instantiating a UnaryOperator, allow the resulting expression to
Douglas Gregor [Thu, 5 Nov 2009 00:51:44 +0000 (00:51 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86087 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoModify GRExprEngine::EvalBind() to take both a "store expression" and
Ted Kremenek [Thu, 5 Nov 2009 00:42:23 +0000 (00:42 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86084 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement -Wsign-compare, or at least the actual comparison part of it.
John McCall [Thu, 5 Nov 2009 00:40:04 +0000 (00:40 +0000)]
Implement -Wsign-compare, or at least the actual comparison part of it.
Conditional operands are next.

Fixes part of rdar://problem/7289584.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86083 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake sure to grab CVR qualifiers from the canonical type. ARGH!
Douglas Gregor [Thu, 5 Nov 2009 00:07:36 +0000 (00:07 +0000)]
Make sure to grab CVR qualifiers from the canonical type. ARGH!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86079 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoKill PreprocessorFactory, which was both morally repugnant and totally unused.
Daniel Dunbar [Wed, 4 Nov 2009 23:56:25 +0000 (23:56 +0000)]
Kill PreprocessorFactory, which was both morally repugnant and totally unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86076 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTurn if chain into switch.
Daniel Dunbar [Wed, 4 Nov 2009 23:41:40 +0000 (23:41 +0000)]
Turn if chain into switch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86071 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTweak formatting.
Daniel Dunbar [Wed, 4 Nov 2009 23:41:27 +0000 (23:41 +0000)]
Tweak formatting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86070 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen instantiating a MemberExpr, be sure to instantiate the
Douglas Gregor [Wed, 4 Nov 2009 23:20:05 +0000 (23:20 +0000)]
When instantiating a MemberExpr, be sure to instantiate the
explicitly-specified template arguments, too!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86066 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoComments, formatting. Based on patch by Brandon Pearcy!
John McCall [Wed, 4 Nov 2009 23:13:52 +0000 (23:13 +0000)]
Comments, formatting.  Based on patch by Brandon Pearcy!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86065 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoA simple reordering of the definitions in stdint.h and
Chris Lattner [Wed, 4 Nov 2009 23:03:18 +0000 (23:03 +0000)]
A simple reordering of the definitions in stdint.h and
introduces no new function changes.   Patch by Ken Dyck!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86062 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDiagnose using a field to initialize itself. Patch by Brandon Pearcy!
John McCall [Wed, 4 Nov 2009 23:02:40 +0000 (23:02 +0000)]
Diagnose using a field to initialize itself.  Patch by Brandon Pearcy!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86061 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen starting a C++ member access expression, make sure to compute the
Douglas Gregor [Wed, 4 Nov 2009 22:49:18 +0000 (22:49 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86060 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoignore two new -W flags, patch by Tom Jablin!
Chris Lattner [Wed, 4 Nov 2009 22:47:56 +0000 (22:47 +0000)]
ignore two new -W flags, patch by Tom Jablin!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86059 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGive DeclarationName's operator< a more predictable, useful ordering
Douglas Gregor [Wed, 4 Nov 2009 22:24:30 +0000 (22:24 +0000)]
Give DeclarationName's operator< a more predictable, useful ordering

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86055 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed for running on Windows.
John Thompson [Wed, 4 Nov 2009 21:52:17 +0000 (21:52 +0000)]
Fixed for running on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86053 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix a little canonical-types issue with non-type template arguments.
Douglas Gregor [Wed, 4 Nov 2009 21:50:46 +0000 (21:50 +0000)]
Fix a little canonical-types issue with non-type template arguments.
Fixes PR5349.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86052 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInitializePreprocessor cannot fail.
Daniel Dunbar [Wed, 4 Nov 2009 21:13:15 +0000 (21:13 +0000)]
InitializePreprocessor cannot fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86048 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove -undef flag into PreprocessorInitOptions
Daniel Dunbar [Wed, 4 Nov 2009 21:13:02 +0000 (21:13 +0000)]
Move -undef flag into PreprocessorInitOptions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86047 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd code gen for pointer-to-member function in
Fariborz Jahanian [Wed, 4 Nov 2009 19:13:37 +0000 (19:13 +0000)]
Add code gen for pointer-to-member function in
ctor's initializer. Fixes pr5178.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86040 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoProperly replace (cxxscope, template-id) annotation tokens with a
Douglas Gregor [Wed, 4 Nov 2009 18:18:19 +0000 (18:18 +0000)]
Properly replace (cxxscope, template-id) annotation tokens with a
single typename annotation token when backtracing. Fixes PR5350.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86034 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThis patch extends CleanupScope to support destruction
Fariborz Jahanian [Wed, 4 Nov 2009 17:57:40 +0000 (17:57 +0000)]
This patch extends CleanupScope to support destruction
of array objects on block exit. Patch is by Anders Calrsson.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86032 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't try to check the initialization of fields with dependent
Douglas Gregor [Wed, 4 Nov 2009 17:16:11 +0000 (17:16 +0000)]
Don't try to check the initialization of fields with dependent
types. Fixes PR5352.

Fariborz, please review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86031 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStore the unresolved class type in MemberPointerType's Class field,
Douglas Gregor [Wed, 4 Nov 2009 16:49:01 +0000 (16:49 +0000)]
Store the unresolved class type in MemberPointerType's Class field,
from Peter Collingbourne!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86030 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agothis test has started failing due to an optimizer change. Clang tests
Chris Lattner [Wed, 4 Nov 2009 16:37:13 +0000 (16:37 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86029 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEliminate the "old" ways of parsing operator-function-ids and
Douglas Gregor [Wed, 4 Nov 2009 16:32:12 +0000 (16:32 +0000)]
Eliminate the "old" ways of parsing operator-function-ids and
conversion-function-ids; all clients have moved on to
ParseUnqualifiedId.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86028 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSwitch parsing of using declarations over to ParseUnqualifiedId.
Douglas Gregor [Wed, 4 Nov 2009 16:30:06 +0000 (16:30 +0000)]
Switch parsing of using declarations over to ParseUnqualifiedId.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86027 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPreserve type source information in sizeof/alignof expressions, and pass it
John McCall [Wed, 4 Nov 2009 07:28:41 +0000 (07:28 +0000)]
Preserve type source information in sizeof/alignof expressions, and pass it
through to indexing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86018 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen performing template instantiation (transformation) of
Douglas Gregor [Wed, 4 Nov 2009 07:01:15 +0000 (07:01 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86017 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix commento.
Daniel Dunbar [Wed, 4 Nov 2009 06:57:08 +0000 (06:57 +0000)]
Fix commento.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86016 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate CMake.
Daniel Dunbar [Wed, 4 Nov 2009 06:39:40 +0000 (06:39 +0000)]
Update CMake.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86015 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove -fcolor-diagnostics logic to driver.
Daniel Dunbar [Wed, 4 Nov 2009 06:24:57 +0000 (06:24 +0000)]
Move -fcolor-diagnostics logic to driver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86014 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove logic for selection -fmessage-length= to driver.
Daniel Dunbar [Wed, 4 Nov 2009 06:24:47 +0000 (06:24 +0000)]
Move logic for selection -fmessage-length= to driver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86013 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix indentation.
Daniel Dunbar [Wed, 4 Nov 2009 06:24:38 +0000 (06:24 +0000)]
Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86011 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFactor out a diagnostic options class.
Daniel Dunbar [Wed, 4 Nov 2009 06:24:30 +0000 (06:24 +0000)]
Factor out a diagnostic options class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86010 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd FIXME.
Ted Kremenek [Wed, 4 Nov 2009 04:24:44 +0000 (04:24 +0000)]
Add FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86004 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCatch uses of undefined values when they are used in assignment, thus catching such...
Ted Kremenek [Wed, 4 Nov 2009 04:24:16 +0000 (04:24 +0000)]
Catch uses of undefined values when they are used in assignment, thus catching such bugs closer to the source.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86003 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd mising #ifdef guards.
Ted Kremenek [Wed, 4 Nov 2009 04:03:43 +0000 (04:03 +0000)]
Add mising #ifdef guards.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86002 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDiagnose the use of 'fastcall' on functions without prototypes or with
John McCall [Wed, 4 Nov 2009 03:36:09 +0000 (03:36 +0000)]
Diagnose the use of 'fastcall' on functions without prototypes or with
varargs prototypes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86001 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDiagnose __builtin_offsetof on incomplete types. Fixes
John McCall [Wed, 4 Nov 2009 03:03:43 +0000 (03:03 +0000)]
Diagnose __builtin_offsetof on incomplete types.  Fixes
rdar://problem/7222956

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85999 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange our basic strategy for avoiding deprecation warnings when the decl use
John McCall [Wed, 4 Nov 2009 02:18:39 +0000 (02:18 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85998 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMerge ZeroSizedVLAChecker and UndefSizedVLAChecker.
Zhongxing Xu [Wed, 4 Nov 2009 01:43:07 +0000 (01:43 +0000)]
Merge ZeroSizedVLAChecker and UndefSizedVLAChecker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85996 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMerge constant array and structures. This will create a global variables for arrays...
Tanya Lattner [Wed, 4 Nov 2009 01:18:09 +0000 (01:18 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85991 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix 80-col violations.
Mike Stump [Wed, 4 Nov 2009 01:11:15 +0000 (01:11 +0000)]
Fix 80-col violations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85990 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement support for parsing dependent template-ids that refer to
Douglas Gregor [Wed, 4 Nov 2009 00:56:37 +0000 (00:56 +0000)]
Implement support for parsing dependent template-ids that refer to
overloaded operators, e.g.,

  p->template operator+<T>()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85989 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSplit out return adjustments in thunks from this adjustment in thunks
Mike Stump [Wed, 4 Nov 2009 00:53:51 +0000 (00:53 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85988 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse unsigned char instead of unsigned : 8 to make the optimizer happier.
Daniel Dunbar [Wed, 4 Nov 2009 00:34:40 +0000 (00:34 +0000)]
Use unsigned char instead of unsigned : 8 to make the optimizer happier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85985 91177308-0d34-0410-b5e6-96231b3b80d8