Граф коммитов

18122 Коммитов

Автор SHA1 Сообщение Дата
John McCall 5126fd0dd9 Typedefs can be redeclared. That seems like something we should record in
the AST lest we run into some crazy canonicalization bug like PR5874.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92283 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 00:31:22 +00:00
Eli Friedman 4df6ec10e0 Test for PR5908.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 00:20:14 +00:00
Eli Friedman 2333f7727f Make sure to explicitly pass type/value dependence to Expr constructor. This
caught several cases where we were not doing the right thing. I'm
not completely sure all cases are being handled correctly, but this should
be an improvement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92281 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 00:13:48 +00:00
Anders Carlsson c8cfd636f6 Match gcc and treat vector types as fundamental types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 22:30:11 +00:00
Anders Carlsson 9c7b6bb952 Handle enum types as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 22:13:01 +00:00
Anders Carlsson 978ef68bc4 Test linkage of RTTI descriptors of array types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 21:58:32 +00:00
Anders Carlsson 09b6e6e885 Fix function type RTTI linkage and add tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 20:20:19 +00:00
Chandler Carruth 595e290bcb Fix support for const_cast<>s of array types which actual change the
CV-qualifiers. Remove an error expectation from the 'good' set of const-cast
test cases. With this patch, the final non-template test case from PR5542
passes. (It's the same as the one already in const-cast.cpp.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 08:05:19 +00:00
Chris Lattner 1280708c17 strength reduce this call away.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92253 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:49:13 +00:00
Chris Lattner b175666363 fix whitespace in test to match llvm asmprinter change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92251 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:42:23 +00:00
Chandler Carruth 28e318cc60 Correctly refer to element CVR qualifications when determining if a type is
more or less cv-qualified than another during implicit conversion and overload
resolution ([basic.type.qualifier] p5). Factors the logic out of template
deduction and into the ASTContext so it can be shared.

This fixes several aspects of PR5542, but not all of them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92248 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:16:59 +00:00
Anders Carlsson f5f7d864f5 Get rid of FixedWidthIntType, as suggested by Chris and Eli.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:07:36 +00:00
Chandler Carruth bd64729ac6 Handle using declarations in overloaded and template functions during ADL and
address resolution. This fixes PR5751.

Also, while we're here, remove logic from ADL which mistakenly included the
definition namespaces of overloaded and/or templated functions whose name or
address is used as an argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92245 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 06:17:27 +00:00
Chris Lattner 23e92c059c adjust for llvm api changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92236 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 23:41:39 +00:00
Chris Lattner d5b8902c03 this form of SetDebugLocation is about to go away, add some #includes that
are about to not come in implicitly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92228 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:44:41 +00:00
Zhongxing Xu 2d3dfd70ee Adjust indentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92205 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 06:52:51 +00:00
Zhongxing Xu a3ddec2b5e Fix 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92204 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 06:49:22 +00:00
Chris Lattner 4fe739f293 use best-fit instead of first-fit when reusing a MacroArgs object,
this speeds up Eonly on the testcase in PR5888 from 30.5s to 0.85s


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92203 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 06:36:46 +00:00
Chris Lattner f5809a7b76 The PreExpArgTokens array is indexed with an argument #,
not a token number.  Fix the reserve logic to get the right
amount of space.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92202 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 06:17:16 +00:00
Sam Weinig 3521d01aed Fix for PR5871. Make __PRETTY_FUNCTION__ work for member functions defined in a class local to a function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92200 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 03:19:38 +00:00
Eli Friedman 64a4eb277f Make sure to give an error for template argument lists followed by junk.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92177 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-27 22:31:18 +00:00
Anton Korobeynikov 83c2a98012 Promote arguments of frameaddr / returnaddr builtins to i32 type, when needed.
This is needed for the platforms, where bitwidth of "int" is not 32 bits
(e.g. 16 on msp430).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-27 14:27:22 +00:00
Eli Friedman 8f5d7404da Add a sanity assertion so that we don't silently generate bad code; I'll file
a bug with a testcase hitting this assertion in a moment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-27 07:02:50 +00:00
Eli Friedman 190ccccdc4 Fix runline.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92174 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-27 05:59:41 +00:00
Eli Friedman 09a8a0e6ec Fix PointerExprEvaluator::VisitCastExpr so it doesn't misfold C++ casts which
it doesn't know how to fold, like derived-to-base casts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-27 05:43:15 +00:00
Eli Friedman a6f98fb644 Fix obvious mistake.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-27 03:44:17 +00:00
Sam Weinig 4eadcc5692 Fix for PR5872. Add static specifier and const/volatile qualifiers to member functions in __PRETTY_FUNCTION__ predefined expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92171 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-27 01:38:20 +00:00
Daniel Dunbar a799cefcff Tests: Tweak LLVM-Code-Symbols test to ignore common and undefined symbols for
now, let's start small.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92170 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-26 22:58:48 +00:00
Eli Friedman efa42f7d88 Don't look through casts when looking for the underlying decl for a function
call; the standard doesn't expect us to, and the program could be doing
something crazy.  Fixes PR5882.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92166 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-26 03:35:45 +00:00
Eli Friedman e6d11b75f6 Attempted fix for PR5884; this code will be dead soon, but this fix should
help for the moment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-25 23:59:21 +00:00
Daniel Dunbar 0dea4be511 Driver: Use "g++" as generic gcc name when running in C++ mode, for platforms
that lack real tool definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-25 20:21:23 +00:00
Benjamin Kramer 0235d1510d Make sure operator new[] and operator delete[] match. This will hopefully silence 3 remaining MSVC warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-25 17:06:27 +00:00
Benjamin Kramer 54d76db0aa Remove some dead variables clang-analyzer found.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92162 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-25 15:43:36 +00:00
Benjamin Kramer 9c825c3f77 Fix typo spotted by MSVC.
GRExprEngine.cpp(1348) : warning C4305: 'argument' : truncation from 'clang::ProgramPoint::Kind' to 'bool'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92154 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-25 09:44:02 +00:00
Eli Friedman 8e274bd14b Minor optimization; emit proper unsupported messages for a couple of cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-25 06:17:05 +00:00
Eli Friedman ab18995090 Some small improvements to dead code elimination; helps a bit on
LLVM-Code-Symbols test.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92152 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-25 05:29:40 +00:00
Eli Friedman cb48f8a60a Make copy constructor elimination work in more cases; the case in question
here affects clang-on-clang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92151 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 23:33:34 +00:00
Sam Weinig 6be112049b Fix for PR5844. Be explicit about anonymous struct/class/union/namespaces in __PRETTY_FUNCTION__ predefined expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92149 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 23:15:03 +00:00
Anders Carlsson 607d037c3f Move a bunch of class related functions to CGClass.cpp, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92148 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 22:46:43 +00:00
Daniel Dunbar e868669d42 Sketch a simple new C++Tests suite for checking that llvm-gcc and clang generate
the same visible symbols, useful for finding ABI/Mangler/vtable/etc. issues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 21:27:38 +00:00
Anders Carlsson a1736c0c75 Pass the return value slot to all call exprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 21:13:40 +00:00
Douglas Gregor 7557a1348d Egregious, disgusting workaround for PR5866. We need to rework how we
keep track of friends within templates, which will provide a real for
PR5866. For now, this makes sure we don't do something entirely stupid
with friends of specializations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92143 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 20:56:24 +00:00
Anders Carlsson d2490a9134 Fill in the return value slot in CGExprAgg::VisitCallExpr. This takes us halfway towards fixing PR5824.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 20:40:36 +00:00
Douglas Gregor 8aa5f407d9 Add test case for PR5868, and improve location information slightly for implicit "this" expressions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92141 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 20:23:34 +00:00
Anders Carlsson 25c92e6c29 Add a test for x86-64 struct returns under gc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92140 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 20:21:41 +00:00
Douglas Gregor 83a56c4a1d When rebuilding a MemberExpr that refers to an anonymous union, be
sure to perform derived-to-base conversions on the base
expression. Fixes PR5868. Proper testcase is coming soon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92139 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 20:02:50 +00:00
Anders Carlsson f3c47c9525 Pass ReturnValueSlot to EmitCall. No functionality change yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 19:25:24 +00:00
Daniel Dunbar 5184626563 Fix -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92137 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 19:19:26 +00:00
Anders Carlsson 31777a2540 Add a ReturnValueSlot class. Change the argument order in EmitCall to match the other overload better.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92136 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 19:08:58 +00:00
Douglas Gregor 5132655e42 When transforming CXXExprWithTemporaries and CXXBindTemporaryExpr
expressions (e.g., for template instantiation), just transform the
subexpressions and return those, since the temporary-related nodes
will be implicitly regenerated. Fixes PR5867, but I said that
before...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92135 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 18:51:59 +00:00