Commit Graph

12519 Commits

Author SHA1 Message Date
Daniel Dunbar f0a8344bac Mark IMAGE_INFO as constant on x86_64-darwin.
- This shouldn't change anything, we never actually access it, but
   this is consistent with llvm-gcc (and 32-bit)

llvm-svn: 69880
2009-04-23 08:03:21 +00:00
Chris Lattner 324f80b12a fix a problem producing debug info with global blocks.
llvm-svn: 69875
2009-04-23 07:18:56 +00:00
Daniel Dunbar 4645707034 Add implicit definition of objc_msgSend.
- As with malloc and friends, this is important where the return type
   on a 64-bit platform would otherwise end up discarding the upper
   32-bits.

llvm-svn: 69874
2009-04-23 07:00:09 +00:00
Chris Lattner 7b0344f656 implement debug info for _Complex.
llvm-svn: 69873
2009-04-23 06:13:01 +00:00
Chris Lattner 28ec0cf86c the logic for computing __func__ and friends is really broken:
the type assigned by sema (and is visible with sizeof(__func__) for
example) has nothing to do with what codegen ends up producing.
We should eventually add a method on PredefinedExpr to handle this.
In the meantime, just set up some framework and add some fixme's.

llvm-svn: 69872
2009-04-23 05:30:27 +00:00
Chris Lattner f718110ae5 remove some gone files
llvm-svn: 69871
2009-04-23 05:29:03 +00:00
Daniel Dunbar dec9e1ec5e Don't build error/warning/assertion detection in the testing script.
- This wasn't actually all that useful and isn't worth the extra
   (hard)code.

llvm-svn: 69869
2009-04-23 05:03:44 +00:00
Chris Lattner 0dc102624f some arm triples have weird characters in them, just fuzzy match
on armv* to be more compatible

llvm-svn: 69864
2009-04-23 04:22:04 +00:00
Chris Lattner 16ce381f37 Silence warnings about common forms of -Wstrict-aliasing etc.
llvm-svn: 69861
2009-04-23 04:12:10 +00:00
Douglas Gregor 515b505c3e PCH (de-)serialization of the protocols in an ObjCInterfaceDecl
llvm-svn: 69860
2009-04-23 03:59:07 +00:00
Douglas Gregor 0ebb9964f9 Add the PCH reader stub for ObjCCompatibleAliasDecl
llvm-svn: 69859
2009-04-23 03:51:49 +00:00
Douglas Gregor 49e72fb870 PCH support for ObjCPropertyImplDecl
llvm-svn: 69858
2009-04-23 03:43:53 +00:00
Douglas Gregor 5f66205233 The ivars in an ObjCImplementationDecl are now stored in the
DeclContext rather than in a separate list. This makes PCH
(de-)serialization trivial, so that ivars can be loaded lazily.

llvm-svn: 69857
2009-04-23 03:23:08 +00:00
Douglas Gregor 510fd8dff1 PCH support for ObjCCategoryImplDecl (which can't be tested now).
llvm-svn: 69856
2009-04-23 02:53:57 +00:00
Douglas Gregor 9a13efd5b2 PCH (de-)serialization for ObjCImplDecl. This can't be tested yet.
llvm-svn: 69855
2009-04-23 02:42:49 +00:00
Anders Carlsson 0781ce7cce Add a CXXConstructExpr that represents an implicit call to a C++ constructor. I think CXXTemporaryObjectExpr is going to become a subclass of CXXConstructExpr, since CXXTemporaryObjectExpr represents a syntactic temporary, for example T()
llvm-svn: 69854
2009-04-23 02:32:43 +00:00
Daniel Dunbar 22b0ada8cf Use std::sort instead of qsort.
- Notably, there was a memory error here, SkipIvars does not have to
   be the same size as IvarsInfo.

 - Fariborz, please check.

llvm-svn: 69850
2009-04-23 01:29:05 +00:00
Douglas Gregor 29bd76fd04 Eliminate the three SmallVectors in ObjCImplDecl (for instance
methods, class methods, and property implementations) and instead
place all of these entities into the DeclContext.

This eliminates more linear walks when looking for class or instance
methods and should make PCH (de-)serialization of ObjCDecls trivial
(and lazy).

llvm-svn: 69849
2009-04-23 01:02:12 +00:00
Douglas Gregor 85e110828e PCH support for Objective-C property declarations (UNTESTED!)
llvm-svn: 69843
2009-04-22 23:20:34 +00:00
Fariborz Jahanian 6df69867c3 ivar layout bitmap is alive!
llvm-svn: 69838
2009-04-22 23:00:43 +00:00
Douglas Gregor a57c3abf37 Add PCH statistics for the number/percent of lexical/visible declcontexts read
llvm-svn: 69835
2009-04-22 22:34:57 +00:00
Ted Kremenek 63e29cc99c Add PathDiagnosticRange to PathDiagnostics. These simply wrap SourceRange and
indicate whether or not the range represents an absolute range or should be
extended by lexing to the end of the token.

llvm-svn: 69834
2009-04-22 22:26:10 +00:00
Douglas Gregor acfc76cc63 Support locally-declared external declarations in PCH files
llvm-svn: 69833
2009-04-22 22:18:58 +00:00
Douglas Gregor 2e43ab535b Clean up and de-XFAIL-ify PCH test for external definitions
llvm-svn: 69831
2009-04-22 22:09:39 +00:00
Chris Lattner 91cb0eea67 remove obsolete tests.
llvm-svn: 69830
2009-04-22 22:06:26 +00:00
Douglas Gregor d4df8657b4 Support tentative definitions in precompiled headers. This isn't likely
to happen (ever), but at least we'll do the right thing when it does.

llvm-svn: 69829
2009-04-22 22:02:47 +00:00
Douglas Gregor 48db39dc90 Remove the serialization code that predates precompiled
headers. Future approaches to (de-)serializing ASTs will be based on
the PCH infrastructure.

llvm-svn: 69828
2009-04-22 21:45:53 +00:00
Douglas Gregor 7cd60f7be3 Eliminate some FIXMEs in the PCH reader that were either already fixed or aren't actually things to fix
llvm-svn: 69827
2009-04-22 21:15:06 +00:00
Douglas Gregor fedd428d04 Eliminate Sema::KnownFunctionIDs, so that Sema doesn't end up pulling
in a bunch of declarations from the PCH file. We're down to loading
very few declarations in Carbon-prefixed "Hello, World!":

*** PCH Statistics:
  6/20693 types read (0.028995%)
  7/59230 declarations read (0.011818%)
  50/44914 identifiers read (0.111324%)
  0/32954 statements read (0.000000%)
  5/6187 macros read (0.080815%)

llvm-svn: 69825
2009-04-22 20:56:09 +00:00
Ted Kremenek 48b7875e55 BugReporter (extensive diagnostics): Use correct location for location contexts.
llvm-svn: 69824
2009-04-22 20:51:59 +00:00
Ted Kremenek fb05406cef BugReporter (extensive diagnostics): always add an edge if there is no location
context.

llvm-svn: 69823
2009-04-22 20:36:26 +00:00
Eli Friedman d3a5a9d7fa Add handling for complex->int, int->complex float, and float->complex
int.  Note that constant int->complex float and float->complex int casts
were being miscompiled.

llvm-svn: 69821
2009-04-22 19:23:09 +00:00
Douglas Gregor b985eebcdf Minimize the number and kind of "external definitions" that the PCH
file needs to store. CodeGen needs to see these definitions (via
HandleTopLevelDecl), otherwise it won't be able to generate code for
them. 

This patch notifies the consumer (e.g., CodeGen) about function
definitions and variable definitions when the corresponding
declarations are deserialized. Hence, we don't eagerly deserialize the
declarations for every variable or function that has a definition in
the PCH file. This gives another 5% speedup for the Carbon-prefixed
"Hello, World!", and brings our PCH statistics down to something far
more reasonable:

*** PCH Statistics:
  13/20693 types read (0.062823%)
  17/59230 declarations read (0.028702%)
  54/44914 identifiers read (0.120230%)
  0/32954 statements read (0.000000%)
  5/6187 macros read (0.080815%)

llvm-svn: 69820
2009-04-22 19:09:20 +00:00
Chris Lattner 63660175f8 Add missing dependency, patch by Jason Haslam!
llvm-svn: 69819
2009-04-22 18:59:57 +00:00
Douglas Gregor 4621c6ae15 Lazy loading of builtins for precompiled headers.
PCH files now contain complete information about builtins, including
any declarations that have been synthesized as part of building the
PCH file. When using a PCH file, we do not initialize builtins at all;
when needed, they'll be found in the PCH file.

This optimization translations into a 9% speedup for "Hello, World!"
with Carbon.h as a prefix header and roughly a 5% speedup for 403.gcc
with its prefix header. We're also reading less of the PCH file for
"Hello, World!":

*** PCH Statistics:
  286/20693 types read (1.382110%)
  1630/59230 declarations read (2.751984%)
  764/44914 identifiers read (1.701029%)
  1/32954 statements read (0.003035%)
  5/6187 macros read (0.080815%)

down from

*** PCH Statistics:
  411/20693 types read (1.986179%)
  2553/59230 declarations read (4.310316%)
  1093/44646 identifiers read (2.448148%)
  1/32954 statements read (0.003035%)
  21/6187 macros read (0.339421%)

llvm-svn: 69815
2009-04-22 18:49:13 +00:00
Ted Kremenek 6c867a1460 BugReporter (extensive diagnostics):
- Remove stale assertion that was breaking the test suite.
- When popping location contexts, only add a control-flow piece for fileID
  locations.

llvm-svn: 69814
2009-04-22 18:37:42 +00:00
Ted Kremenek 0752a5dff3 BugReporter (extensive diagnostic algorithm): The initial control-flow edge now
starts from the first character of the first statement.

llvm-svn: 69813
2009-04-22 18:16:20 +00:00
Ted Kremenek 22579c4c8f PathDiagnosticLocation: ranges for terminators now only include the first
character instead of the entire range for the IfStmt, ForStmt, etc. We may
gradually refine these ranges later, but basically terminator ranges just refer
to the first keyword.

llvm-svn: 69812
2009-04-22 18:03:00 +00:00
Daniel Dunbar e4f25b706b Reapply r69771, with updates & fixes:
Rework the shadow struct that is layed out for Objective-C classes.

 - Superclasses are now always laid out in their shadow structure at
   the first field.

 - Prior to this, the entire class heirarchy was flattened into a
   single structure which meant that alignment, padding, and bitfields
   were incorrect (the ASTRecordLayout was correct however, which
   meant our debug info didn't coincide with ivar offsets, for
   example).

 - This is still very suboptimal (for example, ivar are looked up
   recursively, but I believe the ivar layout itself is now at least
   close to correct.

 - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding
   backwards

llvm-svn: 69811
2009-04-22 17:43:55 +00:00
Douglas Gregor 3d48e3d6f5 Remove some debugging output from the PCH reader
llvm-svn: 69803
2009-04-22 14:18:52 +00:00
Ted Kremenek 9ebfe91dea ccc-analyzer: Don't create preprocessed files about the ignored 'cdecl' attribute. We know Clang doesn't support it yet.
llvm-svn: 69802
2009-04-22 13:42:27 +00:00
Daniel Dunbar 202f3dc5b3 Remove lookupFieldDeclFromIvar from ObjCIvarDecl interface.
- This is only used by CGObjCRuntime now.

llvm-svn: 69800
2009-04-22 12:00:04 +00:00
Daniel Dunbar 24579842a5 Simplify addRecordToClass, it is not legal to call it on a forward
declaration now.

llvm-svn: 69799
2009-04-22 10:56:29 +00:00
Daniel Dunbar 7d4e1c5e4a Don't convert interface types (to structs) as part of CodeGenTypes.
- This has pros and cons, but for now the pros seem to significantly
   outway the con.

The con is that we will always need to cast in the runtime
implementation to a struct type, if we wish to access an interface
directly.

The pros are:
 - Avoid the cost of generating types which are used. Most
   manipulation of Objective-C objects is done through messages, and
   only the implementation of a class will directly access
   memory. Previously, we would convert the type even if it only
   appear as a function parameter, for example.

 - We don't need to worry about incomplete types, and
   UpdateCompletedType for interfaces is gone.

 - It becomes easier to narrow the interface to the shadow struct for
   Objective-C interfaces (so it can be eliminated).

Currently the runtimes still use the CodeGenTypes machinery to
generate the LLVM structure they need via ConvertTagDecl, but this can
eventually be replaced.

llvm-svn: 69797
2009-04-22 10:28:39 +00:00
Daniel Dunbar 7b4dfc8b78 Add CGObjCRuntime::GetConcreteClassStruct to encapsulate access to the
underlying llvm::StructType for an interface.

llvm-svn: 69796
2009-04-22 09:39:34 +00:00
Daniel Dunbar 66cb01313b Add another workaround for -include.
- If we don't find a file looking relative to the current working
   directory, fall back to header search. This is closer to what would
   happen if the lookup was starting from right directory in the first
   place (except it will find files in the directory of the main
   source file, which I *think* should not be found).

 - PR3992.

llvm-svn: 69794
2009-04-22 08:53:01 +00:00
Daniel Dunbar 83a66f78d2 Simplify.
llvm-svn: 69793
2009-04-22 08:50:59 +00:00
Daniel Dunbar 725dc2c5bb Emit meta data using the Ivar, not a looked up FieldDecl.
llvm-svn: 69790
2009-04-22 08:22:17 +00:00
Daniel Dunbar 89623deca1 Use ComputeIvarBaseOffset instead of looking up by hand.
llvm-svn: 69789
2009-04-22 08:20:31 +00:00
Daniel Dunbar 9fd114d577 Merge ivar access amongst the three runtimes.
- For now, this means we are always doing the address computations by
   hand instead of constructing a proper GEP. Right now, however, this
   is less important than having fewer entry points to dealing with
   Objective-C interface layout.

llvm-svn: 69787
2009-04-22 07:32:20 +00:00
Daniel Dunbar 6067720a41 Make sure this test runs on all 3 Objective-C implementations.
llvm-svn: 69786
2009-04-22 07:28:06 +00:00
Chris Lattner 43e6f8c08b implement debug info support for id<proto> and interface<proto>
llvm-svn: 69784
2009-04-22 06:58:56 +00:00
Chris Lattner ad8f750f71 ObjCQualifiedClass is dead, remove it.
llvm-svn: 69783
2009-04-22 06:50:37 +00:00
Chris Lattner 587cbe1ef2 deserialization support for qualified interfaces
llvm-svn: 69782
2009-04-22 06:45:28 +00:00
Chris Lattner 6e054afc9e pch support for protocol qualified id's.
llvm-svn: 69781
2009-04-22 06:40:03 +00:00
Chris Lattner 8f0734972b add three new objc expression types. @selector doesn't work because we have no
way to serialize selectors yet.

llvm-svn: 69780
2009-04-22 06:29:42 +00:00
Chris Lattner 19cea4eeb4 implement serialization support for @encode,
fix a couple of bugs in reader support for ObjCInterfaceDecl,
and add support for reading ObjCInterfaceType.

llvm-svn: 69779
2009-04-22 05:57:30 +00:00
Chris Lattner 01146a5fa9 rename methods.* -> objc_methods.*
llvm-svn: 69778
2009-04-22 05:31:53 +00:00
Chris Lattner dc00437fa0 change implicit int warnings to point to the identifier, not the
start of the declspec.  The fixit still goes there, and we underline
the declspec.  This helps when the start of the declspec came from a
macro that expanded from a system header.  For example, we now produce:

t.c:2:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static x;
~~~~~~ ^

llvm-svn: 69777
2009-04-22 05:27:59 +00:00
Ted Kremenek 9dae596dc1 Update checker build.
llvm-svn: 69776
2009-04-22 05:13:56 +00:00
Daniel Dunbar 722f424178 Make ObjCInterfaceDecl's const in some more places.
llvm-svn: 69775
2009-04-22 05:08:15 +00:00
Douglas Gregor f89771cb87 Reorganize built-in initialization to separate the creation of target builtins from marking IdentifierInfos as builtins. No functionality change
llvm-svn: 69774
2009-04-22 04:56:28 +00:00
Daniel Dunbar 658ba85820 Revert r69771, I missed some (obvious) details. :/
llvm-svn: 69773
2009-04-22 04:39:47 +00:00
Daniel Dunbar aefc2b9be3 Mark another TypeForDecl const and make getObjCInterfaceType's argument const.
llvm-svn: 69772
2009-04-22 04:34:53 +00:00
Daniel Dunbar 25b81ef847 Rework the shadow struct that is layed out for Objective-C classes.
- Superclasses are now always laid out their shadow structure at the
   first field.

 - Prior to this, the entire class heirarchy was flattened into a
   single structure which meant that alignment, padding, and bitfields
   weren't packed correctly (the ASTRecordLayout was correct however,
   which meant our debug info didn't coincide with ivar offsets, for
   example).

 - This is still very suboptimal, but I believe the ivar layout itself
   is now at least close to correct.

 - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding
   backwards

llvm-svn: 69771
2009-04-22 03:45:12 +00:00
Chris Lattner ed462a8d44 Fix rdar://6814950 - stdint.h isn't "-pedantic -std=c89" clean,
by marking the predefines buffer as a system header.  The problem 
with stdint is that it was getting problems like this:

/Volumes/Projects/cvs/llvm/Debug/lib/clang/1.0/include/stdint.h:43:9: warning: 'long long' is an extension when C99 mode is not enabled
typedef __INT64_TYPE__ int64_t;
        ^
<built-in>:73:29: note: instantiated from:
#define __INT64_TYPE__ long long
                            ^

We correctly silence warnings in system headers, but only if the 
spelling location of the token came from the system header.  This is
designed so that if you use a system macro in your code that you don't
get punished for its definition.  This is all cool except that the 
predefines buffer wasn't considered a system header.

llvm-svn: 69770
2009-04-22 03:42:19 +00:00
Chris Lattner 2dfdb3ea94 move 64-bit abi functions to lazy model, everything is lazy now, yay.
llvm-svn: 69767
2009-04-22 02:53:24 +00:00
Chris Lattner ce8754edac remove the last of the non-lazy objc runtime functions for the 32-bit ABI,
7 left for 64-bit ABI.

llvm-svn: 69766
2009-04-22 02:44:54 +00:00
Chris Lattner 0a696a42fe number of non-lazy runtime functions from 9 -> 4.
llvm-svn: 69765
2009-04-22 02:38:11 +00:00
Chris Lattner 095ac38f1c make message send functions lazy, we're down from 14 non-lazy functions to 9.
llvm-svn: 69764
2009-04-22 02:32:31 +00:00
Chris Lattner c6406dbf7f move more EH stuff to being lazily created. An empty .m file now
produces just 14 dead "declares" in llvm ir instead of 19.

llvm-svn: 69763
2009-04-22 02:26:14 +00:00
Chris Lattner a7c00b4c4c make try/catch objc runtime functions be lazily generated.
rdar://6809612

llvm-svn: 69762
2009-04-22 02:15:23 +00:00
Chris Lattner d27f8d8c9f rename test
llvm-svn: 69761
2009-04-22 00:59:27 +00:00
Chris Lattner 934074cd5f Fix a problem with objc foreach loop. It turns out that objc mode changes
for scoping to match C99 even when in C89 mode.  This patch fixes this 
(eliminating a "redefinition of thisKey" error), and also prevents non-sensical
diagnostics in -pedantic mode like this:

t.m:7:8: warning: variable declaration in for loop is a C99-specific feature
  for (id thisKey in keys) ;
       ^

llvm-svn: 69760
2009-04-22 00:54:41 +00:00
Douglas Gregor 3ddc876758 Test PCH support for VLAs
llvm-svn: 69758
2009-04-22 00:21:21 +00:00
Douglas Gregor 13d247f7ec Eliminate a FIXME in one of the PCH test cases
llvm-svn: 69757
2009-04-22 00:17:41 +00:00
Chris Lattner f8dc07369a Fix some mishandling of the attr(gnu_inline) mode when used with
extern.  Previously we would warn about it and ignore the attribute.
This is incorrect, it should be handled as a c89 "extern inline" 
function.  Many thanks to Matthieu Castet for pointing this out and
beating me over the head until I got it.

PR3988: extern inline function are not externally visible
llvm-svn: 69756
2009-04-22 00:03:30 +00:00
Douglas Gregor c3366a555b Lazy deserialization of macro definitions for precompiled headers.
This optimization improves performance on the Carbon-prefixed "Hello,
World!" example by 57%. For reference, we're now about 2.25x faster
than GCC PCH. We're also pulling in far less of the PCH file:

*** PCH Statistics:
  411/20693 types read (1.986179%)
  2553/59230 declarations read (4.310316%)
  1093/44646 identifiers read (2.448148%)
  1/32954 statements read (0.003035%)
  21/6187 macros read (0.339421%)

llvm-svn: 69755
2009-04-21 23:56:24 +00:00
Ted Kremenek fe95afd0bc Fix crash reported in PR 3991. The analyzer doesn't reason about ObjCKVCExpr.
llvm-svn: 69754
2009-04-21 23:53:32 +00:00
Steve Naroff dd9aba001d Update Xcode project with recently added files.
llvm-svn: 69753
2009-04-21 23:46:12 +00:00
Ted Kremenek eff7c6a2d6 This patch is largely due to Zhongxing Xu. I've simply applied it because of
some refactoring I did recently to StoreManager.

StoreManager::CastRegion: Handle casts to void* by stripping TypedViewRegions.

llvm-svn: 69751
2009-04-21 23:31:46 +00:00
Chris Lattner ca515ccb49 apply Eli's patch to fix PR4008, with a testcase. Thanks Eli!
llvm-svn: 69750
2009-04-21 23:28:41 +00:00
Mike Stump 3cfd5614e7 Resolve merge conflict better.
llvm-svn: 69748
2009-04-21 23:03:34 +00:00
Chris Lattner 2f343dd5c8 fix PR4026: Clang can't codegen __func__ without implicit cast
llvm-svn: 69747
2009-04-21 23:00:09 +00:00
Mike Stump d79b5a85b0 Tighten up blocks type checking. This was discussed back in the
r56595 timeframe, but left undone.  Radar 6812711

llvm-svn: 69745
2009-04-21 22:51:42 +00:00
Douglas Gregor 195e9c5d18 Lazy deserialization of identifiers in PCH files fixed a problem with
name lookup of structures declared within other structures.

llvm-svn: 69744
2009-04-21 22:48:38 +00:00
Chris Lattner 41b8694777 Fix rdar://6814047, a crash on invalid in blocks code I noticed when
working on the previous fix.

llvm-svn: 69742
2009-04-21 22:38:46 +00:00
Ted Kremenek 35f875c136 Fix: <rdar://problem/6777209> false Dereference of null pointer in loop: pointer increment/decrement preserves non-nullness
When the StoreManager doesn't reason well about pointer-arithmetic, propagate
the non-nullness constraint on a pointer value when performing pointer
arithmetic uisng ++/--.

llvm-svn: 69741
2009-04-21 22:38:05 +00:00
Ted Kremenek 1a1b62c168 Tweak pretty-printing of constraints.
llvm-svn: 69740
2009-04-21 22:37:11 +00:00
Douglas Gregor b475a5ca95 Don't bother writing a visible-declarations record for the translation
unit into the PCH file, since we won't be performing name lookup into
it anyway. Reduces the size of the Carbon.h PCH file by ~200k.

llvm-svn: 69739
2009-04-21 22:32:33 +00:00
Chris Lattner 497d7b0c8a fix marking of nested blocks with the "hasBlockDeclRefExprs" to
mark exactly the blocks which have references that are "live through".
This fixes a rejects valid: 
rdar://6808730 - [sema] [blocks] block rejected at global scope

llvm-svn: 69738
2009-04-21 22:26:47 +00:00
Douglas Gregor a868bbd392 Lazy deserialization of the declaration chains associated with
identifiers from a precompiled header.

This patch changes the primary name lookup method for entities within
a precompiled header. Previously, we would load all of the names of
declarations at translation unit scope into a large DenseMap (inside
the TranslationUnitDecl's DeclContext), and then perform a special
"last resort" lookup into this DeclContext when we knew there was a
PCH file (see Sema::LookupName). Now, when we see an identifier named
for the first time, we load all of the declarations with that name
that are visible from the translation unit into the IdentifierInfo's
chain of declarations. Thus, the explicit "look into the translation
unit's DeclContext" code is gone, and Sema effectively uses the same
IdentifierInfo-based name lookup mechanism whether we are using a PCH
file or not. 

This approach should help PCH scale with the size of the input program
rather than the size of the PCH file. The "Hello, World!" application
with Carbon.h as a PCH file now loads 20% of the identifiers in the
PCH file rather than 85% of the identifiers. 

90% of the 20% of identifiers loaded are actually loaded when we
deserialize the preprocessor state. The next step is to make the
preprocessor load macros lazily, which should drastically reduce the
number of types, declarations, and identifiers loaded for "Hello,
World".

llvm-svn: 69737
2009-04-21 22:25:48 +00:00
Chris Lattner 1f9183c7ca this is a warning now, return a well formed ast.
llvm-svn: 69731
2009-04-21 22:00:54 +00:00
Ted Kremenek 2d495a6f43 Refactor 'BasicStoreManager::CastRegion' and 'RegionStoreManager::CastRegion'
into StoreManager::CastRegion. Both methods were practically identical, and this
is core logic that is common to all StoreManagers since it defines the basic
invariants of the abstract memory model.

llvm-svn: 69730
2009-04-21 21:51:34 +00:00
Chris Lattner 6750113d54 force a 32-bit triple.
llvm-svn: 69729
2009-04-21 21:42:41 +00:00
Daniel Dunbar d1148a7f72 Make sure to mark the interface as completed when we see an
@implementation that closes a @class delcaration.
 - I don't know how to make a test case for this, but this strengthens
   the invariants that hold internally. The functionality change here
   is the edit to SemaDeclObjC.cpp.

llvm-svn: 69728
2009-04-21 21:41:56 +00:00
Daniel Dunbar d361c345c6 Force triple (test case fails for platforms with the non-fragile ABI).
llvm-svn: 69727
2009-04-21 21:17:29 +00:00
Daniel Dunbar 46285d8084 We no longer accept @defs with the non-fragile ABI.
llvm-svn: 69721
2009-04-21 21:16:23 +00:00
Chris Lattner a8c92540dd temporarily downgrade to a warning.
llvm-svn: 69720
2009-04-21 21:14:41 +00:00
Ted Kremenek 01c9af18c9 Plist diagnostics: Remove deprecated single-point locations in control-flow
pieces.

llvm-svn: 69719
2009-04-21 21:03:00 +00:00
Fariborz Jahanian ece1b2b0e1 Patch to diagnose use of objc's @defs in nonfragile abi.
llvm-svn: 69710
2009-04-21 20:28:41 +00:00
Ted Kremenek a8e8bc24b3 Added over-release test case.
llvm-svn: 69703
2009-04-21 20:01:03 +00:00
Ted Kremenek 9bb660c3f4 Recommit 69694 but this time also include the header changes (sorry for breaking
the build).

llvm-svn: 69702
2009-04-21 19:56:58 +00:00
Chris Lattner 37920f5359 reject sizeof(itf) when itf is a forward declared interface, or when
in non-fragile abi mode.  rdar://6811884

llvm-svn: 69701
2009-04-21 19:55:16 +00:00
Douglas Gregor fa9ab53d95 Fix emission of static tentative definitions referenced from other static functions
llvm-svn: 69699
2009-04-21 19:28:58 +00:00
Daniel Dunbar 2655f85975 Revert 69694 (use of undefined getSymbol)
llvm-svn: 69697
2009-04-21 18:54:52 +00:00
Fariborz Jahanian f5fec02d0c More objc2's ivar layout bitmap. No change in functionality.
llvm-svn: 69695
2009-04-21 18:33:06 +00:00
Ted Kremenek 99de8ae19c Add pretty-printing for CodeTextRegions.
llvm-svn: 69694
2009-04-21 18:31:19 +00:00
Ted Kremenek 7421c0161a Lexically order the implementation of MemRegion 'print' methods. No functionality change.
llvm-svn: 69688
2009-04-21 18:09:22 +00:00
Chris Lattner b534f6a601 don't bother emitting a zero byte memset at all. We used to get them
in cases like this:

typedef struct {
  short instance;
  char name[0];
} ATTR_LIST_ENTRY2;

void test() {
  ATTR_LIST_ENTRY2 X = (ATTR_LIST_ENTRY2) { .instance = 7, };
}  

While it is safe to emit them, it is pretty silly.

llvm-svn: 69687
2009-04-21 17:59:23 +00:00
Ted Kremenek 30fb341f4f Use 'getAs<CodeTextRegion>' instead of 'dyn_cast<CodeTextRegion>' to handle any
layered regions.

llvm-svn: 69686
2009-04-21 17:37:26 +00:00
Ted Kremenek dab465d820 Grammar fix.
llvm-svn: 69682
2009-04-21 17:14:24 +00:00
Douglas Gregor beecd58e21 Explictly track tentative definitions within Sema, then hand those
tentative definitions off to the ASTConsumer at the end of the
translation unit. 

Eliminate CodeGen's internal tracking of tentative definitions, and
instead hook into ASTConsumer::CompleteTentativeDefinition. Also,
tweak the definition-deferal logic for C++, where there are no
tentative definitions.

Fixes <rdar://problem/6808352>, and will make it much easier for
precompiled headers to cope with tentative definitions in the future.

llvm-svn: 69681
2009-04-21 17:11:58 +00:00
Daniel Dunbar 108098d56c Fix test typo.
llvm-svn: 69676
2009-04-21 16:03:31 +00:00
Daniel Dunbar 93c1914de3 Use an ASTRecordLayout to compute the sizeof an interface, not
addRecordToClass.
 - Among other things, this fixes a crash when applying sizeof to an
   interface with synthesized ivars, although things still aren't
   "correct" here.

llvm-svn: 69675
2009-04-21 15:48:54 +00:00
Steve Naroff 426662ba79 Add pch reader/writer support for most of DeclObjC.h. Very close to reading/writing all ObjC AST nodes that we will encounter in header files (still a few FIXME's).
Once selector support is in place, we should be able to take this for a spin (and add test cases).

llvm-svn: 69674
2009-04-21 15:12:33 +00:00
Chris Lattner 3501d43a10 implement semantic analysis for @synchronized, fixing a crash on invalid
rdar://6810940 - @synchronized has no sema checks

llvm-svn: 69670
2009-04-21 06:11:25 +00:00
Chris Lattner 6af6edb8b7 this time with more workingness.
llvm-svn: 69669
2009-04-21 06:06:09 +00:00
Sanjiv Gupta 4c5dfd3c45 Pass and return aggregate types directly to function calls.
llvm-svn: 69668
2009-04-21 06:01:16 +00:00
Chris Lattner c70dd56477 add support for goto checking and @synchronized blocks,
rdar://6810106

llvm-svn: 69667
2009-04-21 06:01:00 +00:00
Chris Lattner e08c43a3b0 fix massive testsuite failures from Alexei's patch due to inverted logic.
llvm-svn: 69666
2009-04-21 06:00:24 +00:00
Chris Lattner 2f5693f62d Split preprocessor initialization logic out of clang-cc into
libfrontend.  Patch by Alexei Svitkine!

llvm-svn: 69664
2009-04-21 05:40:52 +00:00
Chris Lattner a80b2bdb25 document new form of -fdiagnostics-print-source-range-in
llvm-svn: 69663
2009-04-21 05:35:32 +00:00
Chris Lattner 6968641ac5 rename -fprint-source-range-info -> -fdiagnostics-print-source-range-info.
Temporarily accept both of them, I'll rip out the old one after awhile.

llvm-svn: 69662
2009-04-21 05:34:31 +00:00
Chris Lattner 1f02e054a9 Fix PR4027 + rdar://6808859, we were rejecting implicit casts of
aggregates even though we already accept explicit ones.  Easy fix.

llvm-svn: 69661
2009-04-21 05:19:11 +00:00
Chris Lattner 16f11c7319 downgrade from extwarn to warning.
llvm-svn: 69660
2009-04-21 04:54:03 +00:00
Chris Lattner d6e97af74a improve MacroInfo to track the source range of the macro definition,
patch by Alexei Svitkine!

llvm-svn: 69659
2009-04-21 04:46:33 +00:00
Chris Lattner a9aeea9f27 use of predefined identifiers like __func__ at global scope warn in sema,
but crashed codegen.  Fix this to report the name of the llvm function.
This fixes rdar://6808051

llvm-svn: 69658
2009-04-21 04:41:23 +00:00
Chris Lattner 92b29b2f9f make "in included from" and "in instatiation from" messages respect
-fno-show-location, patch by Alexei Svitkine (PR4024)

llvm-svn: 69657
2009-04-21 03:57:54 +00:00
Chris Lattner cd6d4b105a add a preprocessor callback function for #undef, patch by
Alexei Svitkine!

llvm-svn: 69656
2009-04-21 03:42:09 +00:00
Anders Carlsson 6f2878360c Add a CXXDestroyExpr. Add classof member functions to CXXTempVarDecl.
llvm-svn: 69654
2009-04-21 02:22:11 +00:00
Sanjiv Gupta f09cb95236 Use an APInt of target int size to detect overflow while parsing multichars.
So 'abc' on i16 platforms will warn but not on i32 platforms.

llvm-svn: 69653
2009-04-21 02:21:29 +00:00
Anders Carlsson 21d30b41fc Add the beginnings of a CXXTempVarDecl class.
llvm-svn: 69652
2009-04-21 01:57:48 +00:00
Daniel Dunbar e000df6882 Remove unnused variable.
llvm-svn: 69650
2009-04-21 01:32:46 +00:00
Daniel Dunbar 9ebf9516af Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
when we need them -- which is exactly what some code was already
doing!
 - No intended functionality change.

llvm-svn: 69648
2009-04-21 01:19:28 +00:00
Daniel Dunbar 50b5c4ccaa Revert 69646, that was the precise inverse of what I wanted to commit.
llvm-svn: 69647
2009-04-21 01:19:10 +00:00
Daniel Dunbar 9df980b876 Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
when we need them -- which is exactly what some code was already
doing!
 - No intended functionality change.

llvm-svn: 69646
2009-04-21 01:18:01 +00:00
Mike Stump 3214d12325 Fixup codegen for write barriers for block variables. Radar 6786715
llvm-svn: 69642
2009-04-21 00:51:43 +00:00
Daniel Dunbar be9dae80b3 Remove LateBoundIVars() runtime interface, it is unused.
llvm-svn: 69641
2009-04-21 00:49:20 +00:00
Daniel Dunbar e03f005d30 Assert on a few conditions that (I believe) should hold
w.r.t. ASTContext::[gs]etFieldDecl, and the Field argument to
EmitObjCValueForIvar).

llvm-svn: 69639
2009-04-21 00:41:40 +00:00
Daniel Dunbar 712e4dee26 Look at the TMP environment variable as well.
llvm-svn: 69638
2009-04-21 00:25:10 +00:00
Daniel Dunbar 44ea0b2e0e Update this (non-default) test case.
llvm-svn: 69636
2009-04-20 23:53:56 +00:00
Fariborz Jahanian 80c9ce2c4a ObjC2's Ivar bitmap layout work. No change in functionality.
llvm-svn: 69629
2009-04-20 22:03:45 +00:00
Daniel Dunbar f07e9893a9 Mark TypeForDecl mutable.
- Let the const propogation begin.

llvm-svn: 69628
2009-04-20 21:52:34 +00:00
Chris Lattner f4c68741d4 fix the second half of PR4006 and rdar://6807000 by treating
() as being either zero arguments or one empty argument depending
on situation.

llvm-svn: 69627
2009-04-20 21:08:10 +00:00
Douglas Gregor e84a9daa16 Write the identifier table into the PCH file as an on-disk hash table
that also includes the contents of the IdentifierInfo itself (the
various fields and flags, along with the chain of identifiers visible
at the top level that have that name).

We don't make any use of the hash table yet, except that our
identifier ID -> string mapping points into the hash table now.

llvm-svn: 69625
2009-04-20 20:36:09 +00:00
Anders Carlsson 9603143c5d Fix tyop in SSSE3 header (6808876).
llvm-svn: 69623
2009-04-20 20:31:10 +00:00
Daniel Dunbar c35694da21 Also look at the TEMP environment variable as a place to put temporary
files.

llvm-svn: 69622
2009-04-20 20:28:21 +00:00
Daniel Dunbar e3f5cfc0b8 Move countInheritedIvars to within striking distance of
GetClassSizeInfo

Reduce nesting in GetInterfaceDeclStructLayout.

Tweak some comments.

No functionality change.

llvm-svn: 69621
2009-04-20 20:18:54 +00:00
Steve Naroff 3390a2935d Fix spelling error.
llvm-svn: 69620
2009-04-20 20:16:02 +00:00
Steve Naroff aac654abeb Add pch reader/writer support for ObjCContainerDecl, ObjCInterfaceDecl, & ObjCIvarDecl.
Next step: Add selector support to PCHWriter::AddDeclarationName().

llvm-svn: 69619
2009-04-20 20:09:33 +00:00
Chris Lattner ddf6ca0355 the __gnuc_inline__ attribute is actually named __gnu_inline__,
PR4023

llvm-svn: 69618
2009-04-20 19:12:28 +00:00
Devang Patel 45dfbd16b0 Add test case to check line number in debug info.
llvm-svn: 69617
2009-04-20 19:07:55 +00:00
Douglas Gregor 35cf42e55e Allow the Info type used in the on-disk hash table generator to have state
llvm-svn: 69616
2009-04-20 19:03:54 +00:00
Daniel Dunbar ab8ce7cddb If defined, use TMPDIR environment variable as location for temporary files.
llvm-svn: 69609
2009-04-20 17:32:49 +00:00
Chris Lattner f9b00eb7dc clean up anonymous bitfield diagnostics, PR4017
llvm-svn: 69608
2009-04-20 17:29:38 +00:00
Douglas Gregor 162dd0245e Introduce the notion of a SemaConsumer, which is an ASTConsumer that
also gets access to the Sema object performing semantic analysis. This
will be used by the PCH writer to serialize Sema state.

No functionality change.

llvm-svn: 69595
2009-04-20 15:53:59 +00:00
Steve Naroff 04f2d14d6a Add pch reader/writer support for ObjCMethodDecl.
Test will be enabled with ObjCInterfaceDecl is added.

llvm-svn: 69594
2009-04-20 15:06:07 +00:00
Zhongxing Xu 2f8198f82a update the doc.
llvm-svn: 69587
2009-04-20 10:09:10 +00:00
Eli Friedman 3a1e692fed Some cleanup and bug-fixing for address-of checking. This causes a couple of
minor accepts-invalid regressions, but we weren't really rejecting them for 
the right reason.  We really need a more general solution to detect all the 
cases of the promotion of arrays with a register storage class.

llvm-svn: 69586
2009-04-20 08:23:18 +00:00
Douglas Gregor 13ad62ced7 Make the on-disk hash table usable with non-file
raw_ostreams. Requires LLVM r69583.

llvm-svn: 69584
2009-04-20 07:36:26 +00:00
Daniel Dunbar be1f26df5d Inline GetFirstIvarInRecord into sole caller.
- No functionality change.

llvm-svn: 69582
2009-04-20 07:18:49 +00:00
Daniel Dunbar 75e909f5e0 Set a bit in IMAGE_INFO to indicate that we don't contain any
@synthesized ivars for superclasses.
 - <rdar://problem/6806371> [clang] Mark code without miscompiled
   @synthesized properties

llvm-svn: 69581
2009-04-20 07:11:47 +00:00
Douglas Gregor 52289d3343 Move the on-disk hash table code into its own header. No functionality change.
llvm-svn: 69580
2009-04-20 07:08:21 +00:00
Daniel Dunbar f5c18461e3 Lift out GetNamedIvarList.
Drop uses of GetFirstInvarInRecord, instead we lookup the ivars we
know are in the record.
 - This is somewhat less efficient, but I need to detangle this code
   first...

llvm-svn: 69579
2009-04-20 06:54:31 +00:00
Daniel Dunbar c040ce459c Make FieldDecl parameter to getObjCEncodingForType... const.
llvm-svn: 69578
2009-04-20 06:37:24 +00:00
Zhongxing Xu 3070210377 Remove loc::FuncVal.
llvm-svn: 69577
2009-04-20 06:35:22 +00:00
Chris Lattner 396b9c380a more stuff.
llvm-svn: 69576
2009-04-20 06:26:18 +00:00
Daniel Dunbar 69a79b1a60 Don't crash in the diagnostic printer if we happen to get passed a
null string / identifier.

llvm-svn: 69575
2009-04-20 06:13:16 +00:00
Chris Lattner 5ed5e9a612 add a bunch of diagnostics options, add one example warning group.
llvm-svn: 69573
2009-04-20 06:00:23 +00:00
Daniel Dunbar caec0238bc Don't emit ivar offsets for unnamed bit fields.
Also, added assertion that the field matches what would be looked up.

llvm-svn: 69572
2009-04-20 05:53:40 +00:00
Chris Lattner bc002ebd03 Add option groups for -Wimplicit-int and -Wimplicit.
remove special case hack for -Werror-implicit-function-declaration

llvm-svn: 69571
2009-04-20 05:45:34 +00:00
Zhongxing Xu ac1294318d get a CodeTextRegion when visiting FunctionDecl reference.
get FunctionDecl with more general utility method.

llvm-svn: 69570
2009-04-20 05:24:46 +00:00
Chris Lattner 6840825137 slurp some content from the PTH doc into the user's doc.
llvm-svn: 69569
2009-04-20 04:37:38 +00:00
Chris Lattner f9d8913b80 initial skeleton of a user's manual.
llvm-svn: 69568
2009-04-20 04:23:09 +00:00
Eli Friedman bc633beda4 PR3247: Handle a couple of cases where we weren't emitting VLA sizes (and
subsequently crashed).

llvm-svn: 69567
2009-04-20 03:54:15 +00:00
Eli Friedman 3253e189c6 PR3248: Make sure the evaluate the operand of a sizeof when it has a VLA type.
Adapted from patch by Tim Northover.

llvm-svn: 69566
2009-04-20 03:21:44 +00:00
Zhongxing Xu 23e1f45664 As we now have ValueManager as the new value factory, we do not need factory
methods of SVal.

llvm-svn: 69565
2009-04-20 02:27:09 +00:00
Eli Friedman 7de03e1950 Hook up -Wunused-value to the unused expression warning. This is
useful for macro-heavy codebases that tend to trigger this warning a 
lot.

Note that a make clean is required to get the option working; the 
dependencies for DiagnosticGroups.inc appear to be broken.

llvm-svn: 69564
2009-04-20 01:56:54 +00:00
Daniel Dunbar 5d5dbb1754 Remove non-const form of lookupFieldDeclForIvar.
llvm-svn: 69563
2009-04-20 00:37:55 +00:00
Daniel Dunbar ae03226bc6 Comment fixes.
llvm-svn: 69562
2009-04-20 00:33:43 +00:00
Daniel Dunbar 554fd79b38 Lift GetClassSizeInfo out of GenerateClass, add a FIXME.
- No functionality change.

llvm-svn: 69561
2009-04-19 23:41:48 +00:00
Chris Lattner 504af1177d implement "#pragma GCC diagnostic". Besides being a nice feature, this
will let us test for multiple different warning modes in the same
file in regression tests.

This implements rdar://2362963, a 10-year old feature request :)

llvm-svn: 69560
2009-04-19 23:16:58 +00:00
Chris Lattner c6fafed04c move group twiddling options into Diagnostic.cpp instead of
Warnings.cpp.  Warnings.cpp now doesn't need to #include
tblgen produced output directly.

llvm-svn: 69559
2009-04-19 22:34:23 +00:00
Chris Lattner 3251e3cfaa don't crash on invalid ranges in -fprint-source-range-info
mode, just ignore them as usual.

llvm-svn: 69558
2009-04-19 22:24:10 +00:00
Chris Lattner ddddff4f41 Fix PR4007: clang doesn't know -Werror-foo is the same as -Werror=foo
llvm-svn: 69557
2009-04-19 22:07:21 +00:00
Chris Lattner df2226839f Warn about uses of #pragma STDC FENV_ACCESS ON, since we don't
support it.  I don't know what evaluation method we use for complex
arithmetic, so I don't know whether/if we should warn about use of
CX_LIMITED_RANGE.

This concludes my planned hacking on STDC pragmas, flame away :)

llvm-svn: 69556
2009-04-19 21:55:32 +00:00
Sebastian Redl 8ce189f9ce Conditional operator C++ checking complete. What issues remain are in more general code.
llvm-svn: 69555
2009-04-19 21:53:20 +00:00
Chris Lattner 02ef4e3dba diagnose invalid syntax of STDC pragmas.
llvm-svn: 69554
2009-04-19 21:50:08 +00:00
Eli Friedman daea3f62b5 Print an error for uses of __thread on targets which don't support it.
llvm-svn: 69553
2009-04-19 21:48:33 +00:00
Eli Friedman d88c8a104f Add target property for whether thread-local storage is supported.
Let me know if I messed up for some target.  Note that for Windows, we 
should be able to support it (MSVC supports "__declspec(thread)"), but 
I'm pretty sure LLVM doesn't know how to generate the correct code.

llvm-svn: 69552
2009-04-19 21:38:35 +00:00
Chris Lattner a0b1f76d10 reject invalid stuff in the STDC namespace.
llvm-svn: 69551
2009-04-19 21:25:37 +00:00
Chris Lattner 958ee04368 stub out STDC #pragmas.
llvm-svn: 69550
2009-04-19 21:20:35 +00:00
Daniel Dunbar f5e9b1f5d0 Forward f[no-]dollars-in-identifiers to clang, when specified.
llvm-svn: 69549
2009-04-19 21:20:32 +00:00
Sebastian Redl 0753c6f591 Bring member pointer operands of the conditional operator to a common type. We're getting there ...
llvm-svn: 69548
2009-04-19 21:15:26 +00:00
Chris Lattner 21656f22db basic support for -Wunknown-pragmas, more coming.
llvm-svn: 69547
2009-04-19 21:10:26 +00:00
Daniel Dunbar 8281bdeb4d Forward -fno-diagnostics-fixit-info to clang-cc.
llvm-svn: 69546
2009-04-19 21:09:34 +00:00
Eli Friedman 4f856744e5 PR3853: Add CodeGen support for __thread.
llvm-svn: 69545
2009-04-19 21:05:03 +00:00
Chris Lattner 1c1a00cf51 move token paste poisoning diagnostics to after the instantiation loc
for a token is set, this makes the diagnostic "expanded from stack" work
for this diagnostic.  Add a testcase for PR3918.

llvm-svn: 69544
2009-04-19 20:29:42 +00:00
Eli Friedman 08a375b954 Tests for __thread specifier.
llvm-svn: 69543
2009-04-19 20:29:08 +00:00
Eli Friedman d5c0eeda72 Add more thorough/correct checking for invalid __thread specifiers.
llvm-svn: 69542
2009-04-19 20:27:55 +00:00
Eli Friedman fe92e701aa Silence gcc warning.
llvm-svn: 69541
2009-04-19 20:21:56 +00:00
Chris Lattner db41ddf756 pick a smaller header, one that we control to test this.
llvm-svn: 69540
2009-04-19 20:18:57 +00:00
Chris Lattner 1dc5219a0a rename test for consistency with other pragma test.
llvm-svn: 69539
2009-04-19 20:16:27 +00:00
Chris Lattner 0e71dbf9f0 merge pragma poison tests into one file with -verify mode.
llvm-svn: 69538
2009-04-19 20:15:59 +00:00
Chris Lattner ab9d51cfc4 merge two tests
llvm-svn: 69537
2009-04-19 20:10:12 +00:00
Chris Lattner da4ebb8921 Fix PR3918: Invalid use of __VA_ARGS__ not diagnosed,
by rejecting invalid poisoned tokens in the token
pasting path.

llvm-svn: 69536
2009-04-19 20:06:32 +00:00
Sebastian Redl 3b7ef5e374 Another piece of the conditional operator puzzle. We'll want to use FindCompositePointerType in some other places, too.
llvm-svn: 69534
2009-04-19 19:26:31 +00:00
Chris Lattner 1377dc4c79 convert to -verify mode.
llvm-svn: 69532
2009-04-19 18:54:13 +00:00
Chris Lattner 249c38bb02 Fix PR4006, incorrect handling of __VA_ARGS__ when it was the first token
in a function-like macro body.  This has the added bonus of moving some
function-like macro specific code out of the object-like macro codepath.

llvm-svn: 69530
2009-04-19 18:26:34 +00:00
Chris Lattner 6df41af7fb actually just do this on all x86 targets, it won't hurt
non-glibc ones.

llvm-svn: 69528
2009-04-19 17:32:33 +00:00
Chris Lattner 4997b8ef98 Define __NO_MATH_INLINES on linux/x86 so that we don't get inline
functions in glibc header files that use FP Stack inline asm which the
backend can't deal with (PR879).

This "fixes" PR3970 for linux.  Other affected systems should do similar
things.  Maybe this should just go to the general i386/x86-64 sections?

llvm-svn: 69527
2009-04-19 17:29:50 +00:00
Chris Lattner 29d34cabc5 implement compiler support for -fno-diagnostics-fixit-info,
rdar://6805442

llvm-svn: 69525
2009-04-19 07:44:08 +00:00
Chris Lattner 30b55dc946 invalid directives can occur in #if 0 code, just pass them
through like other directives PTH doesn't care about.  This
should fix rdar://6804029

llvm-svn: 69524
2009-04-19 07:32:03 +00:00
Chris Lattner 9941ce33c3 make PTH not crash on a null directive (# on its own line)
llvm-svn: 69523
2009-04-19 07:25:40 +00:00
Chris Lattner 6ada5d72f8 use isNot instead of !is
llvm-svn: 69522
2009-04-19 07:15:51 +00:00
Chris Lattner fc507055c7 fix -fdollars-in-identifiers to have a default that is overriden
by the command line option if present.

llvm-svn: 69521
2009-04-19 07:06:52 +00:00
Chris Lattner 98b100590d fix rdar://6804322 by wiring up -fdollars-in-identifiers
with assembler-with-cpp mode.

llvm-svn: 69520
2009-04-19 07:00:02 +00:00
Chris Lattner 5f65cc8215 silence a warning, it isn't clear what the right answer is here,
will talk to steve.

llvm-svn: 69519
2009-04-19 06:59:18 +00:00
Chris Lattner ea73782ce3 convert to -verify mode.
llvm-svn: 69518
2009-04-19 06:56:11 +00:00
Chris Lattner 96adcd5e74 silence a warning, I need to talk to Devang about this code.
llvm-svn: 69517
2009-04-19 06:50:29 +00:00
Chris Lattner b433b279f3 Fix rdar://6804402 - crash on objc implementations declared with
@class but no implementation.  This was broken in all 3 runtime
impls.

llvm-svn: 69512
2009-04-19 06:02:28 +00:00
Chris Lattner 4e1f0c6757 rearrange #include order.
llvm-svn: 69511
2009-04-19 05:30:08 +00:00
Chris Lattner 45542ea107 run the jump checker on blocks, even though they don't have gotos,
they do allow switches.

llvm-svn: 69510
2009-04-19 05:28:12 +00:00
Chris Lattner 9fecd743ca add a new Sema::CurFunctionNeedsScopeChecking bool that is used to avoid
calling into the jump checker when a function or method is known to contain
no VLAs or @try blocks.

llvm-svn: 69509
2009-04-19 05:21:20 +00:00
Chris Lattner c5f4ab6372 test that vlas are checked in an objc method context.
llvm-svn: 69508
2009-04-19 05:20:37 +00:00
Chris Lattner de6240cd45 apparently gotos aren't allowed at all in blocks. Stub out a testcase for when/if they are.
llvm-svn: 69507
2009-04-19 04:51:27 +00:00
Chris Lattner 4be550ec68 more testcases of variably modified types.
llvm-svn: 69506
2009-04-19 04:48:07 +00:00
Chris Lattner 1a1fdbd75d move jump scope checking and related code out into its own file, SemaDecl.cpp is
already too large.

llvm-svn: 69505
2009-04-19 04:46:21 +00:00
Daniel Dunbar 2355ea2625 Some more tweaks to driver documentation.
llvm-svn: 69504
2009-04-19 02:33:12 +00:00
Daniel Dunbar 9a7a78b0ae Fix bug in computation of ivar offsets for (adjacent) bitfields.
- The confusing IRgen bitfield interface is partly to blame here;
   fixing the functional error for now, cleanups to the interface to
   follow.

llvm-svn: 69503
2009-04-19 02:03:42 +00:00
Chris Lattner ecbcb3ab0b minor typographical fixes
llvm-svn: 69502
2009-04-19 02:02:45 +00:00
Chris Lattner cd3bb8f7e4 revert david's patch, which causes a testsuite failure.
llvm-svn: 69501
2009-04-19 01:33:30 +00:00
Chris Lattner cc6892e336 rewrite an O(N^2) algorithm to be O(n).
llvm-svn: 69500
2009-04-19 01:32:00 +00:00
Chris Lattner c67540501f second half of indirect jump checking: make sure that any
address taken labels are in function scope

llvm-svn: 69499
2009-04-19 01:16:06 +00:00
Chris Lattner 0bf2dd2ed4 First half of jump scope checking for indirect goto.
llvm-svn: 69498
2009-04-19 01:05:26 +00:00
Chris Lattner 34d9a51892 Add location info for indirect goto.
llvm-svn: 69497
2009-04-19 01:04:21 +00:00
Daniel Dunbar bf90b33665 Reuse ObjcIvarOffsetVariable instead of duplicating code.
- No functionality change (but added a FIXME).

llvm-svn: 69496
2009-04-19 00:44:02 +00:00
Daniel Dunbar a106052090 Remove some unnecessary complexity.
- No functionality change.

llvm-svn: 69495
2009-04-19 00:31:15 +00:00
Chris Lattner c1b96c3590 "This patch fixes message sends to super in class methods for the GNU runtime (currently an instance method lookup is being performed)."
Patch by David Chisnall!

llvm-svn: 69493
2009-04-18 23:12:40 +00:00
Chris Lattner 19bd27f493 add some testcases that we do not correctly handle.
llvm-svn: 69492
2009-04-18 23:07:55 +00:00
Chris Lattner f7fcb516de reimplement DeclStmt handling so that we correctly handle intermixed
VLA's and statement expressions.

llvm-svn: 69491
2009-04-18 23:01:20 +00:00
Chris Lattner a0cfd6b610 rearrange.
llvm-svn: 69490
2009-04-18 22:56:52 +00:00
Chris Lattner fb5ef701d5 add testcases for some more scary/horrible things that work.
llvm-svn: 69488
2009-04-18 22:42:18 +00:00
Chris Lattner 508253d64b the scope checker does work with objc methods, add testcase.
llvm-svn: 69487
2009-04-18 22:37:38 +00:00
Chris Lattner b6e368235a I didn't understand how @catches were chained. Now that I get it, fix
the scope checker to not think @catches are nested in each other, eliminating
some bogus notes.

llvm-svn: 69486
2009-04-18 22:35:34 +00:00
Chris Lattner bf78da7b36 Fix PR3917: the location of a #line directive is the location of the first _.
llvm-svn: 69485
2009-04-18 22:29:33 +00:00
Chris Lattner 93017cc12a Change Preprocessor::AdvanceToTokenCharacter to stop at
the first real character of a token.  For example, advancing
to byte 3 of foo\
bar

should stop at the b, not the \.

llvm-svn: 69484
2009-04-18 22:28:58 +00:00
Chris Lattner 38b2cde4c4 add a new Lexer::SkipEscapedNewLines method.
llvm-svn: 69483
2009-04-18 22:27:02 +00:00
Chris Lattner fbce7aa1f4 factor escape newline measuring out into its own helper function.
llvm-svn: 69482
2009-04-18 22:05:41 +00:00