Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: m-labs/clang-lm32
base: 686ed60
...
head fork: m-labs/clang-lm32
compare: e9f3bba
Checking mergeability… Don't worry, you can still create the pull request.
This comparison is big! We're only showing the most recent 250 commits
Commits on Jul 26, 2011
Eric Christopher Generalize for various build bots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136173 91177308-0d34-0410-b5e6-96231b3b80d8
d579a88
Eric Christopher Try harder to fix these for windows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136177 91177308-0d34-0410-b5e6-96231b3b80d8
7560b3d
Eric Christopher Try a little hack to fix the memset duplication on windows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136179 91177308-0d34-0410-b5e6-96231b3b80d8
b056db9
Douglas Gregor Disable the optimization that skips emission of complete, non-virtual
destructors of abstract classes. It's undefined behavior to actually
call the destructor (e.g., via delete), but the presence of code that
calls this destructor doesn't make the program
ill-formed. Fixes <rdar://problem/9819242>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136180 91177308-0d34-0410-b5e6-96231b3b80d8
3e23d68
@jyasskin jyasskin This patch implements as much of the narrowing conversion error speci…
…fied by

[dcl.init.list] as is possible without generalized initializer lists or full
constant expression support, and adds a c++0x-compat warning in C++98 mode.

The FixIt currently uses a typedef's basename without qualification, which is
likely to be incorrect on some code.  If it's incorrect on too much code, we
should write a function to get the string that refers to a type from a
particular context.

The warning is currently off by default. I'll fix LLVM and clang before turning
it on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136181 91177308-0d34-0410-b5e6-96231b3b80d8
1915913
Eric Christopher This appears to be passing on all hosts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136182 91177308-0d34-0410-b5e6-96231b3b80d8
0cdb55b
Eli Friedman Re-fix r136172 so it isn't an error; apparently, some people are fond…
… of their undefined behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136183 91177308-0d34-0410-b5e6-96231b3b80d8
ef8c79c
Eric Christopher Make this darwin only to simplify the padding calculations per arch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136185 91177308-0d34-0410-b5e6-96231b3b80d8
7e0afd9
Eric Christopher Use the correct definition for memset.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136188 91177308-0d34-0410-b5e6-96231b3b80d8
cd6ab8c
@krememek krememek clang_getCXTUResourceUsage: Report memory used by data structures in …
…SourceManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136189 91177308-0d34-0410-b5e6-96231b3b80d8
ca7dc2b
@krememek krememek clang_getCXTUResourceUsage: report memory used by HeaderSearch.
This required converting the StringMaps to use a BumpPtrAllocator.  I measured the
compile time and saw no observable regression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136190 91177308-0d34-0410-b5e6-96231b3b80d8
d1194fb
Eric Christopher Handle different sized wchar_t for windows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136192 91177308-0d34-0410-b5e6-96231b3b80d8
acc060f
Commits on Jul 27, 2011
@fpichet fpichet In Microsoft mode, if we are within a templated function and we can't…
… resolve Identifier during BuildCXXNestedNameSpecifier, then extend the SS with Identifier. This will have the effect of resolving Identifier during template instantiation. The goal is to be able to resolve a function call whose nested-name-specifier is located inside a dependent base class.

class C {
public:
    static void foo2() {  }
};

template <class T> class A {
public:
   typedef C D;
};

template <class T> class B : public A<T> {
public:
  void foo() { D::foo2(); }
};

Note that this won't work if the NestedNameSpecifier refers to a type.
This fixes 1 error when parsing the MSVC 2010 standard headers file with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136203 91177308-0d34-0410-b5e6-96231b3b80d8
dfb6ae1
@rjmccall rjmccall Clean up the analysis of the collection operand to ObjC
for-in statements;  specifically, make sure to close over any
temporaries or cleanups it might require.  In ARC, this has
implications for the lifetime of the collection, so emit it
with a retain and release it upon exit from the loop.

rdar://problem/9817306



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136204 91177308-0d34-0410-b5e6-96231b3b80d8
990567c
Douglas Gregor Easier debugging with Visual Studio Visualizers, from Nikola Smiljanic!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136207 91177308-0d34-0410-b5e6-96231b3b80d8
3ef1ad2
@akyrtzi akyrtzi [arcmt] More automatic transformations and safety improvements; rdar:…
…//9615812 :

- Replace calling -zone with 'nil'. -zone is obsolete in ARC.
- Allow removing retain/release on a static global var.
- Fix assertion hit when scanning for name references outside a NSAutoreleasePool scope.
- Automatically add bridged casts for results of objc method calls and when calling CFRetain, for example:

NSString *s;
CFStringRef ref = [s string];   -> CFStringRef ref = (__bridge CFStringRef)([s string]);
ref = s.string;                 -> ref = (__bridge CFStringRef)(s.string);
ref = [NSString new];           -> ref = (__bridge_retained CFStringRef)([NSString new]);
ref = [s newString];            -> ref = (__bridge_retained CFStringRef)([s newString]);
ref = [[NSString alloc] init];  -> ref = (__bridge_retained CFStringRef)([[NSString alloc] init]);
ref = [[s string] retain];      -> ref = (__bridge_retained CFStringRef)([s string]);
ref = CFRetain(s);              -> ref = (__bridge_retained CFTypeRef)(s);
ref = [s retain];               -> ref = (__bridge_retained CFStringRef)(s);

- Emit migrator error when trying to cast to CF type the result of autorelease/release:
  for

CFStringRef f3() {
  return (CFStringRef)[[[NSString alloc] init] autorelease];
}

emits:

t.m:12:10: error: [rewriter] it is not safe to cast to 'CFStringRef' the result of 'autorelease' message; a __bridge cast may result in a pointer to a destroyed object and a __bridge_retained may leak the object
  return (CFStringRef)[[[NSString alloc] init] autorelease];
         ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
t.m:12:3: note: [rewriter] remove the cast and change return type of function to 'NSString *' to have the object automatically autoreleased
  return (CFStringRef)[[[NSString alloc] init] autorelease];
  ^

- Before changing attributes to weak/unsafe_unretained, check if the backing ivar
  is set to a +1 object, in which case use 'strong' instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136208 91177308-0d34-0410-b5e6-96231b3b80d8
18fd0c6
@akyrtzi akyrtzi [arcmt] Revert r135382, there's a different approach in r135764. rdar…
…://9821111.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136209 91177308-0d34-0410-b5e6-96231b3b80d8
6fa8f86
Douglas Gregor Add support for C++0x unicode string and character literals, from Cra…
…ig Topper!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136210 91177308-0d34-0410-b5e6-96231b3b80d8
5cee119
Douglas Gregor Update C++0x status page to reflect support for unicode string and ch…
…aracter literals, from Craig Topper

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136216 91177308-0d34-0410-b5e6-96231b3b80d8
785200d
Eric Christopher Make this darwin only for now while investigating to clear up x86_64
Release+Asserts linux tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136223 91177308-0d34-0410-b5e6-96231b3b80d8
87dd7d9
Douglas Gregor Modules don't require validation of the predefines buffer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136224 91177308-0d34-0410-b5e6-96231b3b80d8
a7d445a
@krememek krememek Change ASTContext::getSideTableAllocatedMemory() to use llvm::capacit…
…y_in_bytes().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136235 91177308-0d34-0410-b5e6-96231b3b80d8
0c8cd1a
@krememek krememek Change SourceManager::getDataStructureSizes() to use llvm::capacity_i…
…n_bytes().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136236 91177308-0d34-0410-b5e6-96231b3b80d8
6e36c12
@krememek krememek Change HeaderSearch::getTotalMemory() to use llvm::capacity_in_bytes().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136237 91177308-0d34-0410-b5e6-96231b3b80d8
eabea45
@krememek krememek Change PreprocessingRecord::getTotalMemory() to use llvm::capacity_in…
…_bytes().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136238 91177308-0d34-0410-b5e6-96231b3b80d8
e3c20a8
@krememek krememek Change Preprocessor::getTotalMemory() to use llvm::capacity_in_bytes().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136239 91177308-0d34-0410-b5e6-96231b3b80d8
6748509
Eli Friedman Make CodeGen for array delete involving incomplete class work without…
… crashing. Should fix regression on g++.dg/init/delete1.C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136241 91177308-0d34-0410-b5e6-96231b3b80d8
91873b7
Eli Friedman Fix typo in test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136251 91177308-0d34-0410-b5e6-96231b3b80d8
8c83031
@pcc pcc CodeGen: rename CodeGenModule::Runtime to ObjCRuntime
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136254 91177308-0d34-0410-b5e6-96231b3b80d8
e926523
@pcc pcc Fix TR 18037 citation in SemaType.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136256 91177308-0d34-0410-b5e6-96231b3b80d8
29e3ef8
@pcc pcc Forbid address-space-qualified function types, per TR 18037
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136257 91177308-0d34-0410-b5e6-96231b3b80d8
020972d
@pcc pcc Silence gcc warning
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136258 91177308-0d34-0410-b5e6-96231b3b80d8
d648d37
Douglas Gregor Introduce a new data structure, LazyVector, which is a vector whose
contents are lazily loaded on demand from an external source (e.g., an
ExternalASTSource or ExternalSemaSource). The "loaded" entities are
kept separate from the "local" entities, so that the two can grow
independently.

Switch Sema::TentativeDefinitions from a normal vector that is eagerly
populated by the ASTReader into one of these LazyVectors, making the
ASTReader a bit more like me (i.e., lazy).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136262 91177308-0d34-0410-b5e6-96231b3b80d8
a862320
Anna Zaks Add a utility function to the Lexer, which makes it easier to find a …
…token after the given location. (It is a generalized version of trans::findLocationAfterSemi from ArcMigrate, which will be changed to use the Lexer utility).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136268 91177308-0d34-0410-b5e6-96231b3b80d8
aca25bc
Douglas Gregor Switch Sema::UnusedFileScopedDecls over to a LazyVector.
  - Added LazyVector::erase() to support this use case.
  - Factored out the LazyDecl-of-Decls to RecordData translation in
  the ASTWriter. There is still a pile of code duplication here to
  eliminate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136270 91177308-0d34-0410-b5e6-96231b3b80d8
a2ee20a
@rjmccall rjmccall The lock operand to an @synchronized statement is also
supposed to be a full-expression;  make it so.  In ARC, make sure
we retain the lock for the entire protected block. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136271 91177308-0d34-0410-b5e6-96231b3b80d8
0752403
Douglas Gregor Turn Sema::DelegatingCtorDecls into a LazyVector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136273 91177308-0d34-0410-b5e6-96231b3b80d8
0129b56
Chad Rosier The -fapple-kext flag was designed to "do the right thing" for buildi…
…ng code for

use in KEXTs. However, users/Xcode still need to tweak the linker flags to do 
the right thing, and end up using -Xlinker, for example.  Instead, have the 
driver "do the right thing" when linking when -fapple-kext is present on the 
command line, and we should have Xcode use -fapple-kext instead of setting other
flags like -Xlinker -kext or -nodefaultlibs.
rdar://7809940

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136294 91177308-0d34-0410-b5e6-96231b3b80d8
1fc1de4
Chad Rosier Test for r136294.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136296 91177308-0d34-0410-b5e6-96231b3b80d8
c154ec8
Eric Christopher No one cares about ppc, but make this work for arm and x86 and xfail …
…the rest.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136297 91177308-0d34-0410-b5e6-96231b3b80d8
2223441
Eric Christopher Remove the optimization option for this test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136298 91177308-0d34-0410-b5e6-96231b3b80d8
5dcca66
Eric Christopher XFAIL this test on ARM. Filed PR10518 to track.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136299 91177308-0d34-0410-b5e6-96231b3b80d8
de86a38
Commits on Jul 28, 2011
Eric Christopher Remove this test, it's actually testing something that clang doesn't …
…support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136300 91177308-0d34-0410-b5e6-96231b3b80d8
2a077fd
Eric Christopher This was meant to test arm anyhow, make the registers agree with the
instruction and the architecture for which the instruction exists.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136301 91177308-0d34-0410-b5e6-96231b3b80d8
b655803
Eric Christopher Apparently this does work on arm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136302 91177308-0d34-0410-b5e6-96231b3b80d8
16a91a4
Eric Christopher This works on arm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136303 91177308-0d34-0410-b5e6-96231b3b80d8
023b592
Eric Christopher Correct the triple here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136304 91177308-0d34-0410-b5e6-96231b3b80d8
0bbe4b1
Eric Christopher Add a triple to this test and make sure it passes on arm where it was
supposed to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136305 91177308-0d34-0410-b5e6-96231b3b80d8
d3e46dd
Richard Trieu Add template instantiations to the output of -ast-dump.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136306 91177308-0d34-0410-b5e6-96231b3b80d8
5cb3d69
Eric Christopher Fix this test to work for arm and on all platforms.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136307 91177308-0d34-0410-b5e6-96231b3b80d8
0b2b766
Eric Christopher Fix this up for clang codegen versus llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136308 91177308-0d34-0410-b5e6-96231b3b80d8
55528b2
Eric Christopher Remove the need for a header and specify a triple so that the type
sizes make sense.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136309 91177308-0d34-0410-b5e6-96231b3b80d8
95ee667
Eric Christopher Fix thinko in last checkin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136311 91177308-0d34-0410-b5e6-96231b3b80d8
886fefa
Douglas Gregor Switch Sema::ExtVectorDecls over to LazyVector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136314 91177308-0d34-0410-b5e6-96231b3b80d8
d58a0a5
@akyrtzi akyrtzi Cut down the number of open/close system calls for output files.
For PCH files, have only one open/close for temporary + rename to be safe from race conditions.
For all other output files open/close the output file directly.

Depends on llvm r136310. rdar://9082880 & http://llvm.org/PR9374.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136315 91177308-0d34-0410-b5e6-96231b3b80d8
7e90985
Douglas Gregor Switch Sema::DynamicClasses over to LazyVector
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136317 91177308-0d34-0410-b5e6-96231b3b80d8
a126f17
Douglas Gregor Don't set Sema's StdNamespace or StdBadAlloc if they've already been set
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136318 91177308-0d34-0410-b5e6-96231b3b80d8
1e5b6f6
@chapuni chapuni test/CodeGen/struct-init.c, struct-matching-constraint.c: Tweak comma…
…ndline, or they would not be recognized as armv7 on some hosts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136330 91177308-0d34-0410-b5e6-96231b3b80d8
e1adf81
Douglas Gregor Introduce the "-index-header-map" option, to give special semantics
for quoted header lookup when dealing with not-yet-installed
frameworks. Fixes <rdar://problem/9824020>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136331 91177308-0d34-0410-b5e6-96231b3b80d8
65e02fa
Douglas Gregor AST serialization support for the Framework in IndexHeaderMapHeader
fields of HeaderFileInfo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136332 91177308-0d34-0410-b5e6-96231b3b80d8
b4dc485
@chapuni chapuni test/CodeGen/struct-matching-constraint.c: Fixup not to emit garbage …
…to source tree.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136333 91177308-0d34-0410-b5e6-96231b3b80d8
a17f0c4
@rjmccall rjmccall Fix a couple of problems with initialization and assignment to
__block variables where the act of initialization/assignment
itself causes the __block variable to be copied to the heap
because the variable is of block type and is being assigned
a block literal which captures the variable.

rdar://problem/9814099



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136337 91177308-0d34-0410-b5e6-96231b3b80d8
fb72081
@rjmccall rjmccall Make a note about a missing optimization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136340 91177308-0d34-0410-b5e6-96231b3b80d8
d46f763
@chapuni chapuni test/CodeGen/2004-03-16-AsmRegisterCrash.c: XTARGET should accept the…
… part of triplet. ("x86" is not the part of triplet)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136346 91177308-0d34-0410-b5e6-96231b3b80d8
27f1e7e
@chapuni chapuni test/Misc/ast-dump-templates.cpp: Disable this temporarily due to uns…
…table output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136348 91177308-0d34-0410-b5e6-96231b3b80d8
a26da1a
Douglas Gregor Make Sema::LocallyScopedExternalDecls lazily deserialized. In theory,
we could turn this into an on-disk hash table so we don't load the
whole thing the first time we need it. However, it tends to be very,
very small (i.e., empty) for most precompiled headers, so it isn't all
that interesting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136352 91177308-0d34-0410-b5e6-96231b3b80d8
ec12ce2
Douglas Gregor Move a Module's ReferencedSelectorsData into the ASTReader itself, so
that it accumulates referenced selectors from each of the modules/PCH
files as they are loaded. No actual functionality change, yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136356 91177308-0d34-0410-b5e6-96231b3b80d8
8451ec7
Douglas Gregor Make Sema::ReferencedSelectors lazily deserialized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136357 91177308-0d34-0410-b5e6-96231b3b80d8
5b9dc7c
@jonathandturner jonathandturner Switch the ModuleManager over to using a FileManager and FileEntry* a…
…s part of its lookup instead of the filename. This is a more correct unique identifier, as symlinks can be handled by the FileManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136363 91177308-0d34-0410-b5e6-96231b3b80d8
1afb661
@supertriceratops supertriceratops Added parsing for guarded_var, pt_guarded_var, lockable,
scoped_lockable, and no_thread_safety_analysis attributes, all for thread safety analysis

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136364 91177308-0d34-0410-b5e6-96231b3b80d8
fdde9e7
@jonathandturner jonathandturner Add missing documentation onto new member variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136365 91177308-0d34-0410-b5e6-96231b3b80d8
8a22e27
Douglas Gregor Make Sema::WeakUndeclaredIdentifiers lazily deserialized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136368 91177308-0d34-0410-b5e6-96231b3b80d8
31e37b2
@supertriceratops supertriceratops Thread safety: Fix typo in documentation
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136370 91177308-0d34-0410-b5e6-96231b3b80d8
73cbbc8
Douglas Gregor Lazily deserialize Sema::VTableUses. Plus, fix the utterly and
completely broken deserialization mapping code we had for VTableUses,
which would have broken horribly as soon as our local-to-global ID
mapping became interesting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136371 91177308-0d34-0410-b5e6-96231b3b80d8
dfe6543
Douglas Gregor Promote the deserialized PendingInstantiations vector from being a
Module member to being an ASTReader member; we want it to be
centralized for lazy deserialization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136373 91177308-0d34-0410-b5e6-96231b3b80d8
f2abb52
Anna Zaks Refactor the */& mismatch fixit generation out of SemaOverload and pr…
…ovide a simple conversion checking function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136376 91177308-0d34-0410-b5e6-96231b3b80d8
f3546ee
Douglas Gregor Make the deserialization of Sema::PendingInstantiations lazy. At this
point, ASTReader::InitializeSema() has very little interesting work,
*except* issues stemming from preloaded declarations. That's something
we'll still need to cope with.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136378 91177308-0d34-0410-b5e6-96231b3b80d8
6e4a3f5
Anna Zaks Add */& mismatch fixit generation to the Sema::DiagnoseAssignmentResu…
…lt().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136379 91177308-0d34-0410-b5e6-96231b3b80d8
6722155
Anna Zaks Another test case for the &/* mismatch fixit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136380 91177308-0d34-0410-b5e6-96231b3b80d8
1d05d42
@supertriceratops supertriceratops Added basic parsing for all remaining attributes, thread safety
analysis. This includes checking that the attributes are applied in the
correct contexts and with the correct number of arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136383 91177308-0d34-0410-b5e6-96231b3b80d8
db33e14
Richard Trieu Fix a test case that was intermittently failing. The issue was that i…
…nstantiations are not stored in an order preserving structure, so the print order may be impacted. Modified test case to do two FileCheck passes to ensure that both instantiations are in the same place.

Test originially commited at r136306 and temporarily silenced at r136348.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136385 91177308-0d34-0410-b5e6-96231b3b80d8
7efa0e0
Anna Zaks Add a fixit for removal of unused label.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136389 91177308-0d34-0410-b5e6-96231b3b80d8
d5612a2
Douglas Gregor Teach the ASTReader to perform local and global mapping of identifier
IDs properly, although the mapping itself is still trivial.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136391 91177308-0d34-0410-b5e6-96231b3b80d8
95eab17
Douglas Gregor Use the local -> global mapping functions for selectors more
consistently in the ASTReader.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136395 91177308-0d34-0410-b5e6-96231b3b80d8
2d2689a
Douglas Gregor Use local-to-global mapping appropriately for macro definitions in th…
…e ASTReader

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136410 91177308-0d34-0410-b5e6-96231b3b80d8
e144c70
Douglas Gregor Introduce the local-global mapping for preprocessed entities, and use
it appropriately. Also, patch up a place where we were failing to map
local macro definition IDs into global macro definition IDs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136411 91177308-0d34-0410-b5e6-96231b3b80d8
86c67d8
@krememek krememek [analyzer] fix handling of MaterializeTemporaryExpr by binding the re…
…sult value to

the proper expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136412 91177308-0d34-0410-b5e6-96231b3b80d8
eea72a9
@krememek krememek [analyzer] Fix bug in ObjCMessage where casts were being incorrectly …
…ignored.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136413 91177308-0d34-0410-b5e6-96231b3b80d8
6c370d9
@krememek krememek [analyzer] Teach Environment to not look through MaterializeTemporary…
…Exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136414 91177308-0d34-0410-b5e6-96231b3b80d8
90e2f53
@krememek krememek [analyzer] Add safety checking in RegionStoreManager for string liter…
…al underruns.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136415 91177308-0d34-0410-b5e6-96231b3b80d8
31d922f
@krememek krememek [analyzer] Add StoreManager::includedInBindings() to to query whether…
… a region is used in any bindings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136416 91177308-0d34-0410-b5e6-96231b3b80d8
fa7a95c
@krememek krememek [analyzer] add accessor to StoreRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136417 91177308-0d34-0410-b5e6-96231b3b80d8
fde18c5
@krememek krememek [analyzer] fix bug in malloc checker where the tracked symbol would n…
…ot properly be removed from the state.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136418 91177308-0d34-0410-b5e6-96231b3b80d8
217470e
@krememek krememek [analyzer] Overhaul how the static analyzer expects CFGs by forcing C…
…FGs to be linearized only when used by the static analyzer. This required a rewrite of LiveVariables, and exposed a ton of subtle bugs.

The motivation of this large change is to drastically simplify the logic in ExprEngine going forward.

Some fallout is that the output of some BugReporterVisitors is not as accurate as before; those will
need to be fixed over time.  There is also some possible performance regression as RemoveDeadBindings
will be called frequently; this can also be improved over time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136419 91177308-0d34-0410-b5e6-96231b3b80d8
8829989
@krememek krememek Remove FlatStoreManager and BasicStoreManager. The latter has long be…
…en obsolete and the former has no had development in a long time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136420 91177308-0d34-0410-b5e6-96231b3b80d8
af9ef7f
@krememek krememek Remove flat store tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136421 91177308-0d34-0410-b5e6-96231b3b80d8
fc5b21d
@krememek krememek Really remove FlatStoreManager and BasicStoreManager, this time from …
…the driver. Also remove associated tests. Sorry for the messy commits; this is the result of a botched Git merge.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136422 91177308-0d34-0410-b5e6-96231b3b80d8
a4c7a43
@jonathandturner jonathandturner Some documentation fixes so that we are explicit about which iteratio…
…n order is source-order. Also, removing unused NextInSource field of Module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136423 91177308-0d34-0410-b5e6-96231b3b80d8
b4ae29c
Fariborz Jahanian objective-c: warn if implementation of a method in category
masks an existing method in its primary class, class extensions,
and primary class's non-optional protocol methods; as primary
class, or one of its subclass's will implement this method.
This warning has potential of being noisy so it has its own
group.  // rdar://7020493


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136426 91177308-0d34-0410-b5e6-96231b3b80d8
fefe91e
Commits on Jul 29, 2011
@chandlerc chandlerc Remove an unused function (found by Clang's -Wunused-function)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136434 91177308-0d34-0410-b5e6-96231b3b80d8
e3b075b
Douglas Gregor Move the base type ID from the ASTReader's global type map into the
Module itself, which makes more sense. This pattern to be repeated
several more times.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136436 91177308-0d34-0410-b5e6-96231b3b80d8
1e849b6
@pcc pcc Fix an inconsistency in Sema::ConvertArgumentsForCall in that
the callee note diagnostic was not emitted in the case where
there were too few arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136437 91177308-0d34-0410-b5e6-96231b3b80d8
9aab148
@pcc pcc Fix assertion failure in CodeGen where the input operand to an asm
instruction is tied to an output operand which is a pointer, and
the input operand is narrower than the output operand.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136438 91177308-0d34-0410-b5e6-96231b3b80d8
93f1322
Douglas Gregor In the ASTReader, replace the continuous range maps whose value types
were (Module*, Offset) with equivalent maps whose value type is just a
Module*. The offsets have moved into corresponding "Base" fields
within the Module itself, where they will also be helpful for
local->global translation (eventually).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136441 91177308-0d34-0410-b5e6-96231b3b80d8
9827a80
Douglas Gregor Remove unused debug function
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136442 91177308-0d34-0410-b5e6-96231b3b80d8
eda6158
Douglas Gregor This patch makes the string/character literal tests run in C,
C++98/03, and C++0x mode, from Craig Topper!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136443 91177308-0d34-0410-b5e6-96231b3b80d8
53afad5
@akyrtzi akyrtzi Make DiagnosticErrorTrap keep a count of the errors that occurred so …
…multiple

DiagnosticErrorTraps can be composed (e.g. a trap inside another trap).

Fixes http://llvm.org/PR10462 & rdar://9852007.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136447 91177308-0d34-0410-b5e6-96231b3b80d8
c0a575f
@jayfoad jayfoad Remove some unnecessary single element array temporaries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136461 91177308-0d34-0410-b5e6-96231b3b80d8
da549e8
Douglas Gregor Add a missing \endcode for Doxygen
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136469 91177308-0d34-0410-b5e6-96231b3b80d8
d16aa41
@jonathandturner jonathandturner Renamed Loaded member to ImportedBy, as it's easier to read. Added an…
…other set to represent the modules a module imports.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136476 91177308-0d34-0410-b5e6-96231b3b80d8
2e09163
Douglas Gregor On Darwin, libc++ may be installed alongside the compiler in
lib/c++/v1. Look there first, before falling back to the normal
/usr/include/c++/v1. <rdar://problem/9866149>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136507 91177308-0d34-0410-b5e6-96231b3b80d8
baf41f1
@krememek krememek [analyzer] Remove recursive visitation in ExprEngine::VisitLvalArrayS…
…ubscriptExpr() because it is no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136512 91177308-0d34-0410-b5e6-96231b3b80d8
8f3407e
@krememek krememek [analyzer] Remove recursive visitation in ExprEngine::VisitMemberExpr…
… because it isn't needed anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136513 91177308-0d34-0410-b5e6-96231b3b80d8
e3939d7
@krememek krememek [analyzer] Remove recursive visitation in ExprEngine::VisitCallExpr b…
…ecause it isn't needed anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136514 91177308-0d34-0410-b5e6-96231b3b80d8
962fddc
@krememek krememek [analyzer] Remove recursive visitation in ExprEngine::VisitObjCProper…
…tyRefExpr because it isn't needed anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136515 91177308-0d34-0410-b5e6-96231b3b80d8
ae2dc14
@krememek krememek [analyzer] tighten up ExprEngine::VisitObjCAtSynchronizationStmt().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136516 91177308-0d34-0410-b5e6-96231b3b80d8
994b8d3
@krememek krememek [analyzer] Remove recursive visitation in ExprEngine::VisitLValObjCIv…
…arRefExpr because it isn't needed anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136517 91177308-0d34-0410-b5e6-96231b3b80d8
871f686
@krememek krememek [analyzer] Remove explicit argument processing from ExprEngine::Visit…
…ObjCMessage() since it is no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136518 91177308-0d34-0410-b5e6-96231b3b80d8
4410a93
@krememek krememek [analyzer] Remove recursive visitation in ExprEngine::VisitObjCForCol…
…lectionStmt because it isn't needed anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136519 91177308-0d34-0410-b5e6-96231b3b80d8
70a34da
@krememek krememek [analyzer] Remove recursive visitation in ExprEngine::VisitCastExpr b…
…ecause it isn't needed anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136520 91177308-0d34-0410-b5e6-96231b3b80d8
4e906e8
@krememek krememek [analyzer] Remove recursive visitation in ExprEngine::VisitCompoundLi…
…teralExpr because it isn't needed anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136521 91177308-0d34-0410-b5e6-96231b3b80d8
71f20db
@krememek krememek [analyzer] Remove recursive visitation in ExprEngine::VisitDeclStmt b…
…ecause it isn't needed anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136522 91177308-0d34-0410-b5e6-96231b3b80d8
6075f01
Eric Christopher Add support for the 'Q' arm memory constraint.
Fixes rdar://9866494


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136524 91177308-0d34-0410-b5e6-96231b3b80d8
895d422
Douglas Gregor Teach the ASTImporter to cope with cases where we have already
imported a forward declaration, but later the full definition of the
same entity becomes available. When this happens, import the definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136537 91177308-0d34-0410-b5e6-96231b3b80d8
1cf038c
Commits on Jul 30, 2011
Fariborz Jahanian objc rewriter - set the flag passed to _Block_object_assign/_Block_ob…
…ject_dispose correctly

for copying a captured block object. // rdar://9846759


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136549 91177308-0d34-0410-b5e6-96231b3b80d8
06433c6
Fariborz Jahanian objc rewriter - my last patch was not quite right.
Fixed again. // rdar://9846759


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136550 91177308-0d34-0410-b5e6-96231b3b80d8
a3f61ae
Douglas Gregor Use the "Bar.h" -> <Foo/Bar.h> remapping for index header maps only as
a fallback, if normal header search fails. Another attempt at
<rdar://problem/9824020>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136557 91177308-0d34-0410-b5e6-96231b3b80d8
2c7b780
Douglas Gregor When complaining about a non-POD second argument to va_arg, use a
special diagnostic for ARC ownership-qualified types. We wouldn't want
to expose Objective-C programmers to the term "POD", would we? Fixes
<rdar://problem/9772982>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136558 91177308-0d34-0410-b5e6-96231b3b80d8
4eb7522
Douglas Gregor When performing code completion after at @interface, allow both
already-defined and forward-declared results. Already-defined results
are fine because they could be the start of a category. Fixes
<rdar://problem/9811691>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136559 91177308-0d34-0410-b5e6-96231b3b80d8
0f91c8c
Douglas Gregor Turn off __has_feature(is_empty) and __has_feature(is_pod) if the
libstdc++ hack has reverted these type traits to keywords. Icky, but
fixes <rdar://problem/9836262>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136560 91177308-0d34-0410-b5e6-96231b3b80d8
6887614
Douglas Gregor Fix a thinko in my __is_empty/__is_pod commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136561 91177308-0d34-0410-b5e6-96231b3b80d8
9a14ecb
Douglas Gregor Add the various parameter-passing keywords for Distributed Objects
(such as in, inout, byref, and oneway) to code completion
results. Fixes <rdar://problem/8844158>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136562 91177308-0d34-0410-b5e6-96231b3b80d8
6fa14dd
Douglas Gregor When producing code completion results for variadic macros, fold the
variadic bit (", ..." or ", args...") into the prior placeholder, like
we do with functions and methods. Fixes <rdar://problem/9740808>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136563 91177308-0d34-0410-b5e6-96231b3b80d8
e424470
Douglas Gregor Add code completion to produce "else" blocks after an "if"
statement. Fixes <rdar://problem/9229438>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136564 91177308-0d34-0410-b5e6-96231b3b80d8
d2d8be6
Douglas Gregor Introduce a Fix-It for the "missing sentinel" warning, adding an
appropriate sentinel at the end of the argument list. Also, put the
sentinel warnings under -Wsentinel. Fixes <rdar://problem/8764236>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136566 91177308-0d34-0410-b5e6-96231b3b80d8
f78c4e5
@akyrtzi akyrtzi [libclang] Annotation of parameters that got default args from a prev…
…ious declarations was

broken because the end location of the parameter was the end location of the default arg,
resulting in a source range that could begin in one file and end in another.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136572 91177308-0d34-0410-b5e6-96231b3b80d8
0bfe83b
@akyrtzi akyrtzi Not sure why we bother updating FunctionDecl's EndRangeLoc in Functio…
…nDecl::setParams.

EndRangeLoc should always be set to at least the ending paren or brace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136573 91177308-0d34-0410-b5e6-96231b3b80d8
1b39dc8
Commits on Jul 31, 2011
@d0k d0k Remove dead code flagged by GCC's -Wunused-but-set-variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136581 91177308-0d34-0410-b5e6-96231b3b80d8
b9a8adf
Fariborz Jahanian Test for // rdar://9846759
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136602 91177308-0d34-0410-b5e6-96231b3b80d8
9d9e3dd
Commits on Aug 01, 2011
Douglas Gregor Rename the AST file's SOURCE_LOCATION_MAP to MODULE_OFFSET_MAP, to in…
…dicate the greater role it will soon play in remapping.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136619 91177308-0d34-0410-b5e6-96231b3b80d8
5d51a1d
Douglas Gregor Move the serialization of the MODULE_OFFSET_MAP out of the source-man…
…ager-writing code and into the general chained-PCH writing code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136624 91177308-0d34-0410-b5e6-96231b3b80d8
69a9e01
David Chisnall Fix linkage type for tentative definition of ivar offset variables (G…
…NUstep runtime)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136628 91177308-0d34-0410-b5e6-96231b3b80d8
3fc81d3
Akira Hatanaka Pass records with non-trivial destructors or constructors indirectly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136630 91177308-0d34-0410-b5e6-96231b3b80d8
511949b
Chad Rosier Driver: When compiling i386 -fapple-kext code, we fallback to llvmgcc.
Unfortunately, llvmgcc doesn't always work when writing temporary output to
/dev/null.  Therefore, create a temp file that is later deleted.
rdar://9837692

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136644 91177308-0d34-0410-b5e6-96231b3b80d8
8c221b8
Akira Hatanaka Implement MipsABIInfo::EmitVAArg. This fix enables clang to complete …
…compilation

without bailing out when va_arg is an aggregate expression. However, 
alignment checking needs to be added in isSafeToEliminateVarargsCast in
InstCombineCalls.cpp in order to produce correct mips code (see link below).

http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-July/042047.html





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136647 91177308-0d34-0410-b5e6-96231b3b80d8
c35e69d
Fariborz Jahanian objective-c: reverse patch for // rdar://9818354
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136658 91177308-0d34-0410-b5e6-96231b3b80d8
7898005
Anna Zaks Add a skeleton for the Keychain Services API Checker. Register it as …
…OSX experimental for now. Note, the checker still does not handle tracking of escaped values, taking into account the return value of the allocator functions, nor the actual bug reporting..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136659 91177308-0d34-0410-b5e6-96231b3b80d8
f57be28
Bob Wilson Revert "Re-enable byval for ARM in clang. rdar://problem/7662569"
This reverts commit 67d097e.
We found a miscompile with ARM byval, which is still being investigated.
In the meantime, this works around the problem by disabling ARM byval.

Conflicts:
	lib/CodeGen/TargetInfo.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136662 91177308-0d34-0410-b5e6-96231b3b80d8
53fc1a6
Commits on Aug 02, 2011
Richard Trieu Fix formatting of SemaExpr.cpp, mainly fixing lines greater than 80 c…
…haracters.

No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136678 91177308-0d34-0410-b5e6-96231b3b80d8
67e2933
@d0k d0k Make helper functions static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136679 91177308-0d34-0410-b5e6-96231b3b80d8
39997fc
Douglas Gregor Generalize the module offset map to include mapping information for
all of the kinds of IDs that can be offset. No effectively
functionality change; this is preparation for adding remapping for
IDs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136686 91177308-0d34-0410-b5e6-96231b3b80d8
f33740e
Douglas Gregor Add a debugging dump for Module (also emitted as part of the AST
reader statistics), to show the local-to-global mappings. The only
such mapping we have (at least, for now) is for source location
offsets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136687 91177308-0d34-0410-b5e6-96231b3b80d8
8df5c9b
Douglas Gregor Implement a proper local -> global type ID remapping scheme in the AST
reader. This scheme permits an AST file to be loaded with its type IDs
shifted anywhere in the type ID space. 

At present, the type indices are still allocated in the same boring
way they always have been, just by adding up the number of types in
each PCH file within the chain. However, I've done testing with this
patch by randomly sliding the base indices at load time, to ensure
that remapping is occurring as expected. I may eventually formalize
this in some testing flag, but loading multiple (non-chained) AST
files at once will eventually exercise the same code.

There is one known problem with this patch, which involves name lookup
of operator names (e.g., "x.operator int*()") in cases where multiple
PCH files in the chain. The hash function itself depends on having a
stable type ID, which doesn't happen with chained PCH and *certainly*
doesn't happen when sliding type IDs around. We'll need another
approach. I'll tackle that next.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136693 91177308-0d34-0410-b5e6-96231b3b80d8
a119da0
Anna Zaks KeychainAPI checker: only check the paths on which the allocator func…
…tion returned noErr. (+ minor cleanup)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136694 91177308-0d34-0410-b5e6-96231b3b80d8
e68b5f1
@jonathandturner jonathandturner Following up the earlier refactoring/cleanup work by fixing up how we…
… manage the virtual files the ASTReader has to handle. Specifically, this occurs when the reader is reading AST files that were created in memory and not written to disk. For example, when a user creates a chained PCH using command line flags. These virtual files are stored in MemoryBuffers in ChainIncludeSource.cpp, and then read back in by the ASTReader. This patch moves the management of these buffers into the ModuleManager, so that it becomes the authority on where these buffers are located.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136697 91177308-0d34-0410-b5e6-96231b3b80d8
c24a1ee
Chad Rosier When the compiler crashes, the compiler driver now produces diagnostic
information including the fully preprocessed source file(s) and command line 
arguments.  The developer is asked to attach this diagnostic information to a 
bug report.
rdar://9575623


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136702 91177308-0d34-0410-b5e6-96231b3b80d8
2b81910
Eli Friedman PR10566: Make sure codegen for deleting an pointer to an incomplete t…
…ype actually works.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136703 91177308-0d34-0410-b5e6-96231b3b80d8
aebab72
@krememek krememek [analyzer] Drastically simplify ExprEngine::VisitInitListExpr() by as…
…suming all initializer expressions have already been evaluated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136706 91177308-0d34-0410-b5e6-96231b3b80d8
ff8e758
Douglas Gregor Change the hashing function for DeclContext lookup within an AST file
by eliminating the type ID from constructor, destructor, and
conversion function names. There are several reasons for this change:
  - A given type (say, int*) isn't guaranteed to have a single, unique
  type ID within a chain of PCH files. Hence, we could end up hashing
  based on the wrong type ID, causing name lookup to fail.

  - The mapping from types back to type IDs required one DenseMap
  entry for every type that was ever deserialized, which was an
  unacceptable cost to support just the name lookup of constructors,
  destructors, and conversion functions. Plus, this mapping could
  never actually work with chained or multiple PCH, based on the first
  bullet.

Once we have eliminated the type from the hash function, these
problems go away, as does my horrible "reverse type remap" hack, which
was doomed from the start (see bullet #1 above) and far too
complicated. 

However, note that removing the type from the hash function means that
all constructors, destructors, and conversion functions have the same
hash key, so I've updated the caller to double-check that the
declarations found have the appropriate name.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136708 91177308-0d34-0410-b5e6-96231b3b80d8
e360501
Chad Rosier Temporarily revert parts of r136702 to make cmake builds happy.
Someone with more cmake experience want to throw me a bone? :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136709 91177308-0d34-0410-b5e6-96231b3b80d8
4068eaa
Fariborz Jahanian objective-c rewrite: Fixes rewriting of objective-c collection
statement inside a block. // rdar://9878420


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136717 91177308-0d34-0410-b5e6-96231b3b80d8
f23a0ff
Chad Rosier Fix cmake for r136702 (at least for the most part). Chandler has been…
… kind

enough to offer to investigate the underlying issue.  Thanks to Doug for his
assistance as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136719 91177308-0d34-0410-b5e6-96231b3b80d8
fc61427
Chris Lattner disable array bounds overflow warning for cases where an array
has a single element.  This disables the warning in cases where
there is a clear bug, but this is really rare (who uses arrays
with one element?) and it also silences a large class of false
positive issues with C89 code that is using tail padding in structs.

A better version of this patch would detect when an array is in
a tail position in a struct, but at least patch fixes the huge
false positives that are hitting postgres and other code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136724 91177308-0d34-0410-b5e6-96231b3b80d8
9e6a1ca
@espindola espindola Update for LLVM change in PassManagerBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136728 91177308-0d34-0410-b5e6-96231b3b80d8
cf565c5
@espindola espindola Implements alignment for long long and double types in va_arg on ARM …
…AAPCS.

Patch by Jim (Ningjie) Chen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136734 91177308-0d34-0410-b5e6-96231b3b80d8
e164c18
Commits on Aug 03, 2011
Eli Friedman A couple fixes for preprocessor expressions:
1. Be more tolerant of comments in -CC (comment-preserving) mode.  We were missing a few cases.

2. Make sure to expand the second FOO in "#if defined FOO FOO".  (See also
r97253, which addressed the case of "#if defined(FOO FOO".)

Fixes PR10286.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136748 91177308-0d34-0410-b5e6-96231b3b80d8
88710f2
@rjmccall rjmccall When rewriting a call to a K&R function to lead to a well-prototyped
function, be sure to drop parameter attributes when dropping their
associated arguments.  Patch by Aaron Landwehr!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136753 91177308-0d34-0410-b5e6-96231b3b80d8
40f9c30
Anna Zaks Static Analyzer diagnostics visualization: when the last location on …
…a path is end of the function, the arrow should point to the closing brace, not the statement before it. Patch by Ted Kremenek.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136761 91177308-0d34-0410-b5e6-96231b3b80d8
eb3058a
Bob Wilson Handle "homogeneous aggregates" as required by the ARM AAPCS-VFP ABI.
A homogeneous aggregate is an aggregate data structure where after flattening
any nesting there are 1 to 4 elements of the same base type that is either a
float, double, or Neon vector.  All Neon vectors of the same size, either 64
or 128 bits, are treated as equivalent for this purpose.  When using the
AAPCS-VFP ABI, check for homogeneous aggregates and pass them as arguments by
expanding them into a sequence of their base types.  This requires extending
the existing support for expanded arguments to handle not only structs, but
also constant arrays and complex types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136767 91177308-0d34-0410-b5e6-96231b3b80d8
194f06a
@rjmccall rjmccall In ARC, don't try to reclaim the result of a call to performSelector
unless done in a context where the value is used retained.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136769 91177308-0d34-0410-b5e6-96231b3b80d8
fc4b191
Douglas Gregor Introduce the local -> global declaration ID mapping into the AST
reader, to allow AST files to be loaded with their declarations
remapped to different ID numbers. Fix a number of places where we were
either failing to map local declaration IDs into global declaration
IDs or where interpreting the local declaration IDs within the wrong
module. 

I've tested this via the usual "random gaps" method. It works well
except for the preamble tests, because our handling of the precompiled
preamble requires declaration and preprocessed entity to be stable
when parsing code and then loading that back into memory. This
property will hold in general, but my randomized testing naturally
breaks this property to get more coverage. In the future, I expect
that the precompiled preamble logic won't need this property.

I am very unhappy with the current handling of the translation unit,
which is a rather egregious hack. We're going to have to do something
very different here for loading multiple AST files, because we don't
want to have to cope with merging two translation units. Likely, we'll
just handle translation units entirely via "update" records, and
predefine a single, fixed declaration ID for the translation
unit. That will come later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136779 91177308-0d34-0410-b5e6-96231b3b80d8
496c709
Chris Lattner give an example of a 'lowered vtable reference'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136780 91177308-0d34-0410-b5e6-96231b3b80d8
b3de112
Douglas Gregor Introduce a constant for the number of predefined declarations in an
AST file, along with an enumeration naming those predefined
declarations. No functionality change, but this will make it easier to
introduce new predefined declarations, when/if we need them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136781 91177308-0d34-0410-b5e6-96231b3b80d8
0a14e4b
Douglas Gregor Remove stray comma
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136783 91177308-0d34-0410-b5e6-96231b3b80d8
4192f03
Douglas Gregor Make the type of the IntegerLiteral for bitfield paddings an actual
integer, and initialise its TypeSourceInfo. The initialisation fixes a
crash when using pre-compiled preambles with C++ code-completion. From
Erik Verbruggen! Fixes PR10511.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136786 91177308-0d34-0410-b5e6-96231b3b80d8
0bbea1b
Douglas Gregor Comment the weird behavior of __has_feature(is_empty) and __has_featu…
…re(is_pod)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136788 91177308-0d34-0410-b5e6-96231b3b80d8
b3f8c24
@jonathandturner jonathandturner Fix a few typos
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136792 91177308-0d34-0410-b5e6-96231b3b80d8
43fd938
Fariborz Jahanian objective-c: Methods declared in methods must type match
those declated in its protocols. First half or // rdar://6191214


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136794 91177308-0d34-0410-b5e6-96231b3b80d8
7413307
@krememek krememek [analyzer] Introduce MallocOverflowSecurityChecker, a simple flow-sen…
…sitive checker that may be useful for security auditing. This checker is currently too noisy to be on by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136804 91177308-0d34-0410-b5e6-96231b3b80d8
17f7bdd
Kaelyn Uhrain Improve overloaded function handling in the typo correction code.
Change TypoCorrection to store a set of NamedDecls instead of a single
NamedDecl. Also add initial support for performing function overload
resolution to Sema::DiagnoseEmptyLookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136807 91177308-0d34-0410-b5e6-96231b3b80d8
f0c1d8f
Douglas Gregor Introduce a local-to-global remapping for identifiers in the AST
reader, and fix up the one (!) place where we were improperly mapping
a local ID to a global ID. Tested via the usual "gaps" trick.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136817 91177308-0d34-0410-b5e6-96231b3b80d8
6ec60e0
@rjmccall rjmccall Use the general conditional-cleanup framework instead of rolling our
own, incorrectly, for releasing objects at the end of a full-expression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136823 91177308-0d34-0410-b5e6-96231b3b80d8
bddfd87
@krememek krememek [analyzer] rename all experimental checker packages to have 'experime…
…ntal' be the common root package.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136835 91177308-0d34-0410-b5e6-96231b3b80d8
033a07e
Douglas Gregor Introduce local -> global selector ID mapping into the AST
reader. Tested with the usual "gaps" method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136839 91177308-0d34-0410-b5e6-96231b3b80d8
b18b1fd
Fariborz Jahanian Refactoring of my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136841 91177308-0d34-0410-b5e6-96231b3b80d8
a56a992
@chandlerc chandlerc Delete one of the old tests that was ported over to Clang. The test is
designed to be executed, and its output inspected for correct values,
but we aren't executing it. We're just compiling it, and dumping it to
/dev/null. It also isn't freestanding. If there is a desire to have this
test actually stick around, complain and I'll revert this and try to add
the file checks necessary to make this actually test things.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136846 91177308-0d34-0410-b5e6-96231b3b80d8
8d28897
Commits on Aug 04, 2011
Douglas Gregor Don't introduce a local -> global mapping for CXXBaseSpecifiers. The
IDs will never cross module boundaries, since they're tied to the
CXXDefinitionData, so just use a local mapping throughout. Eliminate
the global -> local tables and supporting data.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136847 91177308-0d34-0410-b5e6-96231b3b80d8
e92b8a1
Chad Rosier For APCS the alignment of bitfield types is *not* respected when layi…
…ng out

structures.  Alignment can be enforced with the use of anonymous bitfields 
(e.g., int :0), but this is not currently supported.  Add this test case to 
document the current state, which will hopefully be fixed shortly. 

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136848 91177308-0d34-0410-b5e6-96231b3b80d8
4ab0024
@krememek krememek [analyzer] Remove 'all-experimental' checker group.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136849 91177308-0d34-0410-b5e6-96231b3b80d8
0e24471
@krememek krememek XFAIL arc.m codegen test on win32 because it is currently hanging. Ne…
…ed to investigate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136850 91177308-0d34-0410-b5e6-96231b3b80d8
c4688ce
Anna Zaks KeychainAPI checker: Add basic diagnostics. Track MemoryRegion istead…
… of SymbolicRef since the address might not be a symbolic value in some cases, for example in fooOnlyFree() test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136851 91177308-0d34-0410-b5e6-96231b3b80d8
03826aa
Anna Zaks KeychainAPI checker: refactor to use early exit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136852 91177308-0d34-0410-b5e6-96231b3b80d8
08551b5
@rjmccall rjmccall Emit wide string literals with the appropriate alignment.
Patch by Craig Topper and Sundeep!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136856 91177308-0d34-0410-b5e6-96231b3b80d8
a5e19c6
Chad Rosier Add partial support for using anonymous bitfields (e.g., int : 0) to …
…enforce

alignment.  This fixes cases where the anonymous bitfield is followed by a 
non-bitfield member.  E.g.,

struct t4
{
  int foo : 1;
  long : 0;
  char bar;
};

Part of rdar://9859156

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136858 91177308-0d34-0410-b5e6-96231b3b80d8
61a6221
Chad Rosier Add documentation for useBitFieldTypeAlignment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136859 91177308-0d34-0410-b5e6-96231b3b80d8
7052909
@rjmccall rjmccall Take -Wvector-conversions out of -Wmost; it needs a lot of
QoI work.  rdar://problem/9887979.  If some open-source
wants to get an idea for what QoI work I have in mind,
ping me.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136860 91177308-0d34-0410-b5e6-96231b3b80d8
61a4e6a
@krememek krememek This test still hangs on win32, despite XFAIL it. Remove XFAIL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136864 91177308-0d34-0410-b5e6-96231b3b80d8
edc2220
Douglas Gregor Parsing of C++0x lambda expressions, from John Freeman with help from
David Blaikie!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136876 91177308-0d34-0410-b5e6-96231b3b80d8
ae7902c
Douglas Gregor The AST reader was forgetting to parse ObjCInferRelatedReturnType
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136879 91177308-0d34-0410-b5e6-96231b3b80d8
d631d0e
Douglas Gregor Implement the local -> global remapping for macro definition IDs in
the detailed preprocessing record. Tested with the standard "gaps" method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136882 91177308-0d34-0410-b5e6-96231b3b80d8
fb2d9e0
Douglas Gregor Add some missing record names to the AST output. No functionality cha…
…nge, but llvm-bcanalyzer will be a little more informative now for AST files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136883 91177308-0d34-0410-b5e6-96231b3b80d8
837593f
Douglas Gregor In the AST reader and writer, slide the preprocessed entity IDs by +1
so that we use ID zero as a sentinel for "no result". This matches the
convention set by all of the other global IDs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136885 91177308-0d34-0410-b5e6-96231b3b80d8
7338a92
Anna Zaks KeychainAPI checker: Refactor to make it easier to add more allocator…
…/deallocator API pairs. Add the allocator function ID to the checker state. Better comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136889 91177308-0d34-0410-b5e6-96231b3b80d8
083fcb2
Kaelyn Uhrain Match type names and give more info for out-of-line function definiti…
…on errors.

Having a function declaration and definition with different types for a
parameter where the types have same (textual) name can occur when an unqualified
type name resolves to types in different namespaces in each location.

The error messages have been extended by adding notes that point to the first
parameter of the function definition that doesn't match the declaration, instead
of a generic "member declaration nearly matches". The generic message is still
used in cases where the mismatch is not in the paramenter list, such as
mismatched cv qualifiers on the member function itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136891 91177308-0d34-0410-b5e6-96231b3b80d8
4d9d157
Chad Rosier Additional comments and whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136892 91177308-0d34-0410-b5e6-96231b3b80d8
6e43f3f
Douglas Gregor Remove the unset, unused return value of
ASTReader::ReadMacroRecord(). No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136893 91177308-0d34-0410-b5e6-96231b3b80d8
3b2257c
Douglas Gregor Introduce local -> global mapping for preprocessed entity IDs. This is
the last of the ID/offset/index mappings that I know
of. Unfortunately, the "gap" method of testing doesn't work here due
to the way the preprocessing record performs iteration. We'll do more
testing once multi-AST loading is possible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136902 91177308-0d34-0410-b5e6-96231b3b80d8
272b6bc
Douglas Gregor Clean up the debug dump for a Module, so the local->global maps are
clearly called out, and add the missing local -> global selector map
output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136903 91177308-0d34-0410-b5e6-96231b3b80d8
ca109e5
Chad Rosier Fix style and remove obviously redundant code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136907 91177308-0d34-0410-b5e6-96231b3b80d8
0e7bf40
Douglas Gregor Add a new libclang API to return a CXCompletionString for an arbitrary
cursor, from Connor Wakamo! Addresses <rdar://problem/9087798>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136911 91177308-0d34-0410-b5e6-96231b3b80d8
8fa0a80
Chad Rosier Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136924 91177308-0d34-0410-b5e6-96231b3b80d8
fc54016
Fariborz Jahanian objective-c: diagnose protocol inconsistencies in following
situation. When a class explicitly or implicitly (through inheritance) 
"conformsTo" two protocols which conflict (have methods which conflict).
This is 2nd part of // rdar://6191214.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136927 91177308-0d34-0410-b5e6-96231b3b80d8
6a3bec3
Chad Rosier Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136929 91177308-0d34-0410-b5e6-96231b3b80d8
682b7f8
Anna Zaks KeychainAPI checker: Track additional pair of SecKeychain APIs. Also,…
… keep exploring the transition on which a call to allocator function failed (to be able to find errors in examples like ErrorCodesFromDifferentAPISDoNotInterfere).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136930 91177308-0d34-0410-b5e6-96231b3b80d8
76cbb75
Matt Beaumont-Gay Put a few warnings into a DiagGroup. Feel free to improve the flag name!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136937 91177308-0d34-0410-b5e6-96231b3b80d8
270f943
Anna Zaks KeychainAPI checker: forgot to commit the test with r136930. This sho…
…uld fix the bot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136938 91177308-0d34-0410-b5e6-96231b3b80d8
62a811d
@krememek krememek Fix assertion failure in -Wuninitialized involving no-op casts. Fixes…
… PR 10577.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136939 91177308-0d34-0410-b5e6-96231b3b80d8
57fb591
Matt Beaumont-Gay Specialize diag::warn_unused_call for the "warn_unused_result" attrib…
…ute, so

it can be controlled with a distinct flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136941 91177308-0d34-0410-b5e6-96231b3b80d8
42d7b2d
Kaelyn Uhrain Fix a small bug where DiagnoseEmptyLookup would no longer print any m…
…essages

when performing typo correction involving any overloaded template functions.

The added test cases, while currently demontrating sub-optimal behavior, will
not trigger any messages without the 1-line change to SemaExpr.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136943 91177308-0d34-0410-b5e6-96231b3b80d8
844d572
Chad Rosier More whitespace and naming fixup. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136944 91177308-0d34-0410-b5e6-96231b3b80d8
dd7fddb
Fariborz Jahanian objc rewriter: Fixes a rewriting of implicit casting of an integral
argument to bool. // rdar://9899834



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136946 91177308-0d34-0410-b5e6-96231b3b80d8
1a38b46
Commits on Aug 05, 2011
Kaelyn Uhrain Have the typo correction in DiagnoseEmptyLookup properly handle template
functions when performing function overload resolution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136948 91177308-0d34-0410-b5e6-96231b3b80d8
ace5e76
@rjmccall rjmccall The continue label in an ARC for-in loop should not involve
releasing the collection.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136949 91177308-0d34-0410-b5e6-96231b3b80d8
4b302d3
Matt Beaumont-Gay Extend memset/memcpy/memmove checking to include memcmp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136950 91177308-0d34-0410-b5e6-96231b3b80d8
cc2f30c
Anna Zaks KeychainAPI checker: Generate an error on double allocation. Pull out…
… getAsPointeeMemoryRegion so that it could be reused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136952 91177308-0d34-0410-b5e6-96231b3b80d8
ca0b57e
Matt Beaumont-Gay Output to /dev/null, not "0"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136955 91177308-0d34-0410-b5e6-96231b3b80d8
3f1661d
@chandlerc chandlerc Change the this -W flag to 'return-stack-address'.
  ~or~

Paint the bikeshed green.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136959 91177308-0d34-0410-b5e6-96231b3b80d8
894e4d5
@abramobagnara abramobagnara Fixed FieldDecl source range.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136963 91177308-0d34-0410-b5e6-96231b3b80d8
d330e23
@chandlerc chandlerc Finally getting around to re-working this to more accurately white-list
1-element character arrays which are serving as flexible arrays. This is
the initial step, which is to restrict the 1-element array whitelist to
arrays that are member declarations. I'll refine it from here based on
the proposed patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136964 91177308-0d34-0410-b5e6-96231b3b80d8
ba44712
@chandlerc chandlerc Flesh out the -Warray-bounds detection of C89 tail-padded one-element
arrays. This now suppresses the warning only in the case of
a one-element array as the last field in a struct where the array size
is a literal '1' rather than any macro expansion or template parameter.

This doesn't distinguish between the language standard in use to allow
code which dates from C89 era to compile without the warning even in C99
and C++ builds. We could add a separate warning (under a different flag)
with fixit hints to switch to a flexible array, but its not clear that
this would be desirable. Much of the code using this idiom is striving
for maximum portability.

Tests were also fleshed out a bit, and the diagnostic itself tweaked to
be more pretty w.r.t. single elment arrays. This is more ugly than
I would like due to APInt's not being supported by the diagnostic
rendering engine.

A pseudo-patch for this was proposed by Nicola Gigante, but I reworked
it both for several correctness issues and for code style.

Sorry this was so long in coming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136965 91177308-0d34-0410-b5e6-96231b3b80d8
c268434
@rdivacky rdivacky Let attribute((cdecl)) and company override -mrtd default calling con…
…vention.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136971 91177308-0d34-0410-b5e6-96231b3b80d8
8e68f1c
@krememek krememek Make test/SemaObjC/qualified-protocol-method-conflicts.m always fail …
…and mark it XFAIL. This is a stop gap until the output of the test is deterministic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136984 91177308-0d34-0410-b5e6-96231b3b80d8
c25175c
@jonathandturner jonathandturner Wire up -import-module to run ReadAST for each module loaded.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136987 91177308-0d34-0410-b5e6-96231b3b80d8
e735e2d
Chad Rosier Add support for using anonymous bitfields (e.g., int : 0) to enforce …
…alignment.

This fixes cases where the anonymous bitfield is followed by a bitfield member.
E.g.,
struct t4
{
 char foo;
 long : 0;
 char bar : 1;
};

rdar://9859156



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136991 91177308-0d34-0410-b5e6-96231b3b80d8
b8fca90
@jonathandturner jonathandturner Add workaround for built va list (and other builtins) so that running…
… ReadAST multiple times does not immediately throw an error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136995 91177308-0d34-0410-b5e6-96231b3b80d8
de91db5
Kaelyn Uhrain Perform array bounds checking in more situations and properly handle …
…special

case situations with the unary operators & and *. Also extend the array bounds
checking to work with pointer arithmetic; the pointer arithemtic checking can
be turned on using -Warray-bounds-pointer-arithmetic.

The changes to where CheckArrayAccess gets called is based on some trial &
error and a bunch of digging through source code and gdb backtraces in order
to have the check performed under as many situations as possible (such as for
variable initializers, arguments to function calls, and within conditional in
addition to the simpler cases of the operands to binary and unary operator)
while not being called--and triggering warnings--more than once for a given
ArraySubscriptExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136997 91177308-0d34-0410-b5e6-96231b3b80d8
d6c8865
@krememek krememek Revert 136984 and 136927.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136998 91177308-0d34-0410-b5e6-96231b3b80d8
270ba59
Anna Zaks Static Analyzer: Add a convinience API. Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137000 91177308-0d34-0410-b5e6-96231b3b80d8
3f10e32
Anna Zaks KeychainAPI checker: Track SymbolMetadata instead of MemRegion in che…
…cker state so that we could clear the state on evalDeadSymbols; also track the return value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137003 91177308-0d34-0410-b5e6-96231b3b80d8
5a58c6d
Commits on Aug 06, 2011
@krememek krememek [analyzer] Change SymbolReaper to store region roots implied by the E…
…nvironment, allowing it be queried when

determining if symbols derived from regions are still live.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137005 91177308-0d34-0410-b5e6-96231b3b80d8
bea2753
@krememek krememek [analyzer] Simplify logic for ExprEngine::VisitUnaryExprOrTypeTraitEx…
…pr to avoid recursion to subexpression.

This exposed bugs in the live variables analysis, and a latent analyzer bug in the SymbolReaper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137006 91177308-0d34-0410-b5e6-96231b3b80d8
f91a5b0
@krememek krememek [analyzer] add more buffer overflow tests to show we handle sizeof(VL…
…A) in obstruse ways...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137007 91177308-0d34-0410-b5e6-96231b3b80d8
7d11c3f
@d0k d0k Only look at decls after the current one when checking if it's the la…
…st field in a record.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137009 91177308-0d34-0410-b5e6-96231b3b80d8
22d4fed
@d0k d0k Fix HTML.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137010 91177308-0d34-0410-b5e6-96231b3b80d8
d8ee407
@rjmccall rjmccall Be sure to destroy the normal entry block of a cleanup that we
aren't actually going to make a normal cleanup for.  Sometimes
we optimistically create branches to such blocks for fixups,
and then we resolve the fixup to somewhere within the cleanup's
scope, and then the cleanup is actually not reachable for some
reason.  The process of resolving the fixup leaves us with
switches whose default edge leads to the cleanup;  we can
replace that with unreachable, then (in many cases) turn
the switch into an unconditional branch.

Fixes PR10467.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137011 91177308-0d34-0410-b5e6-96231b3b80d8
82cd2e5
@krememek krememek [analyzer] Start sketching out a new BugReporterVisitor that inspects…
… branches and other expressions to generate interesting path events in diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137012 91177308-0d34-0410-b5e6-96231b3b80d8
993124e
@rjmccall rjmccall Do l-value conversion, etc., on a switch condition expression in
ActOnStartOfSwitchStmt (i.e. before binding up a full-expression)
instead of ActOnFinishSwitchStmt.

Among other things, this means that property l-values are properly
converted inside the full-expression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137014 91177308-0d34-0410-b5e6-96231b3b80d8
a8e0cd8
Commits on Aug 07, 2011
@scshunt scshunt Add a __has_feature macro for generalized initializers, turned off
because we don't support them yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137027 91177308-0d34-0410-b5e6-96231b3b80d8
e1f6dea
@rjmccall rjmccall Avoid fallthrough-branching to an inactive cleanup even if it's
otherwise required.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137029 91177308-0d34-0410-b5e6-96231b3b80d8
f66a3ea
@jpbonn jpbonn Merge branch 'master' of http://llvm.org/git/clang e9f3bba