]> granicus.if.org Git - clang/log
clang
13 years ago[analyzer] Remove LocationContext and a dependency from PathDiagnosticLoaction.
Anna Zaks [Tue, 20 Sep 2011 16:23:37 +0000 (16:23 +0000)]
[analyzer] Remove LocationContext and a dependency from PathDiagnosticLoaction.

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

13 years agoClarify PNaCl target characteristics: set LongDoubleWidth, PtrDiffType, IntPtrType,
Ivan Krasin [Tue, 20 Sep 2011 14:56:54 +0000 (14:56 +0000)]
Clarify PNaCl target characteristics: set LongDoubleWidth, PtrDiffType, IntPtrType,
change __builtin_va_list to from a structure to int[4] (same alignment
and size, but with a simpler representation). Patch by David Meyer!

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

13 years agoRemove redundant break statements, and replace asserts with llvm_unreachable
Peter Collingbourne [Tue, 20 Sep 2011 12:40:26 +0000 (12:40 +0000)]
Remove redundant break statements, and replace asserts with llvm_unreachable

Per John's review comments for r140068.

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

13 years agoFix a crash-on-invalid with bad CV-qualification on 'this' in the
John McCall [Tue, 20 Sep 2011 06:21:28 +0000 (06:21 +0000)]
Fix a crash-on-invalid with bad CV-qualification on 'this' in the
presence of an implicit move assignment operator.  I think the implicit
copy assignment operator case was also wrong, but just in a "displaying
the wrong diagnostic" way.

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

13 years agoFix a pretty nasty bug in noreturn destructors that cascaded into lots
Chandler Carruth [Tue, 20 Sep 2011 04:55:26 +0000 (04:55 +0000)]
Fix a pretty nasty bug in noreturn destructors that cascaded into lots
of false positive warnings that depend on noreturn destructors pruning
the CFGs, but only in C++0x mode!

This was really surprising as the debugger quickly reveals that the
attributes are parsed correctly (and using the same code) in both modes.
The warning fires in the same way in both modes. But between parsing and
building the destructor declaration with the noreturn attribute and the
warning, it magically disappears. The key? The 'noexcept' appears!

When we were rebuilding the destructor type with the computed implicit
noexcept we completely dropped the old type on the floor. This almost
makes sense (as the arguments and return type to a destructor aren't
exactly unpredictable), but lost any function type attributes as well.
The fix is simple, we build the new type off of the old one rather than
starting fresh.

Testing this is a bit awkward. I've done it by running the
noreturn-sensitive tests in both modes, which previous failed and now
passes, but if anyone has ideas about how to more specifically and
thoroughly test that the extended info on a destructor is preserved when
adding noexcept, I'm all ears.

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

13 years ago[analyzer] Refactor PathDiagnosticLocation: Pre-compute Range and Location with gen...
Anna Zaks [Tue, 20 Sep 2011 01:51:40 +0000 (01:51 +0000)]
[analyzer] Refactor PathDiagnosticLocation: Pre-compute Range and Location with gen methods on object creation instead of computing on demand. This would allow to remove dependency on the other members which help with construction and might not even be valid at later stages (to be removed later on).

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

13 years ago[analyzer] Use more create methods in the PathDiagnostic, cleanup.
Anna Zaks [Tue, 20 Sep 2011 01:38:47 +0000 (01:38 +0000)]
[analyzer] Use more create methods in the PathDiagnostic, cleanup.

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

13 years agoDon't assume that the clause is a GlobalVariable. It could be a constant.
Bill Wendling [Tue, 20 Sep 2011 00:40:19 +0000 (00:40 +0000)]
Don't assume that the clause is a GlobalVariable. It could be a constant.

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

13 years ago[analyzer] BugReport has a profile method, so reuse it here.
Anna Zaks [Mon, 19 Sep 2011 23:44:31 +0000 (23:44 +0000)]
[analyzer] BugReport has a profile method, so reuse it here.

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

13 years ago[analyzer] Add a convinience method.
Anna Zaks [Mon, 19 Sep 2011 23:18:44 +0000 (23:18 +0000)]
[analyzer] Add a convinience method.

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

13 years ago[analyzer] Constify a method.
Anna Zaks [Mon, 19 Sep 2011 23:17:48 +0000 (23:17 +0000)]
[analyzer] Constify a method.

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

13 years agoAdd list initialization for complex numbers in C. Essentially, this allows "_Complex...
Eli Friedman [Mon, 19 Sep 2011 23:17:44 +0000 (23:17 +0000)]
Add list initialization for complex numbers in C.  Essentially, this allows "_Complex float x = {1.0f, 2.0f};".  See changes to docs/LanguageExtensions.html for a longer description.

<rdar://problem/9397672>.

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

13 years agoThe eh.selector intrinsic isn't used anymore. Replace the check here with a
Bill Wendling [Mon, 19 Sep 2011 22:08:36 +0000 (22:08 +0000)]
The eh.selector intrinsic isn't used anymore. Replace the check here with a
check for the landingpad instruction instead. This check looks at each of the
clauses in the landingpad instruction. If it's a catch clause, it compares the
name directly with the global. If it's a filter clause, it has to look through
each value in the filer to see if any have the prefix.

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

13 years agoFix gcc build.
Argyrios Kyrtzidis [Mon, 19 Sep 2011 22:02:08 +0000 (22:02 +0000)]
Fix gcc build.

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

13 years agoOpenCL: introduce support for function scope __local variables
Peter Collingbourne [Mon, 19 Sep 2011 21:14:35 +0000 (21:14 +0000)]
OpenCL: introduce support for function scope __local variables

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

13 years ago[PCH] The range map for SLoc offsets is a reversed one, not negated.
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:54:44 +0000 (20:54 +0000)]
[PCH] The range map for SLoc offsets is a reversed one, not negated.

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

13 years agoIn libclang, when visiting preprocessed entities in a source range, use
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:40:48 +0000 (20:40 +0000)]
In libclang, when visiting preprocessed entities in a source range, use
PreprocessingRecord's getPreprocessedEntitiesInRange.

Also remove all the stuff that were added in ASTUnit that are unnecessary now
that we do a binary search for preprocessed entities and deserialize only
what is necessary.

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

13 years agoIntroduce local_begin()/local_end() methods in PreprocessingRecord which
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:40:42 +0000 (20:40 +0000)]
Introduce local_begin()/local_end() methods in PreprocessingRecord which
return iterators for local, non-loaded, preprocessed entities.

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

13 years agoIn CodeGenAction::ExecuteAction() use SourceManager::translateFileLineCol()
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:40:38 +0000 (20:40 +0000)]
In CodeGenAction::ExecuteAction() use SourceManager::translateFileLineCol()
instead of getLocation() since we don't care about expanded macro arguments.

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

13 years ago[libclang] When getting a source location from a file:line:col triplet
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:40:35 +0000 (20:40 +0000)]
[libclang] When getting a source location from a file:line:col triplet
check whether the requested location points inside the precompiled preamble,
in which case the returned source location will be a "loaded" one.

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

13 years agoBreak SourceManager::translateFileLineCol into translateLineCol that returns the
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:40:29 +0000 (20:40 +0000)]
Break SourceManager::translateFileLineCol into translateLineCol that returns the
source location of line:col of a specific FileID.

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

13 years agoIntroduce PreprocessingRecord::getPreprocessedEntitiesInRange()
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:40:25 +0000 (20:40 +0000)]
Introduce PreprocessingRecord::getPreprocessedEntitiesInRange()
which will do a binary search and return a pair of iterators
for preprocessed entities in the given source range.

Source ranges of preprocessed entities are stored twice currently in
the PCH/Module file but this will be fixed in a subsequent commit.

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

13 years agoRename SourceLocation::getFileLocWithOffset -> getLocWithOffset.
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:40:19 +0000 (20:40 +0000)]
Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.

It already works (and is useful with) macro locs as well.

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

13 years agoMake ASTReader/ASTWriter friends of SourceLocation. They already
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:40:08 +0000 (20:40 +0000)]
Make ASTReader/ASTWriter friends of SourceLocation. They already
depend on internal knowledge of SourceLocation.

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

13 years agoIntroduce isLoadedSourceLocation() and isLocalSourceLocation() methods in SourceManager.
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:40:05 +0000 (20:40 +0000)]
Introduce isLoadedSourceLocation() and isLocalSourceLocation() methods in SourceManager.

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

13 years agoConst-ify some methods in ASTReader.
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:40:02 +0000 (20:40 +0000)]
Const-ify some methods in ASTReader.

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

13 years agoFor SourceManager::isBeforeInTranslationUnit, a location pointing
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:39:57 +0000 (20:39 +0000)]
For SourceManager::isBeforeInTranslationUnit, a location pointing
inside a macro argument should be regarded as coming before
the location of the expanded tokens.

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

13 years ago[PCH] Preload the PreloadSLocEntries through the SourceManager and
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:39:54 +0000 (20:39 +0000)]
[PCH] Preload the PreloadSLocEntries through the SourceManager and
don't call ReadSLocEntryRecord() directly because the entry may have
already been loaded in which case calling ReadSLocEntryRecord()
directly would trigger an assertion in SourceManager.

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

13 years agoFor SourceManager::isBeforeInTranslationUnit, when one location
Argyrios Kyrtzidis [Mon, 19 Sep 2011 20:39:51 +0000 (20:39 +0000)]
For SourceManager::isBeforeInTranslationUnit, when one location
points at the inclusion/expansion point of the other, regard this
as coming before the other.

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

13 years agoThrow the switch to convert clang to the new exception handling model!
Bill Wendling [Mon, 19 Sep 2011 20:31:14 +0000 (20:31 +0000)]
Throw the switch to convert clang to the new exception handling model!

This model uses the 'landingpad' instruction, which is pinned to the top of the
landing pad. (A landing pad is defined as the destination of the unwind branch
of an invoke instruction.) All of the information needed to generate the correct
exception handling metadata during code generation is encoded into the
landingpad instruction.

The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic
call. It's lowered in much the same way as the intrinsic is.

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

13 years agoChanges to the name lookup have caused a regression in the digraph fix-it hint.
Richard Trieu [Mon, 19 Sep 2011 19:01:00 +0000 (19:01 +0000)]
Changes to the name lookup have caused a regression in the digraph fix-it hint.
For instance:

template <class T> void E() {};
class F {};

void test() {
 ::E<::F>();
 E<::F>();
}

Gives the following error messages:

error: found '<::' after a template name which forms the
     digraph '<:' (aka '[') and a ':', did you mean '< ::'?
 ::E<::F>();
    ^~~
    < ::
error: expected expression
 E<::F>();
    ^
error: expected ']'
note: to match this '['
 E<::F>();

This patch adds the digraph fix-it check right before the name lookup,
moves the shared checking code to a new function, and adds new
tests to catch future regressions.

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

13 years agoTighten check to match an ivar with corresponding property by using ObjCImplementatio...
Devang Patel [Mon, 19 Sep 2011 18:54:16 +0000 (18:54 +0000)]
Tighten check to match an ivar with corresponding property by using ObjCImplementationDecl.
Radar 10139522 - Part 1.

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

13 years agoFix a QoI bug with overloaded operators inside macros.
Matt Beaumont-Gay [Mon, 19 Sep 2011 18:51:20 +0000 (18:51 +0000)]
Fix a QoI bug with overloaded operators inside macros.

We were failing to set source locations and ranges in isUnusedResultAWarning
for CXXOperatorCallExprs, leading to an "expression result unused" warning
with absolutely no context if the expression was inside a macro.

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

13 years agoobjc - some refactoring of my last 'self' patch.
Fariborz Jahanian [Mon, 19 Sep 2011 18:06:07 +0000 (18:06 +0000)]
objc - some refactoring of my last 'self' patch.

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

13 years agoIn apple-kext mode, use external linkage for explicit template instantiations
John McCall [Mon, 19 Sep 2011 18:05:26 +0000 (18:05 +0000)]
In apple-kext mode, use external linkage for explicit template instantiations
instead of internal linkage.

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

13 years agoCurContext cannot be null ever.
Fariborz Jahanian [Mon, 19 Sep 2011 16:32:32 +0000 (16:32 +0000)]
CurContext cannot be null ever.

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

13 years agoRemoved an unused field and its accessors methods.
Erik Verbruggen [Mon, 19 Sep 2011 15:10:40 +0000 (15:10 +0000)]
Removed an unused field and its accessors methods.

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

13 years agoFirst test commit.
Erik Verbruggen [Mon, 19 Sep 2011 15:03:11 +0000 (15:03 +0000)]
First test commit.

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

13 years agoIn constructors, don't generate implicit initializers for members of anonymous struct...
Richard Smith [Mon, 19 Sep 2011 13:34:43 +0000 (13:34 +0000)]
In constructors, don't generate implicit initializers for members of anonymous structs contained within anonymous unions.

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

13 years agoRemove function which is unused as of r139996. Thanks to David Blaikie for bringing...
Richard Smith [Mon, 19 Sep 2011 11:19:27 +0000 (11:19 +0000)]
Remove function which is unused as of r139996. Thanks to David Blaikie for bringing this to my attention.

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

13 years agoDo not use builtin includes if -fms-compatibility is specified. Some MSVC header...
Francois Pichet [Mon, 19 Sep 2011 05:15:54 +0000 (05:15 +0000)]
Do not use builtin includes if -fms-compatibility is specified. Some MSVC header files have the same name as clang's builtins, this creates clash.

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

13 years agoMove the "jump bypasses variable initialization" error -> warning downgrade from...
Francois Pichet [Sun, 18 Sep 2011 21:48:27 +0000 (21:48 +0000)]
Move the "jump bypasses variable initialization" error -> warning downgrade from -fms-extensions to -fms-compatibility.

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

13 years agoIn Microsoft mode(-fms-compatibility), prefer an integral conversion to a floating...
Francois Pichet [Sun, 18 Sep 2011 21:37:37 +0000 (21:37 +0000)]
In Microsoft mode(-fms-compatibility), prefer an integral conversion to a floating-to-integral conversion if the integral conversion is between types of the same size.

For example:
 void f(float);
 void f(int);
 int main {
    long a;
    f(a);
 }
Here, MSVC will call f(int) instead of generating a compile error as clang will do in standard mode.
This fixes a few errors when parsing MFC code with clang.

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

13 years agoPR10304: Do not call destructors for data members from union destructors. Prior to...
Richard Smith [Sun, 18 Sep 2011 12:11:43 +0000 (12:11 +0000)]
PR10304: Do not call destructors for data members from union destructors. Prior to C++11, this
has no effect since any such destructors must be trivial, and in C++11 such destructors must not
be called.

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

13 years agoPR10954: variant members should not be implicitly initialized in constructors if no
Richard Smith [Sun, 18 Sep 2011 11:14:50 +0000 (11:14 +0000)]
PR10954: variant members should not be implicitly initialized in constructors if no
mem-initializer is specified for them, unless an in-class initializer is specified.

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

13 years agoFix PR10531. Attach an initializer to anonymous unions, since the default constructor...
Richard Smith [Sun, 18 Sep 2011 00:06:34 +0000 (00:06 +0000)]
Fix PR10531. Attach an initializer to anonymous unions, since the default constructor might not be trivial (if there is an in-class initializer for some member) and might be deleted.

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

13 years agoLet -Warray-bounds handle casted array types without false positives.
Nico Weber [Sat, 17 Sep 2011 22:59:41 +0000 (22:59 +0000)]
Let -Warray-bounds handle casted array types without false positives.

Fixes PR10771.

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

13 years agoobjc - Treat type of 'self' in class methods as root of
Fariborz Jahanian [Sat, 17 Sep 2011 19:23:40 +0000 (19:23 +0000)]
objc - Treat type of 'self' in class methods as root of
class of this method. // rdar://10109725

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

13 years agoobjc: Don't crash with decl context for property impl.
Fariborz Jahanian [Sat, 17 Sep 2011 18:48:50 +0000 (18:48 +0000)]
objc: Don't crash with decl context for property impl.
is missing. // rdar//10127639

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

13 years agoRename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear that...
Francois Pichet [Sat, 17 Sep 2011 17:15:52 +0000 (17:15 +0000)]
Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag.

Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag.

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

13 years agoWhen we load header file information from the external source (i.e.,
Douglas Gregor [Sat, 17 Sep 2011 05:35:18 +0000 (05:35 +0000)]
When we load header file information from the external source (i.e.,
the AST reader), merge that header file information with whatever
header file information we already have. Otherwise, we might forget
something we already knew (e.g., that the header was #import'd already).

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

13 years agoAs per discussion with Doug Gregor on the IRC channel, introduce a new compiler switc...
Francois Pichet [Sat, 17 Sep 2011 04:32:15 +0000 (04:32 +0000)]
As per discussion with Doug Gregor on the IRC channel, introduce a new compiler switch: -fms-compatility.

Microsoft specific tweaking will now fall into 2 categories:

    - fms-extension: Microsoft specific extensions that should never change the meaning of an otherwise well formed code. Currently map to LangOptions::Microsoft. (To be clearer, I am planning to change the name to LangOptions::MicrosoftExt).

    - fms-compatibility: Really a MSVC emulation mode. Map to LangOptions::MicrosoftMode. Can change the meaning of an otherwise standard conformant program.

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

13 years agoPass -fmodule-cache-path along to -cc1 properly
Douglas Gregor [Sat, 17 Sep 2011 02:20:28 +0000 (02:20 +0000)]
Pass -fmodule-cache-path along to -cc1 properly

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

13 years agoWith modules, we can end up loading a new module after we've seen an
Douglas Gregor [Sat, 17 Sep 2011 00:05:03 +0000 (00:05 +0000)]
With modules, we can end up loading a new module after we've seen an
arbitrary amount of code. This forces us to stage the AST writer more
strictly, ensuring that we don't assign a declaration ID to a
declaration until after we're certain that no more modules will get
loaded.

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

13 years agoIn Microsoft mode, warn if an indirect goto jump over a variable initialization.
Francois Pichet [Fri, 16 Sep 2011 23:15:32 +0000 (23:15 +0000)]
In Microsoft mode, warn if an indirect goto jump over a variable initialization.
Also add a test case for the non Microsoft case because such test didn't exist.

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

13 years agoFix massive LiveVariables regression (due to LiveVariables rewrite) by addressing...
Ted Kremenek [Fri, 16 Sep 2011 23:01:39 +0000 (23:01 +0000)]
Fix massive LiveVariables regression (due to LiveVariables rewrite) by addressing two performance problems:

- Speed of "merge()", which merged data flow facts.  This was doing a set canonicalization on every insertion, which was super slow.
  To fix this, we use ImmutableSetRef.

- Visit CFGBlocks in reverse postorder.  This is a huge speedup, as on some test cases the algorithm would take many iterations
  to converge.

This contains a bunch of copy-paste from UninitializedValues.cpp and ThreadSafety.cpp.  The idea
was to get something working first, and then refactor the common logic for all three files into
a separate analysis/library entry point.

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

13 years agoFix search paths for Ubuntu 11.04 x86. Patch by Stepan Dyatkovskiy.
Eli Friedman [Fri, 16 Sep 2011 21:04:38 +0000 (21:04 +0000)]
Fix search paths for Ubuntu 11.04 x86.  Patch by Stepan Dyatkovskiy.

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

13 years ago[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of Source...
Anna Zaks [Fri, 16 Sep 2011 19:18:30 +0000 (19:18 +0000)]
[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 5 of ?):
 - Get rid of PathDiagnosticLocation(SourceRange r,..) constructor by providing a bunch of create methods.
 - The PathDiagnosticLocation(SourceLocation L,..), which is used by crate methods, will eventually become private.
 - Test difference is in the case when the report starts at the beginning of the function. We used to represent that point as a range of the very first token in the first statement. Now, it's just a single location representing the first character of the first statement.

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

13 years agotest/CodeGen/sse-builtins.c: Make this host-independent to unbreak posix-unlike hosts.
NAKAMURA Takumi [Fri, 16 Sep 2011 03:55:36 +0000 (03:55 +0000)]
test/CodeGen/sse-builtins.c: Make this host-independent to unbreak posix-unlike hosts.

Without -ffreestanding, clang tries to seek /usr/include/stdlib.h in host filesystem, even on Windows hosts.

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

13 years agoMoves calls of checkArithmeticNull() from CreateBuiltinBinOp() into the individual...
Richard Trieu [Fri, 16 Sep 2011 00:53:10 +0000 (00:53 +0000)]
Moves calls of checkArithmeticNull() from CreateBuiltinBinOp() into the individual Check*Operands() functions.

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

13 years agoThread safety: Adding FIXMEs and a couple cleanups
Caitlin Sadowski [Fri, 16 Sep 2011 00:35:54 +0000 (00:35 +0000)]
Thread safety: Adding FIXMEs and a couple cleanups

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

13 years agoTweak the module auto-import heuristics a bit
Douglas Gregor [Fri, 16 Sep 2011 00:22:46 +0000 (00:22 +0000)]
Tweak the module auto-import heuristics a bit

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

13 years agoRemove no longer needed LHSType and RHSType from checkArithmeticNull()
Richard Trieu [Thu, 15 Sep 2011 23:57:21 +0000 (23:57 +0000)]
Remove no longer needed LHSType and RHSType from checkArithmeticNull()

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

13 years agoChange checkArithmeticNull() to use a NonNullType, instead of checking both the
Richard Trieu [Thu, 15 Sep 2011 23:51:29 +0000 (23:51 +0000)]
Change checkArithmeticNull() to use a NonNullType, instead of checking both the
LHSType and RHSType for everything.

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

13 years agoRemove standard library includes from test; they explode on Windows.
Eli Friedman [Thu, 15 Sep 2011 23:24:35 +0000 (23:24 +0000)]
Remove standard library includes from test; they explode on Windows.

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

13 years agoTweak *mmintrin.h so that they don't make any bad assumptions about alignment (which...
Eli Friedman [Thu, 15 Sep 2011 23:15:27 +0000 (23:15 +0000)]
Tweak *mmintrin.h so that they don't make any bad assumptions about alignment (which probably has little effect in practice, but better to get it right).  Make the load in _mm_loadh_pi and _mm_loadl_pi a single LLVM IR instruction to make optimizing easier for CodeGen.

rdar://10054986

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

13 years agoAdd an experimental flag -fauto-module-import that automatically turns
Douglas Gregor [Thu, 15 Sep 2011 22:00:41 +0000 (22:00 +0000)]
Add an experimental flag -fauto-module-import that automatically turns
#include or #import direcctives of framework headers into module
imports of the corresponding framework module.

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

13 years agoFinish the lex->LHS and rex->RHS cleanup in Sema.
Richard Trieu [Thu, 15 Sep 2011 21:56:47 +0000 (21:56 +0000)]
Finish the lex->LHS and rex->RHS cleanup in Sema.

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

13 years agoAdd test case for mutually recursive modules
Douglas Gregor [Thu, 15 Sep 2011 20:54:06 +0000 (20:54 +0000)]
Add test case for mutually recursive modules

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

13 years agoComment what's going on when we compile a module
Douglas Gregor [Thu, 15 Sep 2011 20:53:28 +0000 (20:53 +0000)]
Comment what's going on when we compile a module

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

13 years agoreverse patch in r139818 to focus on 'self'
Fariborz Jahanian [Thu, 15 Sep 2011 20:40:18 +0000 (20:40 +0000)]
reverse patch in r139818 to focus on 'self'
instead of 'Class'.

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

13 years agoDetect cyclic module dependencies in a manner that is rather more
Douglas Gregor [Thu, 15 Sep 2011 20:40:10 +0000 (20:40 +0000)]
Detect cyclic module dependencies in a manner that is rather more
graceful than running out of stack space.

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

13 years ago[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of Source...
Anna Zaks [Thu, 15 Sep 2011 20:06:34 +0000 (20:06 +0000)]
[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 4 of ?):
 - The closing brace is always a single location, not a range.
 - The test case previously had a location key 57:1 followed by a range [57:1 - 57:1].

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

13 years agoEliminate the list of modules from the preprocessor options. This was
Douglas Gregor [Thu, 15 Sep 2011 19:48:59 +0000 (19:48 +0000)]
Eliminate the list of modules from the preprocessor options. This was
used back when we had an -import-module command-line option, but it's
no longer used (or useful).

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

13 years agoEliminate the unused -create-module cc1-level option
Douglas Gregor [Thu, 15 Sep 2011 19:45:56 +0000 (19:45 +0000)]
Eliminate the unused -create-module cc1-level option

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

13 years agoRefactor the load of the exception pointer and the exception selector from their
Bill Wendling [Thu, 15 Sep 2011 18:57:19 +0000 (18:57 +0000)]
Refactor the load of the exception pointer and the exception selector from their
storage slot into helper functions.

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

13 years ago[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of Source...
Anna Zaks [Thu, 15 Sep 2011 18:56:07 +0000 (18:56 +0000)]
[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 2 of ?):
- Fix a fixme and move the logic of creating a PathDiagnosticLocation corresponding to a ProgramPoint into a PathDiagnosticLocation constructor.
- Rename PathDiagnosticLocation::create to differentiate from the added constructor.

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

13 years agoWhen we load the first module, make sure that we wire up the ASTConsumer to the newly...
Douglas Gregor [Thu, 15 Sep 2011 18:47:32 +0000 (18:47 +0000)]
When we load the first module, make sure that we wire up the ASTConsumer to the newly-created ASTReader. This makes sure that CodeGen sees the declarations it is interested in

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

13 years agoObjective-c: Conversion from type Class to any root class type is allowed
Fariborz Jahanian [Thu, 15 Sep 2011 18:30:22 +0000 (18:30 +0000)]
Objective-c: Conversion from type Class to any root class type is allowed
in class methods with no warning. //rdar://10109725

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

13 years agoThread safety: changing naming in error messages based on reviewer comments
Caitlin Sadowski [Thu, 15 Sep 2011 18:13:32 +0000 (18:13 +0000)]
Thread safety: changing naming in error messages based on reviewer comments

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

13 years agoThread safety: test cases originally from gcc annotalysis branch. We are
Caitlin Sadowski [Thu, 15 Sep 2011 18:07:32 +0000 (18:07 +0000)]
Thread safety: test cases originally from gcc annotalysis branch. We are
relicensing them under the license for llvm.

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

13 years ago[PCH] Overhaul how preprocessed entities are [de]serialized.
Argyrios Kyrtzidis [Thu, 15 Sep 2011 18:02:56 +0000 (18:02 +0000)]
[PCH] Overhaul how preprocessed entities are [de]serialized.

-Use an array of offsets for all preprocessed entities
-Get rid of the separate array of offsets for just macro definitions;
 for references to macro definitions use an index inside the preprocessed
 entities array.
-Deserialize each preprocessed entity lazily, at first request; not in bulk.

Paves the way for binary searching of preprocessed entities that will offer
efficiency and will simplify things on the libclang side a lot.

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

13 years agoThread safety: cleaning up FIXME for trylocks
Caitlin Sadowski [Thu, 15 Sep 2011 17:50:19 +0000 (17:50 +0000)]
Thread safety: cleaning up FIXME for trylocks

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

13 years agoThread safety: completeing the implementation of shared/exclusive locks required...
Caitlin Sadowski [Thu, 15 Sep 2011 17:43:08 +0000 (17:43 +0000)]
Thread safety: completeing the implementation of shared/exclusive locks required attributes

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

13 years agoThread safety: refactoring various out of scope warnings to use the same inteface...
Caitlin Sadowski [Thu, 15 Sep 2011 17:25:19 +0000 (17:25 +0000)]
Thread safety: refactoring various out of scope warnings to use the same inteface. This eliminates a lot of unnecessary duplicated code.

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

13 years agoTeach LangOptions::resetNonModularOptions to actually do what it says it does
Douglas Gregor [Thu, 15 Sep 2011 14:56:27 +0000 (14:56 +0000)]
Teach LangOptions::resetNonModularOptions to actually do what it says it does

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

13 years agoPTX: Define target options
Justin Holewinski [Thu, 15 Sep 2011 12:13:38 +0000 (12:13 +0000)]
PTX: Define target options

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

13 years agoRewrite this loop to use partial destruction; I'm not sure it's
John McCall [Thu, 15 Sep 2011 06:49:18 +0000 (06:49 +0000)]
Rewrite this loop to use partial destruction;  I'm not sure it's
possible for that to matter right now, but eventually I think we'll
need to unify this better, and then it might.  Also, use a more
efficient looping structure.

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

13 years agoSorry, that assertion actually already exists.
John McCall [Thu, 15 Sep 2011 01:55:23 +0000 (01:55 +0000)]
Sorry, that assertion actually already exists.

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

13 years agoWe don't generate null initializer expressions anymore, and
John McCall [Thu, 15 Sep 2011 01:54:21 +0000 (01:54 +0000)]
We don't generate null initializer expressions anymore, and
we don't need to.

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

13 years ago[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of Source...
Anna Zaks [Thu, 15 Sep 2011 01:08:34 +0000 (01:08 +0000)]
[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 2 of ?):
- Modify all PathDiagnosticLocation constructors that take Stmt to also requre LocationContext.
- Add a constructor which should be used in case there is no valid statement/location (it will grab the location of the enclosing function).

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

13 years agoEmit debug info for c++0x nullptr.
Devang Patel [Wed, 14 Sep 2011 23:14:14 +0000 (23:14 +0000)]
Emit debug info for c++0x nullptr.

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

13 years agoMake -E work with module imports
Douglas Gregor [Wed, 14 Sep 2011 23:13:09 +0000 (23:13 +0000)]
Make -E work with module imports

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

13 years agoDon't try to write a macro offset for an identifier that names a non-exported macro...
Douglas Gregor [Wed, 14 Sep 2011 22:14:14 +0000 (22:14 +0000)]
Don't try to write a macro offset for an identifier that names a non-exported macro, for real this time

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

13 years agoRevert my exported-macro hackery. Something is amiss
Douglas Gregor [Wed, 14 Sep 2011 20:57:14 +0000 (20:57 +0000)]
Revert my exported-macro hackery. Something is amiss

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

13 years agoThread safety: small fixes in comments
Caitlin Sadowski [Wed, 14 Sep 2011 20:54:57 +0000 (20:54 +0000)]
Thread safety: small fixes in comments

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

13 years agoMake sure that we actually keep the key length and data length in sync when dealing...
Douglas Gregor [Wed, 14 Sep 2011 20:51:12 +0000 (20:51 +0000)]
Make sure that we actually keep the key length and data length in sync when dealing with non-exported macros

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

13 years agoDisable this test on win32. My "sleep 2" trick didn't seem to work
Douglas Gregor [Wed, 14 Sep 2011 20:38:11 +0000 (20:38 +0000)]
Disable this test on win32. My "sleep 2" trick didn't seem to work

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

13 years agoDon't try to write a macro offset for an identifier that names a non-exported macro
Douglas Gregor [Wed, 14 Sep 2011 20:36:30 +0000 (20:36 +0000)]
Don't try to write a macro offset for an identifier that names a non-exported macro

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

13 years agoAdd test for the driver's handling of modules
Douglas Gregor [Wed, 14 Sep 2011 20:29:10 +0000 (20:29 +0000)]
Add test for the driver's handling of modules

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