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

15275 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor fc9cd61f23 Simplify the handling of non-dependent friend class template
specializations such as:

  friend class std::vector<int>;

by using the same code path as explicit specializations, customized to
reference an existing ClassTemplateSpecializationDecl (or build a new
"undeclared" one).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82875 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 20:57:03 +00:00
Anders Carlsson e7c8cb6b27 Substitute "::std::" as "St".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 20:53:44 +00:00
Anders Carlsson 1668f2062b Don't crash when trying to mangle function templates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82872 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 20:13:56 +00:00
Anders Carlsson 0fa6df4400 mangleTemplatePrefix and mangleUnscopedTemplateName should take a TemplateDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 19:45:45 +00:00
Anders Carlsson 6b7fc1344d Use the qualified name for tag types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82870 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 19:03:24 +00:00
Anders Carlsson 41f8a13ac7 Set alignment on static function level decls and VLAs. Fixes PR5060.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82868 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 18:16:06 +00:00
Ted Kremenek 022a1253c0 Added test case for <rdar://problem/7152418>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82866 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 17:18:44 +00:00
Anders Carlsson ff2460883b Address comment from Daniel.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82865 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 16:55:29 +00:00
Dan Gohman b8d42397aa Pass the formatted_raw_ostream to createPrintModulePass and
createBitcodeWriterPass instead of the underlying raw_ostream. This
avoids trouble with formatted_raw_ostream's behavior of setting the
underlying stream to be unbuffered, which resulted in
clang -emit-llvm -S using unbuffered output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82857 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 15:06:14 +00:00
Daniel Dunbar 1abe5c306c Revert "Force triple in test.", this wasn't the problem.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82855 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 07:43:49 +00:00
Ted Kremenek 9031486059 Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82854 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 07:39:39 +00:00
Daniel Dunbar 9e10cc7a4c Add the lib path to LD_LIBRARY_PATH, so finding .so works (more) portably.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 07:36:09 +00:00
Daniel Dunbar c22dd4d731 Force triple in test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82850 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 07:06:36 +00:00
Douglas Gregor 6102d98f3b Fix name lookup for friend class templates to consider anything in a
scope *up to and including* the innermost namespace scope, rather than
just searching in the innermost namespace scope. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 07:05:09 +00:00
Douglas Gregor d85bea2aff Rework the Parse-Sema interaction for friends to better support friend
class templates. We now treat friend class templates much more like
normal class templates, except that they still get special name lookup
rules. Fixes PR5057 and eliminates a bunch of spurious diagnostics in
<iostream>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 06:47:28 +00:00
Ted Kremenek 74e3c92aa3 Hoist some branches in AnalysisManager::HandleTranslationUnit so we
avoid scanning for an "entry point" FunctionDecl if we (a) have no
translation unit actions and (b) no entry point function has been
specified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82846 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 04:15:09 +00:00
Anders Carlsson 5b3a2fcd80 Use ABIArgInfo::getDirect() for all types that have a pointer representation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 03:56:53 +00:00
Douglas Gregor 312a202418 Yet another simplifying use of Sema::getMostSpecialized
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82844 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 03:56:17 +00:00
Anders Carlsson d99edc4430 Mangle record types as decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82843 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 03:55:37 +00:00
Ted Kremenek e7c9645c00 Add a "positive" matching test case for attribute 'noreturn' that involves a nested infinite loop.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82842 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 03:54:06 +00:00
Ted Kremenek f679a986df Add two more test cases for attribute 'noreturn'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82841 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 03:48:56 +00:00
Douglas Gregor c5df30fe34 Use Sema::getMostSpecialized to eliminate a redundant implementation of the most-specialized function template
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82840 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 03:41:46 +00:00
Anders Carlsson bb36ba488b Change isTemplate to return the actual template declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82839 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 03:24:57 +00:00
Anders Carlsson ae35248661 Improve mangling of typename types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 02:26:02 +00:00
Anders Carlsson a223935e5c Rename NextOffset to DataSize.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82832 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 01:34:51 +00:00
Anders Carlsson dfde681bdd Start at NextOffset when laying out bases as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82831 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 01:29:10 +00:00
Daniel Dunbar 1cf13cdc2c Disable c-index-test on MSVC until someone figures out the real problem.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 01:21:38 +00:00
Anders Carlsson 7e41038723 Use NextOffset when laying out a field.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 01:09:35 +00:00
Anders Carlsson 4f5bf3b095 Don't try to dump invalid decls or forward decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 01:02:04 +00:00
Anders Carlsson 3c31a39af9 Cast cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82826 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 00:12:34 +00:00
Douglas Gregor 0b60d9e009 Use explicitly-specified template argument lists to help naming
explicit template specializations, when available.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 23:53:26 +00:00
Steve Naroff 7416524283 Fix cut/paste error resulting in bad column info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 22:15:54 +00:00
Steve Naroff ee9405e807 Add clang_getDeclSource().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 21:45:39 +00:00
Douglas Gregor db422dffb7 Declarators can now properly represent template-ids, e.g., for
template void f<int>(int);
                ~~~~~~
Previously, we silently dropped the template arguments. With this
change, we now use the template arguments (when available) as the
explicitly-specified template arguments used to aid template argument
deduction for explicit template instantiations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 21:45:23 +00:00
Steve Naroff 699a07d8a0 Add clang_getDeclLine and clang_getDeclColumn
Fix clang_getCursorDecl to do the right thing for expr refs
Fixup test file to accommodate new output (which includes the line/column for the referenced decl)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 21:32:34 +00:00
Fariborz Jahanian b3c477415f Refixed pr5050 per Anders comment. Test case enhanced
per Doug's comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82791 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 18:59:21 +00:00
Douglas Gregor d5a423b279 WIP implementation of explicit instantiation of function templates,
member functions of class template specializations, and static data
members. The mechanics are (mostly) present, but the semantic analysis
is very weak.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 18:43:00 +00:00
Fariborz Jahanian 7498e50aea Fix the AST tree so ir-gen can do the conversion via copy construction.
Fixed pr5050.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82783 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 18:11:25 +00:00
Mike Stump bcdc0f0aff Fix 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82782 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 18:11:00 +00:00
Chris Lattner b0802c9f50 pcc supports some c99
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 16:45:10 +00:00
Anders Carlsson 1eca99b815 Even more work on empty classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82770 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 15:39:00 +00:00
Benjamin Kramer bdbeeb50c5 Fix MSVC build by renaming a variable. PR5043
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 11:47:22 +00:00
Douglas Gregor 0ed093069a Sigh. Be *really* careful when copying a default function argument during template instantiation
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82761 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 07:03:22 +00:00
Douglas Gregor f43d0b37c1 Be careful about copying uninstantiated default arguments during template instantiation
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 06:56:31 +00:00
Douglas Gregor d781a39b9e Don't look for __builtin_va_list; it isn't present for all targets
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 06:44:41 +00:00
Douglas Gregor ac47bc76fe CMake build support for libCIndex and c-index-test. The indexing tests
are now running properly from within CMake.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 06:35:15 +00:00
Ted Kremenek b8bb3e797c Turn on 'RegionStore' as the default store manager both for 'clang --analyze' and 'scan-build'. Leave 'BasicStore' as the default store manager in 'clang-cc'. While there are still known warts with RegionStore, it's ready to be tested by general users.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 05:55:59 +00:00
Douglas Gregor 9773f6065b Hide clang-wpa executable behind a CMake variable so it won't be built by default
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 05:41:21 +00:00
Ted Kremenek a24563abb0 Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 05:03:45 +00:00
Douglas Gregor ce94049b69 Fix checking for a null pointer constant when the expression itself is
value-dependent. Audit (and fixed) all calls to
Expr::isNullPointerConstant() to provide the correct behavior with
value-dependent expressions. Fixes PR5041 and a crash in libstdc++
<locale>.

In the same vein, properly compute value- and type-dependence for
ChooseExpr. Fixes PR4996.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82748 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 04:25:58 +00:00