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

8284 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek c8b44f5997 Temporarily disable PTH stat caching as it appears to be failing on some machines.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64354 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 03:36:54 +00:00
Ted Kremenek 337edcdbec PTH: Cache stat information for files in the PTH file. Hook up FileManager
to use this stat information in the PTH file using a 'StatSysCallCache' object.

Performance impact (Cocoa.h, PTH):
- number of stat calls reduces from 1230 to 425
- fsyntax-only: time improves by 4.2% 

We can reduce the number of stat calls to almost zero by caching negative stat
calls and directory stat calls in the PTH file as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64353 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 03:26:59 +00:00
Ted Kremenek 96438f319b FileManager:
- set the 'StatSysCallCache' object using a setter method instead of
  FileManager's constructor. This allows the cache to be installed after the
  FileManager object is created.
- Add 'file mode' to FileEntry (useful for stat caching)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64351 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 03:17:57 +00:00
Mike Stump 8ba82b3668 Add tags; this is documented to work, just need the wiring to enable it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 02:25:47 +00:00
Chris Lattner 05e7c6d29c for now, disable all debug info generation at -O1 and above. This mirrors
similar logic in llvm-gcc and will hopefully be fixed soon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 01:50:58 +00:00
Chris Lattner 3102c83f6e search and replaceo?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64348 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 01:37:35 +00:00
Douglas Gregor 241540eb1c Add test for overloading with _Complex in C
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 00:57:03 +00:00
Anders Carlsson acfde805d6 Add support for generating block call expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 00:39:25 +00:00
Ted Kremenek fc7052d4a2 Add lightweight shim "clang::StatSysCallCache" that caches 'stat' system calls
for use by FileManager. FileManager now takes a StatSysCallCache* in its
constructor (which defaults to NULL). This will be used for evaluating whether
or not caching 'stat' system calls in PTH is a performance win. This shim adds
no observable performance impact in the case where the 'StatSysCallCache*' is
null.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64345 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 00:39:05 +00:00
Douglas Gregor b7b5d13de3 Expand the definition of a complex promotion to include complex ->
complex conversions where the conversion between the real types is an
integral promotion. This is how G++ handles complex promotions for its
complex integer extension.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64344 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 00:26:06 +00:00
Douglas Gregor 5cdf82164d Introduce _Complex conversions into the function overloading
system. Since C99 doesn't have overloading and C++ doesn't have
_Complex, there is no specification for    this. Here's what I think
makes sense.

Complex conversions come in several flavors:

  - Complex promotions:  a complex -> complex   conversion where the
    underlying real-type conversion is a floating-point promotion. GCC
    seems to call this a promotion, EDG does something else. This is
    given "promotion" rank for determining the best viable function.
  - Complex conversions: a complex -> complex conversion that is
    not a complex promotion. This is given "conversion" rank for
    determining the best viable   function.
  - Complex-real conversions: a real -> complex or complex -> real
    conversion. This is given "conversion" rank for determining the
    best viable function.

These rules are the same for C99 (when using the "overloadable"
attribute) and C++. However, there is one difference in the handling
of floating-point promotions: in C99, float -> long double and double
-> long double are considered promotions (so we give them "promotion" 
rank), while C++ considers these conversions ("conversion" rank).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 00:15:05 +00:00
Fariborz Jahanian c657eba43f Last @encode'ing fix for objc2's nonfragile abi.
All relevant dejagnu enocding tests pass in this mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64341 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 23:59:18 +00:00
Ted Kremenek a4bd8eb4d6 PTH: Have meta data be at the beginning of the PTH file, not the end.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64338 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 23:34:32 +00:00
Mike Stump 1a35fdee6c Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 23:03:27 +00:00
Douglas Gregor f9201e0ff1 Initial implementation of function overloading in C.
This commit adds a new attribute, "overloadable", that enables C++
function overloading in C. The attribute can only be added to function
declarations, e.g.,

  int *f(int) __attribute__((overloadable));

If the "overloadable" attribute exists on a function with a given
name, *all* functions with that name (and in that scope) must have the
"overloadable" attribute. Sets of overloaded functions with the
"overloadable" attribute then follow the normal C++ rules for
overloaded functions, e.g., overloads must have different
parameter-type-lists from each other.

When calling an overloaded function in C, we follow the same
overloading rules as C++, with three extensions to the set of standard
conversions:

  - A value of a given struct or union type T can be converted to the
    type T. This is just the identity conversion. (In C++, this would
    go through a copy constructor).
  - A value of pointer type T* can be converted to a value of type U*
    if T and U are compatible types. This conversion has Conversion
    rank (it's considered a pointer conversion in C).
  - A value of type T can be converted to a value of type U if T and U
    are compatible (and are not both pointer types). This conversion
    has Conversion rank (it's considered to be a new kind of
    conversion unique to C, a "compatible" conversion).

Known defects (and, therefore, next steps):
  1) The standard-conversion handling does not understand conversions
  involving _Complex or vector extensions, so it is likely to get
  these wrong. We need to add these conversions.
  2) All overloadable functions with the same name will have the same
  linkage name, which means we'll get a collision in the linker (if
  not sooner). We'll need to mangle the names of these functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64336 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 23:02:49 +00:00
Fariborz Jahanian 72696e17f9 Patch to fix encoding in 64bit abi. With this patch
all but one dejagnu encoding tests for darwin
pass in nonfragile abi mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64334 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 22:31:45 +00:00
Daniel Dunbar 0785570af3 Use EmitVAListRef instead of EmitLValue directly to handle array decay
case on x86_64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64333 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 22:25:55 +00:00
Steve Naroff fea2511665 Remove some non-ascii characters. Thanks Gabor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64330 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 22:01:48 +00:00
Ted Kremenek 7e3a004c6e PTH: Replace string identifier to persistent ID lookup with a hashtable. This is
actually *slightly* slower than the binary search. Since this is algorithmically
better, further performance tuning should be able to make this faster.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 21:29:16 +00:00
Daniel Dunbar 5b5c9ef865 Support IRgen of va_arg of structure as l-value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64325 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 20:59:32 +00:00
Fariborz Jahanian 26cc89ffb1 ir-gen for objc's @selector expression in nonfragile abi mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 20:51:17 +00:00
Douglas Gregor 1bc6913e7a Appease the language lawyers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 20:46:19 +00:00
Steve Naroff 84c4310886 Fix <rdar://problem/6505139> [clang on growl]: need to allow unnamed selectors as the first argument
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64320 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 20:43:13 +00:00
Steve Naroff e21dd6ffef Fix <rdar://problem/6243503> [sema] @throw; accepted outside catch block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 20:05:44 +00:00
Douglas Gregor cc45cb3630 Finished semantic analysis of non-type template arguments, to check
for non-external names whose address becomes the template
argument. This completes C++ [temp.arg.nontype]p1.

Note that our interpretation of C++ [temp.arg.nontype]p1b3 differs
from EDG's interpretation (we're stricter, and GCC agrees with
us). They're opening a core issue about the matter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64317 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 19:52:55 +00:00
Mike Stump 5fa77e9662 Avoid bogus warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 18:58:46 +00:00
Douglas Gregor 8e6563ba09 Reverted r64307. Moved hasSameType and hasSameUnqualifiedType from
Sema to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64312 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 18:22:40 +00:00
Douglas Gregor 62cb18dd11 Allow the use of default template arguments when forming a class
template specialization (e.g., std::vector<int> would now be
well-formed, since it relies on a default argument for the Allocator
template parameter). 

This is much less interesting than one might expect, since (1) we're
not actually using the default arguments for anything important, such
as naming an actual Decl, and (2) we'll often need to instantiate the
default arguments to check their well-formedness. The real fun will
come later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64310 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 18:16:40 +00:00
Steve Naroff 7151bbb55c Fix <rdar://problem/6206858> [sema] type check @throw statements.
Added a FIXME to handle 'rethrow' check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64308 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 17:45:08 +00:00
Douglas Gregor 26a0bdb810 Rename Sema::hasSameType to QualType::isSameAs
Rename Sema::hasSameUnqualifiedType to QualType::isSameIgnoringQalifiers


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64307 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 16:47:37 +00:00
Douglas Gregor 71d8174516 Silence a warning about an unused variable in -Asserts builds
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64306 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 16:17:49 +00:00
Douglas Gregor 658bbb5e80 Implement semantic checking for template arguments that correspond to
pointer-to-member-data non-type template parameters. Also, get
consistent about what it means to returned a bool from
CheckTemplateArgument.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64305 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 16:16:59 +00:00
Ted Kremenek f1de4649e9 PTH: Don't emit the PTH offset of the IdentifierInfo string data as that data is
referenced by other tables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64304 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 16:06:55 +00:00
Ted Kremenek d25c623a59 Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64297 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 07:50:23 +00:00
Chris Lattner db3bd4b4ea Fix rdar://6518463, increment of a bool is always true, due to
subtle and non-obvious promotion rules.  We already handle += 
and +1 correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64296 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 07:40:06 +00:00
Chris Lattner e5ed15195b finish off codegen support for sub of pointer to functions,
finishing off rdar://6520707


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64295 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 07:21:43 +00:00
Ted Kremenek 8cb6fb3bd8 Per PR 3187, disable the missing -dealloc check for classes that subclass SenTestCase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64292 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 07:10:07 +00:00
Anders Carlsson f29b774a75 Add pmmintrin.h header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64291 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 06:39:50 +00:00
Anders Carlsson 4cc4427984 Fix some mistakes I made when I tried to decipher the Intel documentation of the MXCSR register
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64290 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 06:29:32 +00:00
Chris Lattner 3ebc36a1c1 testcase for rdar://6096412 which already works.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64289 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 06:22:30 +00:00
Douglas Gregor dedb84afce CHAR_BIT == 8
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64286 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 04:02:22 +00:00
Douglas Gregor b86b0579c5 Add semantic checking for template arguments that correspond to
non-type template parameters that are references to functions or
pointers to member functions. Did a little bit of refactoring so that
these two cases, along with the handling of non-type template
parameters that are pointers to functions, are handled by the same
path. 

Also, tweaked FixOverloadedFunctionReference to cope with member
function pointers. This is a necessary step for getting all of the fun
member pointer conversions working outside of template arguments, too.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64277 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 01:18:59 +00:00
Mike Stump 77a60115e3 One more tweak to account for gluing together llvm and clang into one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 01:11:36 +00:00
Mike Stump 84606bb63f More version experimentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64271 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 01:01:17 +00:00
Douglas Gregor f684e6e793 Semantic checking for template arguments that correspond to non-type
template parameters that have reference type. Effectively, we're doing
a very limited form of reference binding here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 00:44:29 +00:00
Mike Stump e6c4f65bd4 Run a little experiment with version numbers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64268 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 00:36:04 +00:00
Douglas Gregor a35284bba5 Add partial semantic checking of template arguments that are meant for
non-type template parameters of pointer-to-object and
pointer-to-function type. The most fun part of this is the use of
overload resolution to pick a function from the set of overloaded
functions that comes in as a template argument.

Also, fixed two minor bugs in this area:
  - We were allowing non-type template parameters of type pointer to
  void.
  - We weren't patching up an expression that refers to an overloaded
  function set via "&f" properly.

We're still not performing complete checking of the expression to be
sure that it is referring to an object or function with external
linkage (C++ [temp.arg.nontype]p1).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 00:19:33 +00:00
Ted Kremenek 297308eda3 BugReporter: Use llvm::raw_string_stream instead of std::ostringstream.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 23:56:07 +00:00
Mike Stump c5840c0e64 Add private extern to pretty printer(s).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 23:49:50 +00:00
Ted Kremenek 183c6f2db8 Add another test case for the MissingDealloc checker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 23:41:52 +00:00