]> granicus.if.org Git - clang/log
clang
14 years agoName lookup should know better than to look into a class before it's defined
Douglas Gregor [Tue, 12 Jan 2010 01:17:50 +0000 (01:17 +0000)]
Name lookup should know better than to look into a class before it's defined

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

14 years agoChris thinks these diagnostics are better now. :)
John McCall [Tue, 12 Jan 2010 01:09:12 +0000 (01:09 +0000)]
Chris thinks these diagnostics are better now. :)

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

14 years agoSort overload results by viability.
John McCall [Tue, 12 Jan 2010 00:48:53 +0000 (00:48 +0000)]
Sort overload results by viability.

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

14 years agoIntroduce a specific representation for the ambiguous implicit conversion
John McCall [Tue, 12 Jan 2010 00:44:57 +0000 (00:44 +0000)]
Introduce a specific representation for the ambiguous implicit conversion
sequence.  Lots of small relevant changes.  Fixes some serious problems with
ambiguous conversions;  also possibly improves associated diagnostics.

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

14 years agoChange clang_getUSR() to return a CXString instead of a 'const char *'.
Ted Kremenek [Tue, 12 Jan 2010 00:38:53 +0000 (00:38 +0000)]
Change clang_getUSR() to return a CXString instead of a 'const char *'.

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

14 years agoMake createCXString() a static member function of class CIndex.
Ted Kremenek [Tue, 12 Jan 2010 00:36:38 +0000 (00:36 +0000)]
Make createCXString() a static member function of class CIndex.

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

14 years agoAllow N_FIELDS to be 0.
Mike Stump [Tue, 12 Jan 2010 00:28:59 +0000 (00:28 +0000)]
Allow N_FIELDS to be 0.

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

14 years agoCIndex:
Ted Kremenek [Mon, 11 Jan 2010 23:56:39 +0000 (23:56 +0000)]
CIndex:
- Remove unused (and unimplemented) clang_getDeclarationName().
- Remove unused (and unimplemented) clang_getEntity().
- Add clang_getEntityFromDecl(): maps from a CXDecl to a CXEntity)
- Add clang_getDeclaration(): maps from a (CXEntity, CXTranslationUnit) to a CXDecl).

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

14 years agoEliminate an embarrassing performance regression in C/ObjC, where we
Douglas Gregor [Mon, 11 Jan 2010 23:29:10 +0000 (23:29 +0000)]
Eliminate an embarrassing performance regression in C/ObjC, where we
were performing name lookup for template names in C/ObjC and always
finding nothing. Turn off such lookup unless we're in C++ mode, along
with the check that determines whether the given identifier is a
"current class name", and assert that we don't make this mistake
again.

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

14 years agoReverted r93198; done without reading relevant PR.
David Chisnall [Mon, 11 Jan 2010 23:08:08 +0000 (23:08 +0000)]
Reverted r93198; done without reading relevant PR.

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

14 years agoFix rewriting for forward class declaration.
Fariborz Jahanian [Mon, 11 Jan 2010 22:48:40 +0000 (22:48 +0000)]
Fix rewriting for forward class declaration.
(fixes radar 6969189).

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

14 years agoWhen performing name lookup into a scope, check that its entity is
Douglas Gregor [Mon, 11 Jan 2010 22:40:45 +0000 (22:40 +0000)]
When performing name lookup into a scope, check that its entity is
non-NULL before looking at the entity itself.

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

14 years agoAllow VLAs in C++ if in GNU mode (GNU C++ permits them). Clang can now compile Langu...
David Chisnall [Mon, 11 Jan 2010 22:33:19 +0000 (22:33 +0000)]
Allow VLAs in C++ if in GNU mode (GNU C++ permits them).  Clang can now compile LanguageKit, although the resulting code crashes (although not in any of the functions that use VLAs).

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

14 years agoC++0x [dcl.typedef]p4, take 3, where we actually figure out what "that
Douglas Gregor [Mon, 11 Jan 2010 22:30:10 +0000 (22:30 +0000)]
C++0x [dcl.typedef]p4, take 3, where we actually figure out what "that
is not also a typedef-name" actually means. For anyone keeping score,
that's John: 2, Doug: 0.

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

14 years agoUse isa<ElaboratedType> rather than getAs<ElaboratedType>, since the
Douglas Gregor [Mon, 11 Jan 2010 22:04:54 +0000 (22:04 +0000)]
Use isa<ElaboratedType> rather than getAs<ElaboratedType>, since the
latter may (eventually) perform multiple levels of desugaring (thus
breaking the newly-added tests) and the former is faster. Thanks, John!

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

14 years agoAdd test case from PR5763
Douglas Gregor [Mon, 11 Jan 2010 21:58:49 +0000 (21:58 +0000)]
Add test case from PR5763

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

14 years agoAllow redefinitions of typedef-names within class scope when the type
Douglas Gregor [Mon, 11 Jan 2010 21:54:40 +0000 (21:54 +0000)]
Allow redefinitions of typedef-names within class scope when the type
they redefine is a class-name but not a typedef-name, per C++0x
[dcl.typedef]p4. The code in the test was valid C++98 and is valid
C++0x, but an unintended consequence of DR56 made it ill-formed in
C++03 (which we were luck enough to implement). Fixes PR5455.

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

14 years agoFix a problem related to rewrite of anonymous unions.
Fariborz Jahanian [Mon, 11 Jan 2010 21:17:32 +0000 (21:17 +0000)]
Fix a problem related to rewrite of anonymous unions.
(fixes radar 6948022)

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

14 years agoFix pasto.
Benjamin Kramer [Mon, 11 Jan 2010 20:15:06 +0000 (20:15 +0000)]
Fix pasto.

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

14 years agoUse the new isInteger() method in a couple places, some random cleanup, and
Chris Lattner [Mon, 11 Jan 2010 19:58:10 +0000 (19:58 +0000)]
Use the new isInteger() method in a couple places, some random cleanup, and
add a fixme.

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

14 years agoWhen resolving a single function template specialization to a
Douglas Gregor [Mon, 11 Jan 2010 19:55:36 +0000 (19:55 +0000)]
When resolving a single function template specialization to a
function, be sure to adjust the resulting argument type to a pointer
(if necessary). Fixes PR5910 and PR5949.

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

14 years agoTest case for naming of conversion function template specializations
Douglas Gregor [Mon, 11 Jan 2010 19:52:23 +0000 (19:52 +0000)]
Test case for naming of conversion function template specializations

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

14 years agoAvoid use of deprecated functions (CStrInCStrNoCase and StringsEqualNoCase).
Benjamin Kramer [Mon, 11 Jan 2010 19:46:28 +0000 (19:46 +0000)]
Avoid use of deprecated functions (CStrInCStrNoCase and StringsEqualNoCase).

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

14 years agoWhen computing surrogates for calls to a value of object type, look
Douglas Gregor [Mon, 11 Jan 2010 19:36:35 +0000 (19:36 +0000)]
When computing surrogates for calls to a value of object type, look
for all visible conversion functions.

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

14 years agoChange return type of getObjCEncodingTypeSize() to CharUnits as the units are in...
Ken Dyck [Mon, 11 Jan 2010 19:19:56 +0000 (19:19 +0000)]
Change return type of getObjCEncodingTypeSize() to CharUnits as the units are in characters.

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

14 years agoFix type mismatch on 64-bit platforms (GNU ObjC).
David Chisnall [Mon, 11 Jan 2010 19:02:35 +0000 (19:02 +0000)]
Fix type mismatch on 64-bit platforms (GNU ObjC).

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

14 years agoRemove some pointless FIXMEs. No functionality change
Douglas Gregor [Mon, 11 Jan 2010 19:00:50 +0000 (19:00 +0000)]
Remove some pointless FIXMEs. No functionality change

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

14 years agoAdd support for out-of-line definitions of conversion function
Douglas Gregor [Mon, 11 Jan 2010 18:53:25 +0000 (18:53 +0000)]
Add support for out-of-line definitions of conversion function
templates. Previously, a little thinko in the code that replaced a
conversion function template with its redeclaration was causing some
very weird lookup behavior.

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

14 years agoTighten up the "cannot return array or function type" diagnostic to
Douglas Gregor [Mon, 11 Jan 2010 18:46:21 +0000 (18:46 +0000)]
Tighten up the "cannot return array or function type" diagnostic to
say either "array type" or "function type", whichever it is. No reason
to make the user guess.

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

14 years agoImplement name lookup for conversion function template specializations
Douglas Gregor [Mon, 11 Jan 2010 18:40:55 +0000 (18:40 +0000)]
Implement name lookup for conversion function template specializations
(C++ [temp.mem]p5-6), which involves template argument deduction based
on the type named, e.g., given

  struct X { template<typename T> operator T*(); } x;

when we call

  x.operator int*();

we perform template argument deduction to determine that T=int. This
template argument deduction is needed for template specialization and
explicit instantiation, e.g.,

  template<> X::operator float*() { /* ... */ }

and when calling or otherwise naming a conversion function (as in the
first example).

This fixes PR5742 and PR5762, although there's some remaining ugliness
that's causing out-of-line definitions of conversion function
templates to fail. I'll look into that separately.

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

14 years agoFixup rewrite of ivars accessed via an explicit object
Fariborz Jahanian [Mon, 11 Jan 2010 17:50:35 +0000 (17:50 +0000)]
Fixup rewrite of ivars accessed via an explicit object
in a function. Fixes radar 7522803.

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

14 years agoRoll out ASTContext::getTypeSizeInChars(), replacing instances of
Ken Dyck [Mon, 11 Jan 2010 17:06:35 +0000 (17:06 +0000)]
Roll out ASTContext::getTypeSizeInChars(), replacing instances of
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.

Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.

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

14 years agoMake Clang complain about taking the address of an unqualified member function. Fixes...
Sebastian Redl [Mon, 11 Jan 2010 15:56:56 +0000 (15:56 +0000)]
Make Clang complain about taking the address of an unqualified member function. Fixes PR5985.

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

14 years agoEnhance ScanReachableSymbols::scan(). Now another OSAtomic test case passes.
Zhongxing Xu [Mon, 11 Jan 2010 07:40:00 +0000 (07:40 +0000)]
Enhance ScanReachableSymbols::scan(). Now another OSAtomic test case passes.
The old test case has a little mistake.

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

14 years agoEnhance SVals::getAsRegion: get the region that is converted to an integer.
Zhongxing Xu [Mon, 11 Jan 2010 06:52:53 +0000 (06:52 +0000)]
Enhance SVals::getAsRegion: get the region that is converted to an integer.
This with previous patch fixes a OSAtomic test case.

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

14 years agoadd a TODO for a perf improvement in LexIdentifier.
Chris Lattner [Mon, 11 Jan 2010 02:38:50 +0000 (02:38 +0000)]
add a TODO for a perf improvement in LexIdentifier.

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

14 years agoSwitch RegionStore over to using <BaseRegion+raw offset> to store
Ted Kremenek [Mon, 11 Jan 2010 02:33:26 +0000 (02:33 +0000)]
Switch RegionStore over to using <BaseRegion+raw offset> to store
value bindings.  Along with a small change to OSAtomicChecker, this
resolves <rdar://problem/7527292> and resolves some long-standing
issues with how values can be bound to the same physical address by
not have the same "key".  This change is only a beginning; logically
RegionStore needs to better handle loads from addresses where the
stored value is larger/smaller/different type than the loaded value.
We handle these cases in an approximate fashion now (via
CastRetrievedVal and help in SimpleSValuator), but it could be made
much smarter.

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

14 years agoPreliminary reworking of value-binding logic in RegionStore:
Ted Kremenek [Mon, 11 Jan 2010 00:07:44 +0000 (00:07 +0000)]
Preliminary reworking of value-binding logic in RegionStore:

(1) Introduce a new 'BindingKey' class to match 'BindingValue'.  This
gives us the flexibility to change the current key value from 'const
MemRegion*' to something more interesting.

(2) Rework additions/removals/lookups from the store to use new
'Remove', 'Add', 'Lookup' utility methods.

No "real" functionality change; just prep work and abstraction.

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

14 years agoDo not parse hexadecimal floating point literals in C++0x mode because they are
Sean Hunt [Sun, 10 Jan 2010 23:37:56 +0000 (23:37 +0000)]
Do not parse hexadecimal floating point literals in C++0x mode because they are
incompatible with user-defined literals, specifically with the following form:

  0x1p+1

The preprocessing-number token extends only as far as the 'p'; the '+' is not
included. Previously we could get away with this extension as p was an invalid
suffix, but now with user-defined literals, 'p' might well be a valid suffix
and we are forced to consider it as such.

This patch also adds a warning in non-0x C++ modes telling the user that
this extension is incompatible with C++0x that is enabled by default
(previously and with other languages, we warn only with a compliance
option such as -pedantic).

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

14 years agoImprove code completion by introducing patterns for the various C and
Douglas Gregor [Sun, 10 Jan 2010 23:08:15 +0000 (23:08 +0000)]
Improve code completion by introducing patterns for the various C and
C++ grammatical constructs that show up in top-level (namespace-level)
declarations, member declarations, template declarations, statements,
expressions, conditions, etc. For example, we now provide a pattern
for

  static_cast<type>(expr)

when we can have an expression, or

  using namespace identifier;

when we can have a using directive.

Also, improves the results of code completion at the beginning of a
top-level declaration. Previously, we would see value names (function
names, global variables, etc.); now we see types, namespace names,
etc., but no values.

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

14 years agoMake sure this test case tests analyzing both x86_64 and i386 archs.
Ted Kremenek [Sun, 10 Jan 2010 22:31:25 +0000 (22:31 +0000)]
Make sure this test case tests analyzing both x86_64 and i386 archs.

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

14 years agoSilence MSVC warning.
Benjamin Kramer [Sun, 10 Jan 2010 19:57:50 +0000 (19:57 +0000)]
Silence MSVC warning.

RewriteObjC.cpp(4419) : warning C4804: '>' : unsafe use of type 'bool' in operation

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

14 years agoMake clone() method out-of-line for Attr classes.
Anton Korobeynikov [Sun, 10 Jan 2010 14:38:13 +0000 (14:38 +0000)]
Make clone() method out-of-line for Attr classes.

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

14 years agoTry to make cmake happy
Anton Korobeynikov [Sun, 10 Jan 2010 13:06:34 +0000 (13:06 +0000)]
Try to make cmake happy

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

14 years agoGeneralize target weirdness handling having proper layering in mind:
Anton Korobeynikov [Sun, 10 Jan 2010 12:58:08 +0000 (12:58 +0000)]
Generalize target weirdness handling having proper layering in mind:
 1. Add helper class for sema checks for target attributes
 2. Add helper class for codegen of target attributes

As a proof-of-concept - implement msp430's 'interrupt' attribute.

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

14 years agoRename file to generalization in next commits
Anton Korobeynikov [Sun, 10 Jan 2010 12:57:30 +0000 (12:57 +0000)]
Rename file to generalization in next commits

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

14 years agoSimplify code. No functionality change.
Benjamin Kramer [Sun, 10 Jan 2010 09:51:00 +0000 (09:51 +0000)]
Simplify code. No functionality change.

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

14 years agoEnhance test case.
Zhongxing Xu [Sun, 10 Jan 2010 02:52:56 +0000 (02:52 +0000)]
Enhance test case.

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

14 years agostringref'ize a bunch of filename handling logic. Much
Chris Lattner [Sun, 10 Jan 2010 01:35:12 +0000 (01:35 +0000)]
stringref'ize a bunch of filename handling logic.  Much
nicer than passing around two const char*'s.

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

14 years agotry to make this more stable?
Chris Lattner [Sun, 10 Jan 2010 00:59:17 +0000 (00:59 +0000)]
try to make this more stable?

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

14 years agoFix PR5982, a refacto in checking for '=' in a -D argument.
Daniel Dunbar [Sun, 10 Jan 2010 00:46:21 +0000 (00:46 +0000)]
Fix PR5982, a refacto in checking for '=' in a -D argument.

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

14 years agoFix a FIXME.
Daniel Dunbar [Sun, 10 Jan 2010 00:46:10 +0000 (00:46 +0000)]
Fix a FIXME.

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

14 years agoDarwin/ld: Don't pass '-weak_reference_mismatches non-weak' when
Daniel Dunbar [Sun, 10 Jan 2010 00:46:00 +0000 (00:46 +0000)]
Darwin/ld: Don't pass '-weak_reference_mismatches non-weak' when
-weak_reference_mismatches is not present, it is the default.

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

14 years agoadd comment to test.
Chris Lattner [Sun, 10 Jan 2010 00:36:16 +0000 (00:36 +0000)]
add comment to test.

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

14 years agoclarify comment.
Chris Lattner [Sun, 10 Jan 2010 00:35:27 +0000 (00:35 +0000)]
clarify comment.

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

14 years agoimplement rdar://7520940: published framework headers should
Chris Lattner [Sun, 10 Jan 2010 00:24:58 +0000 (00:24 +0000)]
implement rdar://7520940: published framework headers should
import other headers within the same framework with the full
framework path, not with a relative include.

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

14 years agoFix overzealous assertion in GRExprEngine::VisitLValue(). A
Ted Kremenek [Sat, 9 Jan 2010 22:58:54 +0000 (22:58 +0000)]
Fix overzealous assertion in GRExprEngine::VisitLValue().  A
CallExpr/ObjCMessageExpr can be visited in an "lvalue" context if it
returns a struct temporary.  Currently the analyzer doesn't reason
about struct temporary returned by function calls, but we shouldn't
crash here either.

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

14 years agoimplement -ftabstop=width, patch by Christian Adåker
Chris Lattner [Sat, 9 Jan 2010 21:54:33 +0000 (21:54 +0000)]
implement -ftabstop=width, patch by Christian Adåker

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

14 years agorevert 91891, a workaround for PR5514.
Chris Lattner [Sat, 9 Jan 2010 21:45:57 +0000 (21:45 +0000)]
revert 91891, a workaround for PR5514.

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

14 years agoimplement codegen support for preinc as an lvalue, PR5514.
Chris Lattner [Sat, 9 Jan 2010 21:44:40 +0000 (21:44 +0000)]
implement codegen support for preinc as an lvalue, PR5514.

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

14 years agorefactor pre/postinc logic into CGF and require the caller to pass in the
Chris Lattner [Sat, 9 Jan 2010 21:40:03 +0000 (21:40 +0000)]
refactor pre/postinc logic into CGF and require the caller to pass in the
lvalue to poke, no functionality change.

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

14 years agorevert r92749, which is just dead code.
Chris Lattner [Sat, 9 Jan 2010 21:14:47 +0000 (21:14 +0000)]
revert r92749, which is just dead code.

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

14 years agomake missing prototypes warn by default in c99 mode like GCC does,
Chris Lattner [Sat, 9 Jan 2010 20:43:38 +0000 (20:43 +0000)]
make missing prototypes warn by default in c99 mode like GCC does,
rdar://7083878

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

14 years agoadd a bunch of missing prototypes to tests
Chris Lattner [Sat, 9 Jan 2010 20:43:19 +0000 (20:43 +0000)]
add a bunch of missing prototypes to tests

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

14 years agoFix broken diagnostic when returning the address of a stack-allocated array.
Ted Kremenek [Sat, 9 Jan 2010 20:05:00 +0000 (20:05 +0000)]
Fix broken diagnostic when returning the address of a stack-allocated array.

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

14 years agoSimplify with StringSwitch.
Benjamin Kramer [Sat, 9 Jan 2010 18:53:11 +0000 (18:53 +0000)]
Simplify with StringSwitch.

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

14 years ago2010 is here.
Chris Lattner [Sat, 9 Jan 2010 18:40:42 +0000 (18:40 +0000)]
2010 is here.

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

14 years agoHopefully unbreak build with g++ >= 4.3.
Benjamin Kramer [Sat, 9 Jan 2010 18:20:57 +0000 (18:20 +0000)]
Hopefully unbreak build with g++ >= 4.3.

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

14 years agoUse MacroBuilder for TargetDefines instead of std::vector.
Benjamin Kramer [Sat, 9 Jan 2010 17:55:51 +0000 (17:55 +0000)]
Use MacroBuilder for TargetDefines instead of std::vector.

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

14 years agoMove MacroBuilder into Frontend/Utils.h and clean it up a bit.
Benjamin Kramer [Sat, 9 Jan 2010 17:43:21 +0000 (17:43 +0000)]
Move MacroBuilder into Frontend/Utils.h and clean it up a bit.

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

14 years agoRework InitPreprocessor to use a MacroBuilder class instead of pushing around
Benjamin Kramer [Sat, 9 Jan 2010 16:17:37 +0000 (16:17 +0000)]
Rework InitPreprocessor to use a MacroBuilder class instead of pushing around
std::vectors.

- MacroBuilder wraps a raw_ostream so it can easily write to any buffer
  supported by raw_ostream.
- MacroBuilder's method take Twines for easy string concatenation (this was done
  with sprintf and temporary buffers before).
- Targets still use std::vector as they don't have access to the builder.

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

14 years agoSwitch UndefineBuiltinMacro() over to using StringRef
Kovarththanan Rajaratnam [Sat, 9 Jan 2010 09:31:32 +0000 (09:31 +0000)]
Switch UndefineBuiltinMacro() over to using StringRef

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

14 years agoSwitch DefineBuiltinMacro() over to using StringRef
Kovarththanan Rajaratnam [Sat, 9 Jan 2010 09:27:11 +0000 (09:27 +0000)]
Switch DefineBuiltinMacro() over to using StringRef

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

14 years agoWhen binding an rvalue to a reference, create a temporary object. Use
Zhongxing Xu [Sat, 9 Jan 2010 09:16:47 +0000 (09:16 +0000)]
When binding an rvalue to a reference, create a temporary object. Use
CXXObjectRegion to represent it.

In Environment, lookup a literal expression before make up a value for it.

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

14 years agoimprove support for dragonfly, patch by Sascha Wildner!
Chris Lattner [Sat, 9 Jan 2010 05:41:14 +0000 (05:41 +0000)]
improve support for dragonfly, patch by Sascha Wildner!

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

14 years agoFix indentation.
Mike Stump [Fri, 8 Jan 2010 19:28:41 +0000 (19:28 +0000)]
Fix indentation.

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

14 years agoAdd in final overrider logic.
Mike Stump [Fri, 8 Jan 2010 19:25:36 +0000 (19:25 +0000)]
Add in final overrider logic.

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

14 years agoFix handling in GRExprEngine of 'default' branch in switch statements
Ted Kremenek [Fri, 8 Jan 2010 18:54:04 +0000 (18:54 +0000)]
Fix handling in GRExprEngine of 'default' branch in switch statements
when the default case is winnowed down to be infeasible.  When all
cases were ruled out (and the analysis state for the default case
would be infeasible) we would still consider the default case
possible.  This fixes PR 5969.

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

14 years agoOrganize testcase into namespaces.
John McCall [Fri, 8 Jan 2010 18:40:32 +0000 (18:40 +0000)]
Organize testcase into namespaces.

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

14 years agoFor now, add back clang_getDeclSource().
Ted Kremenek [Fri, 8 Jan 2010 17:11:32 +0000 (17:11 +0000)]
For now, add back clang_getDeclSource().

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

14 years agoChange the printing of OR_Deleted overload results to print all the candidates,
John McCall [Fri, 8 Jan 2010 04:41:39 +0000 (04:41 +0000)]
Change the printing of OR_Deleted overload results to print all the candidates,
not just the viable ones.  This is reasonable because the most common use of
deleted functions is to exclude some implicit conversion during calls;  users
therefore will want to figure out why some other options were excluded.

Started sorting overload results.  Right now it just sorts by location in the
translation unit (after putting viable functions first), but we can do better than
that.

Changed bool OnlyViable parameter to PrintOverloadCandidates to an enum for better
self-documentation.

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

14 years agoUse -fno-math-errno by default, and remove the IsMathErrnoDefault
Dan Gohman [Fri, 8 Jan 2010 02:20:44 +0000 (02:20 +0000)]
Use -fno-math-errno by default, and remove the IsMathErrnoDefault
targethook, which is no longer being used. This fixes PR5971.

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

14 years agoclang ObjC rewriter: generated code used in "for (x in y)" loop uses
Fariborz Jahanian [Fri, 8 Jan 2010 01:29:44 +0000 (01:29 +0000)]
clang ObjC rewriter: generated code used in "for (x in y)" loop uses
incorrect cast, causing compile error (fixes radar 7342867).

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

14 years agoReorganize PrintOverloadCandidates. No functionality change.
John McCall [Fri, 8 Jan 2010 00:58:21 +0000 (00:58 +0000)]
Reorganize PrintOverloadCandidates.  No functionality change.

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

14 years agoFix for PR5967: Make const-marking for LLVM globals correct for cases requiring
Eli Friedman [Fri, 8 Jan 2010 00:50:11 +0000 (00:50 +0000)]
Fix for PR5967: Make const-marking for LLVM globals correct for cases requiring
run-time initialization, and emit run-time initializers aggresively to avoid
ordering issues with deferred globals.

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

14 years agoImprove the fix-its for -Wparentheses to ensure that the fix-it
Douglas Gregor [Fri, 8 Jan 2010 00:20:23 +0000 (00:20 +0000)]
Improve the fix-its for -Wparentheses to ensure that the fix-it
suggestions follow recovery. Additionally, add a note to these
diagnostics which suggests a fix-it for changing the behavior to what
the user probably meant. Examples:

t.cpp:2:9: warning: & has lower precedence than ==; == will be evaluated first
      [-Wparentheses]
  if (i & j == k) {
        ^~~~~~~~
          (     )
t.cpp:2:9: note: place parentheses around the & expression to evaluate it first
  if (i & j == k) {
        ^
      (    )

t.cpp:14:9: warning: using the result of an assignment as a condition
without
      parentheses [-Wparentheses]
  if (i = f()) {
      ~~^~~~~
      (      )
t.cpp:14:9: note: use '==' to turn this assignment into an equality
comparison
  if (i = f()) {
        ^
        ==

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

14 years agoExport a public symbol for classes with the GNU runtime.
David Chisnall [Fri, 8 Jan 2010 00:14:31 +0000 (00:14 +0000)]
Export a public symbol for classes with the GNU runtime.

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

14 years agoMore crashtracer enhancements to CIndex. When "popping" a crashtracer string
Ted Kremenek [Thu, 7 Jan 2010 23:13:53 +0000 (23:13 +0000)]
More crashtracer enhancements to CIndex.  When "popping" a crashtracer string
restore to the one most recently created.

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

14 years agoAdd an "implicit" bit to CXXThisExpr, so that we can track
Douglas Gregor [Thu, 7 Jan 2010 23:12:05 +0000 (23:12 +0000)]
Add an "implicit" bit to CXXThisExpr, so that we can track
implicitness without losing track of the (logical or actual) location
where "this" would occur in the source.

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

14 years agoFixes a bug where we were rewriting two definitions of
Fariborz Jahanian [Thu, 7 Jan 2010 22:51:18 +0000 (22:51 +0000)]
Fixes a bug where we were rewriting two definitions of
_objc_method (part of radar 7490408).

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

14 years agoAdd checker for type infos.
Mike Stump [Thu, 7 Jan 2010 22:50:03 +0000 (22:50 +0000)]
Add checker for type infos.

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

14 years agoTidy up crashtracer logic in CIndex.
Ted Kremenek [Thu, 7 Jan 2010 22:49:05 +0000 (22:49 +0000)]
Tidy up crashtracer logic in CIndex.

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

14 years agoAdd checked for VTTs.
Mike Stump [Thu, 7 Jan 2010 22:28:10 +0000 (22:28 +0000)]
Add checked for VTTs.

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

14 years agoDetailed vtable checker.
Mike Stump [Thu, 7 Jan 2010 22:21:26 +0000 (22:21 +0000)]
Detailed vtable checker.

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

14 years agoFixes a bug in my last patch (related to radar 7490331).
Fariborz Jahanian [Thu, 7 Jan 2010 22:15:31 +0000 (22:15 +0000)]
Fixes a bug in my last patch (related to radar 7490331).

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

14 years ago1/2 off all structs should not have any virtual functions.
Mike Stump [Thu, 7 Jan 2010 20:55:28 +0000 (20:55 +0000)]
1/2 off all structs should not have any virtual functions.
Replace magic numbers with uuids.

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

14 years agoAdd a descriptive tag to each line to make the exact differences
Mike Stump [Thu, 7 Jan 2010 19:39:43 +0000 (19:39 +0000)]
Add a descriptive tag to each line to make the exact differences
easier to understand.

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

14 years agoWhen parsing an identifier as an expression in C++, only try to annotate it
John McCall [Thu, 7 Jan 2010 19:29:58 +0000 (19:29 +0000)]
When parsing an identifier as an expression in C++, only try to annotate it
as a type or scope token if the next token requires it.

This eliminates a lot of redundant lookups in C++, but there's room for
improvement;  a better solution would do a single lookup whose kind and
results would be passed through the parser.

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

14 years agoDon't use two argument mixing function.
Mike Stump [Thu, 7 Jan 2010 19:24:27 +0000 (19:24 +0000)]
Don't use two argument mixing function.

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

14 years agoAlso generate the .s files.
Mike Stump [Thu, 7 Jan 2010 19:19:39 +0000 (19:19 +0000)]
Also generate the .s files.

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