Commit Graph

64 Commits

Author SHA1 Message Date
Brad King 9342a4c203 Merge branch 'reduce-cmState-accumulation' into reduce-cmState-accumulation-for-master 2015-11-25 12:33:06 -05:00
Brad King 5f860ebb67 cmState: Avoid accumulating snapshot storage for short-lived scopes
We need to keep only certain snapshot types and their ancestors.
Also keep those needed for backtraces.
2015-11-25 12:30:13 -05:00
Stephen Kelly 55474e6182 cmState: Move GetTargetTypeName from cmTarget. 2015-10-15 00:41:40 +02:00
Stephen Kelly eac15298a8 cmState: Move TargetType enum from cmTarget.
Mostly automated:

 values=( "EXECUTABLE" "STATIC_LIBRARY" "SHARED_LIBRARY" "MODULE_LIBRARY" "OBJECT_LIBRARY" "UTILITY" "GLOBAL_TARGET" "INTERFACE_LIBRARY" "UNKNOWN_LIBRARY" "TargetType")
 for i in "${values[@]}"; do     git grep -l cmTarget::$i | xargs sed -i "s|cmTarget::$i|cmState::$i|g"; done
2015-10-15 00:41:39 +02:00
Stephen Kelly 2bf7de167f Subdirs: Initialize from parent before configuring.
Add new API for the subdirs command to cmState.

This fixes a regression introduced in commit f716460e (cmMakefile: Move
invokation to initialize snapshot., 2015-10-06).
2015-10-14 00:34:11 +02:00
Stephen Kelly 20b95ef8c8 cmState: Initialize default definitions immediately.
Don't leave this as cmMakefile responsibility.
2015-10-14 00:16:20 +02:00
Stephen Kelly 2c219bafc0 cmState: Initialize top level source directories immediately.
Don't leave this as cmMakefile responsibility.
2015-10-14 00:16:07 +02:00
Stephen Kelly 79a309d786 cmState: Port away from cmake instance. 2015-10-10 15:42:02 +02:00
Stephen Kelly e2eecae205 cmState: Move ParseCacheEntry from cmCacheManager. 2015-10-10 15:36:59 +02:00
Stephen Kelly b5212c68de cmState: Add API for cache version. 2015-10-10 15:36:58 +02:00
Stephen Kelly 6f02034e66 cmState: Make AddCacheEntry method private. 2015-10-10 15:36:58 +02:00
Stephen Kelly 062ed22ec4 cmState: Add cache file manipulation wrappers. 2015-10-10 15:36:58 +02:00
Stephen Kelly 28749903b6 cmState: Internalize the initialization of a snapshot from its parent. 2015-10-07 20:19:42 +02:00
Brad King 0d0b9b52f8 Merge topic 'cmState-ProjectName'
637c56b4 cmGlobalGenerator: Implement FillProjectMap in terms of cmState.
b3f2299e cmState: Move ProjectName from cmMakefile.
6ce940ac cmMakefile: Use std::string in ProjectName API.
e8c0341d cmMakefile: Out-of-line GetProjectName.
2015-08-27 10:04:09 -04:00
Brad King 6904b6efdc Merge topic 'rm-cmLocalGenerator-Children'
867b5be8 cmLocalGenerator: Remove unused Children member.
6c832219 cmLocalGenerator: Implement child traversal in terms of cmState.
3fcf3837 Makefiles: Remove valueless cast.
223f4a66 cmLocalGenerator: Simplify condition.
ae026f54 cmState: Store Children states in parent state.
2015-08-27 10:04:07 -04:00
Stephen Kelly b3f2299e06 cmState: Move ProjectName from cmMakefile. 2015-08-25 19:57:42 +02:00
Stephen Kelly ae026f5458 cmState: Store Children states in parent state. 2015-08-24 20:05:37 +02:00
Stephen Kelly af9fc27753 cmState: Make Snapshot EqualityComparable. 2015-08-24 20:03:29 +02:00
Stephen Kelly f4150bd88d cmState: Move directory Properties from cmMakefile. 2015-08-24 20:02:21 +02:00
Brad King 2370a99400 Merge topic 'cmState-definitions'
bff27391 cmState: Host variable definitions.
6954c893 cmState: Add a VariableScope snapshot type.
1fc645bd cmState: Add a Base snapshot type.
0f070dd3 cmMakefile: Decouple the container of cmDefinitions from scoping logic.
25e04ddf cmDefinitions: Implement in terms of cmLinkedTree.
4bbe261c cmMakefile: Extract InitializeVarScope method.
2015-08-24 10:07:04 -04:00
Stephen Kelly bff27391a9 cmState: Host variable definitions. 2015-08-23 19:05:11 +02:00
Stephen Kelly 55e3927634 cmState: Make it possible to order cmState::Snapshot. 2015-08-23 18:05:13 +02:00
Stephen Kelly 6954c8936f cmState: Add a VariableScope snapshot type.
Match the scopes currently used in cmMakefile for definitions.
2015-08-23 17:08:54 +02:00
Stephen Kelly 1fc645bd9c cmState: Add a Base snapshot type.
For completeness mostly.
2015-08-23 17:08:54 +02:00
Stephen Kelly 757a1f5408 cmState: Move PolicyState from cmMakefile.
Implement lexical scope checking in terms of the state stack instead
of barriers.
2015-08-02 08:56:57 +02:00
Stephen Kelly 348354333a cmState: Add Type for policy scope. 2015-08-02 08:56:57 +02:00
Stephen Kelly 0a01e6c6e7 cmState: Add Snapshot Type accessor. 2015-08-01 07:18:34 +02:00
Stephen Kelly 6ed9c7e024 cmState: Host buildsystem properties for directories. 2015-07-25 14:53:05 +02:00
Brad King 8f0a5d84e3 cmState: Fix compilation on IBM XL compiler
Delay use of the PositionType constructor until after SnapshotDataType
is fully defined.
2015-07-25 14:52:05 +02:00
Stephen Kelly 9ebc7502b2 cmState: Extract a Directory class.
Move Directory-scoped state accessors to it.  This will be expanded
with directory property state soon.
2015-07-18 19:37:58 +02:00
Stephen Kelly 27ec21dbb2 cmState: Forward-declare a type earlier. 2015-07-18 19:09:51 +02:00
Stephen Kelly 6361f68056 cmState: Store execution context.
Extend snapshot creation API to store the file being executed and the
entry point to get to that context.
2015-07-06 01:37:15 +02:00
Stephen Kelly 94704d759c cmState: Add GetCallStackParent method. 2015-07-05 16:56:36 +02:00
Stephen Kelly a8e5446024 cmState: Store snapshots for more different types.
Adjust cmMakefile implementation to create the snapshots.
2015-07-04 11:51:27 +02:00
Stephen Kelly 217c243db0 cmake: Update the current snapshot when Resetting.
This will matter when definitions are stored in the cmState.
2015-06-21 20:19:53 +02:00
Stephen Kelly ccf7760f00 cmOutputConverter: Constify API. 2015-06-21 20:13:28 +02:00
Brad King d17aa60659 Merge topic 'data-layout'
8174e5cd cmCustomCommand: Remove special member functions.
34e1d6db cmCustomCommand: Re-arrange data layout.
54cb76f2 cmComputeLinkDepends: Re-arrange data layout.
b661d6c6 cmQtAutoGenerators: Re-arrange data layout.
40844a14 cmProcessTools: Re-arrange data layout.
b1ff32af cmOrderDirectories: Re-arrange data layout.
dd0417c7 cmInstallTargetGenerator: Re-arrange data layout.
125c4866 cmInstallFilesGenerator: Re-arrange data layout.
92b8b1fc cmGraphVizWriter: Re-arrange data layout.
7f3e1623 cmGlobalGenerator: Re-arrange data layout.
d9df7fa7 cmComputeComponentGraph: Re-arrange data layout.
db24e41b cmCommandArgumentParserHelper: Re-arrange data.
4cd13e80 cmComputeLinkInformation: Re-arrange data layout.
3e087a40 cmLocalUnixMakefileGenerator: Re-arrange data layout.
e0421701 cmMakefile: Re-arrange data layout.
c26696eb cmSourceFile: Re-arrange data.
...
2015-06-08 13:54:11 -04:00
Brad King d18852d596 Merge topic 'extract-cmOutputConverter'
59e21ffa Port static calls from cmLocalGenerator to cmOutputConverter.
242dcc2c cmListFileBacktrace: Replace local generator with cmState::Snapshot.
1cff330b cmTarget: Port to cmOutputConverter.
2f1bd62b cmCustomCommandGenerator: Port to cmOutputConverter.
0f2a1324 cmCommandArgumentParserHelper: Port to cmOutputConverter.
4d8b79ad cmComputeLinkInformation: Port to cmOutputConverter.
8680520f cmMakefile: Make the cmState::Snapshot accessible.
6d7abb63 cmOutputConverter: Extract from cmLocalGenerator.
a8244157 cmState::Snapshot: Provide accessor for the cmState.
1f4ef396 cmLocalGenerator: Remove some commented lines of code.
2015-06-08 13:54:02 -04:00
Stephen Kelly 9058e27a43 Constify property definition API. 2015-06-07 09:29:30 +02:00
Stephen Kelly 4e5c70abe2 cmState: Extract a cmLinkedTree container adaptor.
This will be used to contain most of the content of the cmState
in several different trees.  Refer to the BuildsystemDirectory
state from the SnapshotData state.  Currently these trees have
the same structure, but that will change when we have more snapshot
types.
2015-06-04 21:20:59 +02:00
Stephen Kelly 7b9c75860d cmState: Group BuildsystemDirectory state together in a struct.
It needs to be snapshotted independently of other state.
2015-06-04 20:44:37 +02:00
Stephen Kelly 1b323949fe cmState: Extend Snapshot concept with a SnapshotType.
Store it together with the Parent position.
2015-06-04 20:44:37 +02:00
Stephen Kelly a824415724 cmState::Snapshot: Provide accessor for the cmState. 2015-06-04 20:20:25 +02:00
Stephen Kelly cf1233a0ea cmState: Rename GetParent method.
Leave the namespace open for other Parent types.
2015-06-03 01:15:03 +02:00
Stephen Kelly 942df88bf8 cmState: Rename CreateSnapshot method.
Leave the namespace open for other snapshot types.
2015-06-03 01:14:34 +02:00
Stephen Kelly da28f11523 cmState: Add CreateBaseSnapshot method. 2015-06-03 01:14:33 +02:00
Stephen Kelly e12afe766e cmState: Host some state from the cmGlobalGenerator. 2015-05-27 09:18:31 -04:00
Stephen Kelly 01e1cd5c1f cmState: Move snapshot creation to the cmake instance.
Don't create a snapshot in Initialize(), but leave the creation
responsibility to the cmake instance instead.  Previously, the
cmState would Initialize() in its constructor, and the cmake instance
would re-Initialize() during Configure().  The end result was the
same and there would be one snapshot present.  However, cmLocalGenerator
also created a snapshot on construction, and that one was used, leaving
the first snapshot unused, and potential for off-by-one errors.

Fix that by making the cmLocalGenerator use the existing snapshot
if it is top-level.  Add a CurrentSnapshot to the cmake instance and
populated it while configuring a directory.  This will eventually
replace the 'current local generator' concept.  Fix the GetParent
implementation to be able to return the first snapshot.
2015-05-24 13:30:24 +02:00
Stephen Kelly 9e4b6cc2ce cmState: Store computed relative paths to to current directories. 2015-05-16 08:12:02 +02:00
Stephen Kelly 991f5e4968 cmState::Snapshot: Store components for current directories.
Remove this responsibility from cmLocalGenerator.
2015-05-16 08:12:01 +02:00