]> granicus.if.org Git - clang/log
clang
15 years agoObj-C non-fragile ABI: Fix types of a few globals; these were not
Daniel Dunbar [Sun, 15 Feb 2009 07:36:20 +0000 (07:36 +0000)]
Obj-C non-fragile ABI: Fix types of a few globals; these were not
creating valid LLVM structures (although they work fined).

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

15 years agoccc: Pass -P to clang.
Daniel Dunbar [Sun, 15 Feb 2009 05:59:37 +0000 (05:59 +0000)]
ccc: Pass -P to clang.

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

15 years agoallow implementations of deprecated functions to use deprecated symbols.
Chris Lattner [Sun, 15 Feb 2009 01:38:09 +0000 (01:38 +0000)]
allow implementations of deprecated functions to use deprecated symbols.

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

15 years agoUse getNameAsCString instead of getNameAsString and reflow the type.
Mike Stump [Sat, 14 Feb 2009 22:49:33 +0000 (22:49 +0000)]
Use getNameAsCString instead of getNameAsString and reflow the type.
Thanks Anders.

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

15 years agoGenerate the helper function for blocks. Now basic codegen is
Mike Stump [Sat, 14 Feb 2009 22:16:35 +0000 (22:16 +0000)]
Generate the helper function for blocks.  Now basic codegen is
starting to work for blocks.

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

15 years agoFixed a bad ir-gen bug which caused a dejagnu test to fail.
Fariborz Jahanian [Sat, 14 Feb 2009 21:25:36 +0000 (21:25 +0000)]
Fixed a bad ir-gen bug which caused a dejagnu test to fail.
Now we are pretty close to be in sync with objc's classic
abi when it comes to passing dejagnu objc executable tests.

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

15 years agoAdd a test case for -ffreestanding that redefines malloc.
Douglas Gregor [Sat, 14 Feb 2009 21:06:05 +0000 (21:06 +0000)]
Add a test case for -ffreestanding that redefines malloc.

Warn that complex numbers are an extension in a freestanding C99
implementation.

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

15 years agoAdd -ffreestanding to suppress the implicit declaration of library builtins like...
Douglas Gregor [Sat, 14 Feb 2009 20:49:29 +0000 (20:49 +0000)]
Add -ffreestanding to suppress the implicit declaration of library builtins like printf and malloc. Fixes PR3586

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

15 years agoAdd expected note. Surely people test before the check in stuff.
Mike Stump [Sat, 14 Feb 2009 20:35:19 +0000 (20:35 +0000)]
Add expected note.  Surely people test before the check in stuff.

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

15 years agoAdd svn:eol-style=native to some files
Cedric Venet [Sat, 14 Feb 2009 20:20:19 +0000 (20:20 +0000)]
Add svn:eol-style=native to some files
Correct two files with inconsistent lines endings.

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

15 years agoFixed a problem caused by foreward @class use
Fariborz Jahanian [Sat, 14 Feb 2009 20:13:28 +0000 (20:13 +0000)]
Fixed a problem caused by foreward @class use
which consequently caused a Seg fault. during meta-data
generation. It also addresses an issue related to
late binding of newly synthesize ivars (when we support it).

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

15 years agoAdd support for deprecated Obj-C methods. The semantics mostly match what gcc has.
Anders Carlsson [Sat, 14 Feb 2009 19:08:58 +0000 (19:08 +0000)]
Add support for deprecated Obj-C methods. The semantics mostly match what gcc has.

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

15 years agoAdd hook to add attributes to function declarations that we know
Douglas Gregor [Sat, 14 Feb 2009 18:57:46 +0000 (18:57 +0000)]
Add hook to add attributes to function declarations that we know
about, whether they are builtins or not. Use this to add the
appropriate "format" attribute to NSLog, NSLogv, asprintf, and
vasprintf, and to translate builtin attributes (from Builtins.def)
into actual attributes on the function declaration.

Use the "printf" format attribute on function declarations to
determine whether we should do format string checking, rather than
looking at an ad hoc list of builtins and "known" function names.

Be a bit more careful about when we consider a function a "builtin" in
C++.

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

15 years agoPass the location of the start of the selector to ActOnClassMessage/ActOnInstanceMessage.
Anders Carlsson [Sat, 14 Feb 2009 18:21:46 +0000 (18:21 +0000)]
Pass the location of the start of the selector to ActOnClassMessage/ActOnInstanceMessage.

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

15 years agoFix 80col violations.
Mike Stump [Sat, 14 Feb 2009 18:02:21 +0000 (18:02 +0000)]
Fix 80col violations.

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

15 years agoPatch by Ben Laurie:
Ted Kremenek [Sat, 14 Feb 2009 17:08:39 +0000 (17:08 +0000)]
Patch by Ben Laurie:

ConstraintManager:
- constify getSymVal()

BasicConstraintManager:
- Pull out logic that would be common to ConstraintManagers of a similar nature
  and put them in a parent class called 'SimpleConstraintManager'.

RangeConstraintManager:
- Added a new prototype ConstraintManager to track ranges of variables! This
  ConstraintManager keeps tracks of ranges of concrete integers that a symbolic
  integer may have.

AnalysisConsumer:
- Add driver option to use RangeConstraintManager with GRExprEngine-based
  analyses.

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

15 years agoDefine __ELF__ on FreeBSD. Patch by Roman Divacky!
Anton Korobeynikov [Sat, 14 Feb 2009 16:42:50 +0000 (16:42 +0000)]
Define __ELF__ on FreeBSD. Patch by Roman Divacky!

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

15 years agoFix the build on win32.
Cedric Venet [Sat, 14 Feb 2009 16:15:20 +0000 (16:15 +0000)]
Fix the build on win32.

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

15 years agoDefine __ELF__ for linux systems.
Argyrios Kyrtzidis [Sat, 14 Feb 2009 15:02:45 +0000 (15:02 +0000)]
Define __ELF__ for linux systems.

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

15 years agonew tests, it would be nice to not warn on the second one.
Chris Lattner [Sat, 14 Feb 2009 08:27:44 +0000 (08:27 +0000)]
new tests, it would be nice to not warn on the second one.

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

15 years agosimplify some code.
Chris Lattner [Sat, 14 Feb 2009 08:22:25 +0000 (08:22 +0000)]
simplify some code.

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

15 years agojust ignore hte format_arg attribute for now, it doesn't have any semantic implications.
Chris Lattner [Sat, 14 Feb 2009 08:12:47 +0000 (08:12 +0000)]
just ignore hte format_arg attribute for now, it doesn't have any semantic implications.

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

15 years agoadd parser and type checking support for attribute((objc_exception)).
Chris Lattner [Sat, 14 Feb 2009 08:09:34 +0000 (08:09 +0000)]
add parser and type checking support for attribute((objc_exception)).
We don't have "zero cost" exceptions for ObjC yet, so there is no codegen
support required.

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

15 years agorename test
Chris Lattner [Sat, 14 Feb 2009 08:08:05 +0000 (08:08 +0000)]
rename test

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

15 years agoSeveral related changes:
Chris Lattner [Sat, 14 Feb 2009 07:37:35 +0000 (07:37 +0000)]
Several related changes:
1) implement parser and sema support for reading and verifying attribute(warnunusedresult).
2) rename hasLocalSideEffect to isUnusedResultAWarning, inverting the sense
   of its result.
3) extend isUnusedResultAWarning to directly return the loc and range
   info that should be reported to the user.  Make it substantially more
   precise in some cases than what was previously reported.
4) teach isUnusedResultAWarning about CallExpr to decls that are
   pure/const/warnunusedresult, fixing a fixme.
5) change warn_attribute_wrong_decl_type to not pass in english strings, instead,
   pass in integers and use %select.

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

15 years agoreduce nesting.
Chris Lattner [Sat, 14 Feb 2009 07:22:29 +0000 (07:22 +0000)]
reduce nesting.

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

15 years agoGRExprEngine: Handle empty statement expressions.
Ted Kremenek [Sat, 14 Feb 2009 05:55:08 +0000 (05:55 +0000)]
GRExprEngine: Handle empty statement expressions.

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

15 years agoDon't ignore the const attribute - we even have CG support for that. Do ignore the...
Anders Carlsson [Sat, 14 Feb 2009 04:12:57 +0000 (04:12 +0000)]
Don't ignore the const attribute - we even have CG support for that. Do ignore the malloc attribute however.

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

15 years agoFix more xmmintrin.h typos
Anders Carlsson [Sat, 14 Feb 2009 04:01:38 +0000 (04:01 +0000)]
Fix more xmmintrin.h typos

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

15 years agoignore the const attribute for now.
Chris Lattner [Sat, 14 Feb 2009 03:51:44 +0000 (03:51 +0000)]
ignore the const attribute for now.

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

15 years agoAdded GRStateManager::scanReachableSymbols(), a method which scans the reachable
Ted Kremenek [Sat, 14 Feb 2009 03:16:10 +0000 (03:16 +0000)]
Added GRStateManager::scanReachableSymbols(), a method which scans the reachable
symbols from an SVal.

- Fixed a bug in EnvironmentManager::RemoveDeadBindings() where it did not mark
  live all the symbols reachable from a live block-level expression.

- Fixed a bug in the retain/release checker where it did not stop tracking
  symbols that 'escaped' via compound literals being assigned to something the
  BasicStoreManager didn't reason about.

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

15 years agox86_64 ABI: Need to use canonical types when comparing against
Daniel Dunbar [Sat, 14 Feb 2009 02:45:45 +0000 (02:45 +0000)]
x86_64 ABI: Need to use canonical types when comparing against
ASTContext types.

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

15 years agox86_64 ABI: Pass simple types directly when possible. This is
Daniel Dunbar [Sat, 14 Feb 2009 02:09:24 +0000 (02:09 +0000)]
x86_64 ABI: Pass simple types directly when possible. This is
important for both keeping the generated LLVM simple and for ensuring
that integer types are passed/promoted correctly.

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

15 years agoUse GRTransferFuncs::EvalBind when processing variable initializations.
Ted Kremenek [Sat, 14 Feb 2009 01:54:57 +0000 (01:54 +0000)]
Use GRTransferFuncs::EvalBind when processing variable initializations.

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

15 years agoMake it possible for builtins to expression FILE* arguments, so that
Douglas Gregor [Sat, 14 Feb 2009 01:52:53 +0000 (01:52 +0000)]
Make it possible for builtins to expression FILE* arguments, so that
we can define builtins such as fprintf, vfprintf, and
__builtin___fprintf_chk. Give a nice error message when we need to
implicitly declare a function like fprintf.

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

15 years agoStatic analyzer:
Ted Kremenek [Sat, 14 Feb 2009 01:43:44 +0000 (01:43 +0000)]
Static analyzer:
- Added a new 'node builder' class called GRStmtNodeBuilderRef (name may
  change). This is essentially a smart reference to a GRStmtNodeBuilder object
  that keeps track of the current context (predecessor node, GRExprEngine
  object, etc.) The idea is to gradually simplify the interface between
  GRExprEngine and GRTransferFuncs using this new builder (i.e., passing 1
  argument instead of 5). It also handles some of the "auto-transition" for node
  creation, simplifying some of the logic in GRExprEngine itself.

- Used GRStmtBuilderRef to replace GRTransferFuncs::EvalStore with
  GRTransferFuncs::EvalBind. The new EvalBind method will be used at any
  arbitrary places where a binding between a location and value takes place.
  Moreover, GRTransferFuncs no longer has the responsibility to request
  StoreManager to do the binding; this is now in GRExprEngine::EvalBind. All
  GRTransferFuncs::EvalBind does is checker-specific logic (which can be a
  no-op).

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

15 years agoFix an error in _mm_loaddup_pd that Eli noticed.
Anders Carlsson [Sat, 14 Feb 2009 01:06:58 +0000 (01:06 +0000)]
Fix an error in _mm_loaddup_pd that Eli noticed.

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

15 years agoAdd the nodebug attribute to intrinsics
Anders Carlsson [Sat, 14 Feb 2009 01:00:11 +0000 (01:00 +0000)]
Add the nodebug attribute to intrinsics

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

15 years agoAdd test case to insure that implicit builtin declarations for C library functions...
Douglas Gregor [Sat, 14 Feb 2009 00:37:42 +0000 (00:37 +0000)]
Add test case to insure that implicit builtin declarations for C library functions aren't created in C++

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

15 years agoExtend builtin "attribute" syntax to include a notation for
Douglas Gregor [Sat, 14 Feb 2009 00:32:47 +0000 (00:32 +0000)]
Extend builtin "attribute" syntax to include a notation for
printf-like functions, both builtin functions and those in the
C library. The function-call checker now queries this attribute do
determine if we have a printf-like function, rather than scanning
through the list of "known functions IDs". However, there are 5
functions they are not yet "builtins", so the function-call checker
handles them specifically still:

  - fprintf and vfprintf: the builtins mechanism cannot (yet)
    express FILE* arguments, so these can't be encoded.
  - NSLog: the builtins mechanism cannot (yet) express NSString*
    arguments, so this (and NSLogv) can't be encoded.
  - asprintf and vasprintf: these aren't part of the C99 standard
    library, so we really shouldn't be defining them as builtins in
    the general case (and we don't seem to have the machinery to make
    them builtins only on certain targets and depending on whether
    extensions are enabled).

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

15 years agoUpdate checker build.
Ted Kremenek [Fri, 13 Feb 2009 23:41:12 +0000 (23:41 +0000)]
Update checker build.

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

15 years agofix rdar://6586493, a bug in codegen of the GNU
Chris Lattner [Fri, 13 Feb 2009 23:35:32 +0000 (23:35 +0000)]
fix rdar://6586493, a bug in codegen of the GNU
missing-?:-true-value extension.

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

15 years agoImplicitly declare certain C library functions (malloc, strcpy, memmove,
Douglas Gregor [Fri, 13 Feb 2009 23:20:09 +0000 (23:20 +0000)]
Implicitly declare certain C library functions (malloc, strcpy, memmove,
etc.) when we perform name lookup on them. This ensures that we
produce the correct signature for these functions, which has two
practical impacts:

  1) When we're supporting the "implicit function declaration" feature
  of C99, these functions will be implicitly declared with the right
  signature rather than as a function returning "int" with no
  prototype. See PR3541 for the reason why this is important (hint:
  GCC always predeclares these functions).

  2) If users attempt to redeclare one of these library functions with
  an incompatible signature, we produce a hard error.

This patch does a little bit of work to give reasonable error
messages. For example, when we hit case #1 we complain that we're
implicitly declaring this function with a specific signature, and then
we give a note that asks the user to include the appropriate header
(e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In
case #2, we show the type of the implicit builtin that was incorrectly
declared, so the user can see the problem. We could do better here:
for example, when displaying this latter error message we say
something like:

  'strcpy' was implicitly declared here with type 'char *(char *, char
  const *)'

but we should really print out a fake code line showing the
declaration, like this:

  'strcpy' was implicitly declared here as:

    char *strcpy(char *, char const *)

This would also be good for printing built-in candidates with C++
operator overloading.

The set of C library functions supported by this patch includes all
functions from the C99 specification's <stdlib.h> and <string.h> that
(a) are predefined by GCC and (b) have signatures that could cause
codegen issues if they are treated as functions with no prototype
returning and int. Future work could extend this set of functions to
other C library functions that we know about.

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

15 years agoadd an assertion from Alexei Svitkine!
Chris Lattner [Fri, 13 Feb 2009 23:06:48 +0000 (23:06 +0000)]
add an assertion from Alexei Svitkine!

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

15 years agoSet constant bit on static block vars as well. Patch by Anders Johnson!q
Daniel Dunbar [Fri, 13 Feb 2009 22:58:39 +0000 (22:58 +0000)]
Set constant bit on static block vars as well. Patch by Anders Johnson!q

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

15 years agoFix typo in printing of __private_extern__.
Daniel Dunbar [Fri, 13 Feb 2009 22:49:34 +0000 (22:49 +0000)]
Fix typo in printing of __private_extern__.

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

15 years agoSimplify predicate.
Daniel Dunbar [Fri, 13 Feb 2009 22:49:13 +0000 (22:49 +0000)]
Simplify predicate.

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

15 years agoWarn about attribute used ignored on "extern int a
Daniel Dunbar [Fri, 13 Feb 2009 22:48:56 +0000 (22:48 +0000)]
Warn about attribute used ignored on "extern int a
__attribute__((used))".

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

15 years agoAdd VarDecl::hasExternalStorage (no functionality change).
Daniel Dunbar [Fri, 13 Feb 2009 22:48:27 +0000 (22:48 +0000)]
Add VarDecl::hasExternalStorage (no functionality change).

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

15 years agoanders johnson points out that some software depends on the
Chris Lattner [Fri, 13 Feb 2009 22:43:13 +0000 (22:43 +0000)]
anders johnson points out that some software depends on the
definition of __intptr_t_defined when stdint.h defines intptr_t.

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

15 years agoGive TargetInfo a new IntPtrType to hold the intptr_t type for
Chris Lattner [Fri, 13 Feb 2009 22:28:55 +0000 (22:28 +0000)]
Give TargetInfo a new IntPtrType to hold the intptr_t type for
a target.

Make Preprocessor.cpp define a new __INTPTR_TYPE__ macro based on this.

On linux/32, set intptr_t to int, instead of long.  This fixes PR3563.

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

15 years agoAdd test case illustrating special handling of 'SenTestCase' subclasses for the missi...
Ted Kremenek [Fri, 13 Feb 2009 22:26:30 +0000 (22:26 +0000)]
Add test case illustrating special handling of 'SenTestCase' subclasses for the missing -dealloc check.

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

15 years agoimprove wording in a diagnostic to make it clear that we never intend to support
Chris Lattner [Fri, 13 Feb 2009 22:13:02 +0000 (22:13 +0000)]
improve wording in a diagnostic to make it clear that we never intend to support
the vla-in-structure extension that GCC does.  PR3562
Also wrap some long lines.

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

15 years agoIRgen support for attribute used.
Daniel Dunbar [Fri, 13 Feb 2009 22:08:43 +0000 (22:08 +0000)]
IRgen support for attribute used.
 - PR3566

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

15 years agoIf x is an invalid field decl, don't construct an expression for P->x,
Chris Lattner [Fri, 13 Feb 2009 22:08:30 +0000 (22:08 +0000)]
If x is an invalid field decl, don't construct an expression for P->x,
just silently return an error to avoid bogus diagnostics.

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

15 years agoPTH: Cache directory and negative 'stat' calls. This gives us a 1% performance impro...
Ted Kremenek [Fri, 13 Feb 2009 22:07:44 +0000 (22:07 +0000)]
PTH: Cache directory and negative 'stat' calls.  This gives us a 1% performance improvement on Cocoa.h (fsyntax-only+PTH).

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

15 years agowrap some crazy long lines.
Chris Lattner [Fri, 13 Feb 2009 21:51:45 +0000 (21:51 +0000)]
wrap some crazy long lines.

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

15 years agoPull MayDeferGeneration out of EmitGlobal.
Daniel Dunbar [Fri, 13 Feb 2009 21:18:01 +0000 (21:18 +0000)]
Pull MayDeferGeneration out of EmitGlobal.
 - Fix emission of static functions with constructor attribute while I
   was here.
<rdar://problem/6140899> [codegen] "static" and attribute-constructor interact poorly

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

15 years agoRename EmitStatics (etc) to EmitDeferred; provide basic infrastructure
Daniel Dunbar [Fri, 13 Feb 2009 20:29:50 +0000 (20:29 +0000)]
Rename EmitStatics (etc) to EmitDeferred; provide basic infrastructure
for attribute used support.
- No functionality change.

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

15 years agoLet the backend unique these.
Mike Stump [Fri, 13 Feb 2009 20:17:16 +0000 (20:17 +0000)]
Let the backend unique these.

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

15 years agodocument __builtin_shufflevector
Chris Lattner [Fri, 13 Feb 2009 20:00:20 +0000 (20:00 +0000)]
document __builtin_shufflevector

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

15 years agoFix spelling.
Mike Stump [Fri, 13 Feb 2009 19:38:12 +0000 (19:38 +0000)]
Fix spelling.

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

15 years agoMove DescriptorUniqueCount into CGM.
Mike Stump [Fri, 13 Feb 2009 19:36:03 +0000 (19:36 +0000)]
Move DescriptorUniqueCount into CGM.

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

15 years agoFix rdar://6562329, a static analyzer crash Ted noticed on
Chris Lattner [Fri, 13 Feb 2009 19:33:24 +0000 (19:33 +0000)]
Fix rdar://6562329, a static analyzer crash Ted noticed on
wine sources.  This was happening because HighlightMacros was
calling EnterMainFile multiple times on the same preprocessor
object and getting an assert due to the new #line stuff (the
file in question was bison output with #line directives).

The fix for this is to not reenter the file.  Instead,
relex the tokens in raw mode, swizzle them a bit and repreprocess
the token stream.  An added bonus of this is that rewrite macros
will now hilight the macro definition as well as its uses.  Woo.

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

15 years agoMove NSConcreteStackBlock into CGM.
Mike Stump [Fri, 13 Feb 2009 19:29:27 +0000 (19:29 +0000)]
Move NSConcreteStackBlock into CGM.

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

15 years agoSema/AST support for attribute used. Patch by Anders Johnson (with small tweaks ...
Daniel Dunbar [Fri, 13 Feb 2009 19:23:53 +0000 (19:23 +0000)]
Sema/AST support for attribute used. Patch by Anders Johnson (with small tweaks & test case)!

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

15 years agoAdd some boilerplate to the PTH file to prepare for the caching of stats for director...
Ted Kremenek [Fri, 13 Feb 2009 19:13:46 +0000 (19:13 +0000)]
Add some boilerplate to the PTH file to prepare for the caching of stats for directories (and negative stats too).

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

15 years agoEliminate an unused variable
Douglas Gregor [Fri, 13 Feb 2009 19:13:32 +0000 (19:13 +0000)]
Eliminate an unused variable

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

15 years agoReflow to 80col.
Mike Stump [Fri, 13 Feb 2009 19:12:34 +0000 (19:12 +0000)]
Reflow to 80col.

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

15 years agoRemove DeclGroupOwningRef, since we intend for declarations to be owned
Douglas Gregor [Fri, 13 Feb 2009 19:06:18 +0000 (19:06 +0000)]
Remove DeclGroupOwningRef, since we intend for declarations to be owned
by DeclContexts (always) rather than by statements.

DeclContext currently goes out of its way to avoid destroying any
Decls that might be owned by a DeclGroupOwningRef. However, in an
error-recovery situation, a failure in a declaration statement can
cause all of the decls in a DeclGroupOwningRef to be destroyed after
they've already be added into the DeclContext. Hence, DeclContext is
left with already-destroyed declarations, and bad things happen. This
problem was causing failures that showed up as assertions on x86 Linux
in test/Parser/objc-forcollection-neg-2.m.

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

15 years agoMove GlobalUniqueCount up into CGM.
Mike Stump [Fri, 13 Feb 2009 18:36:05 +0000 (18:36 +0000)]
Move GlobalUniqueCount up into CGM.

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

15 years agoFix capitalization in a diagnostic
Douglas Gregor [Fri, 13 Feb 2009 18:20:19 +0000 (18:20 +0000)]
Fix capitalization in a diagnostic

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

15 years agoAdd new files to Xcode project
Anders Carlsson [Fri, 13 Feb 2009 18:09:59 +0000 (18:09 +0000)]
Add new files to Xcode project

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

15 years agoFixed a 64bit code gen bug of a cateogory
Fariborz Jahanian [Fri, 13 Feb 2009 17:52:22 +0000 (17:52 +0000)]
Fixed a 64bit code gen bug of a cateogory
implementation with no category declaration!

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

15 years agox86_64 ABI: Support va_arg passed in mixed registers.
Daniel Dunbar [Fri, 13 Feb 2009 17:46:31 +0000 (17:46 +0000)]
x86_64 ABI: Support va_arg passed in mixed registers.
 - Now at 1274 passes on gcc compat suite vs 1262.

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

15 years agoccc: Suffix for PCH files is appended, not replaced. (Test case)
Daniel Dunbar [Fri, 13 Feb 2009 17:42:52 +0000 (17:42 +0000)]
ccc: Suffix for PCH files is appended, not replaced. (Test case)

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

15 years agoccc: Suffix for PCH files is appended, not replaced.
Daniel Dunbar [Fri, 13 Feb 2009 17:42:34 +0000 (17:42 +0000)]
ccc: Suffix for PCH files is appended, not replaced.

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

15 years agoCondense NSConcreteGlobalBlock handling.
Mike Stump [Fri, 13 Feb 2009 17:23:42 +0000 (17:23 +0000)]
Condense NSConcreteGlobalBlock handling.

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

15 years agoCalculate size correctly.
Mike Stump [Fri, 13 Feb 2009 17:03:17 +0000 (17:03 +0000)]
Calculate size correctly.

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

15 years agoSize should be unsigned.
Mike Stump [Fri, 13 Feb 2009 16:55:51 +0000 (16:55 +0000)]
Size should be unsigned.

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

15 years agoCondense all the blocks code into CGBlocks.cpp.
Mike Stump [Fri, 13 Feb 2009 16:19:19 +0000 (16:19 +0000)]
Condense all the blocks code into CGBlocks.cpp.

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

15 years agoFixup types, the runtime uses int, not int32.
Mike Stump [Fri, 13 Feb 2009 16:01:35 +0000 (16:01 +0000)]
Fixup types, the runtime uses int, not int32.

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

15 years agoFix cmake builds.
Mike Stump [Fri, 13 Feb 2009 15:42:50 +0000 (15:42 +0000)]
Fix cmake builds.

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

15 years agoFixup spacing a tad.
Mike Stump [Fri, 13 Feb 2009 15:32:32 +0000 (15:32 +0000)]
Fixup spacing a tad.

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

15 years agoMove GenericBlockLiteralType into CGM.
Mike Stump [Fri, 13 Feb 2009 15:25:34 +0000 (15:25 +0000)]
Move GenericBlockLiteralType into CGM.

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

15 years agoMove BlockDescriptorType into CGM.
Mike Stump [Fri, 13 Feb 2009 15:16:56 +0000 (15:16 +0000)]
Move BlockDescriptorType into CGM.

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

15 years ago80col.
Mike Stump [Fri, 13 Feb 2009 14:24:50 +0000 (14:24 +0000)]
80col.

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

15 years agoStart warning about unknown attributes.
Anders Carlsson [Fri, 13 Feb 2009 08:22:04 +0000 (08:22 +0000)]
Start warning about unknown attributes.

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

15 years agoAdd a new Ignored attribute type, and use it for may_alias.
Anders Carlsson [Fri, 13 Feb 2009 08:16:43 +0000 (08:16 +0000)]
Add a new Ignored attribute type, and use it for may_alias.

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

15 years agoAdd CodeGen support for the nodebug attribute.
Anders Carlsson [Fri, 13 Feb 2009 08:11:52 +0000 (08:11 +0000)]
Add CodeGen support for the nodebug attribute.

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

15 years agoAdd sema support for the nodebug attribute.
Anders Carlsson [Fri, 13 Feb 2009 06:46:13 +0000 (06:46 +0000)]
Add sema support for the nodebug attribute.

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

15 years agoInitial implementation of arbitrary fixed-width integer types.
Eli Friedman [Fri, 13 Feb 2009 02:31:07 +0000 (02:31 +0000)]
Initial implementation of arbitrary fixed-width integer types.
Currently only used for 128-bit integers.

Note that we can't use the fixed-width integer types for other integer
modes without other changes because glibc headers redefines (u)int*_t
and friends using the mode attribute.  For example, this means that uint64_t
has to be compatible with unsigned __attribute((mode(DI))), and
uint64_t is currently defined to long long.  And I have a feeling we'll
run into issues if we try to define uint64_t as something which isn't
either long or long long.

This doesn't get the alignment right in most cases, including
the 128-bit integer case; I'll file a PR shortly.  The gist of the issue
is that the targets don't really expose the information necessary to
figure out the alignment outside of the target description, so there's a
non-trivial amount of work involved in getting it working right.  That
said, the alignment used is conservative, so the only issue with the
current implementation is ABI compatibility.

This makes it trivial to add some sort of "bitwidth" attribute to make
arbitrary-width integers; I'll do that in a followup.

We could also use this for stuff like the following for compatibility
with gcc, but I have a feeling it would be a better idea for clang to be
consistent between C and C++ modes rather than follow gcc's example for
C mode.
struct {unsigned long long x : 33;} x;
unsigned long long a(void) {return x.x+1;}

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

15 years agoGRExprEngine:
Ted Kremenek [Fri, 13 Feb 2009 01:45:31 +0000 (01:45 +0000)]
GRExprEngine:
- Add 'EvalBind', which will be used by 'EvalStore' to pull much of the value binding logic out of GRTransferFuncs.
- Rename many cases of 'St' to 'state'.

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

15 years agoAdd mangling for variadic functions and conversion functions
Douglas Gregor [Fri, 13 Feb 2009 01:28:03 +0000 (01:28 +0000)]
Add mangling for variadic functions and conversion functions

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

15 years agoFix gcc warning: gcc correctly notes that const-qualifying the return
Eli Friedman [Fri, 13 Feb 2009 01:02:29 +0000 (01:02 +0000)]
Fix gcc warning: gcc correctly notes that const-qualifying the return
type doesn't do anything.

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

15 years agoAdd documentation for overloaded functions in C
Douglas Gregor [Fri, 13 Feb 2009 00:57:04 +0000 (00:57 +0000)]
Add documentation for overloaded functions in C

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

15 years agoAnalysisConsumer: Explicitly destroy the PathDiagnosticClient at the end of HandleTra...
Ted Kremenek [Fri, 13 Feb 2009 00:51:30 +0000 (00:51 +0000)]
AnalysisConsumer: Explicitly destroy the PathDiagnosticClient at the end of HandleTranslationUnit to ensure that the client's destructor is called even with --disable-free.

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

15 years agomake "floating macro bubble" output of -emit-html much prettier:
Chris Lattner [Fri, 13 Feb 2009 00:51:30 +0000 (00:51 +0000)]
make "floating macro bubble" output of -emit-html much prettier:
only insert spaces between tokens if the code had them or if they
are actually required to avoid pasting.  This reuses the same
logic as -E mode.

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

15 years agoccc: Test case for transparent PTH support.
Daniel Dunbar [Fri, 13 Feb 2009 00:49:50 +0000 (00:49 +0000)]
ccc: Test case for transparent PTH support.

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

15 years agoccc: Stop patching output file name when using transparent PTH support.
Daniel Dunbar [Fri, 13 Feb 2009 00:49:01 +0000 (00:49 +0000)]
ccc: Stop patching output file name when using transparent PTH support.
<rdar://problem/6515236> [ccc] generate expected output files when used with PCH

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