diff options
| author | Dan Gohman <gohman@apple.com> | 2008-05-13 00:00:25 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-05-13 00:00:25 +0000 |
| commit | d78c400b5bfb7904769b0ef9d259c7bb2573d8f8 (patch) | |
| tree | ce04c5328b5fc48abc5f9b54ba42fdb6649d932b /llvm/lib/Target/TargetData.cpp | |
| parent | 80ff5f06963070b10a3e9de0cc6946a7bed132c8 (diff) | |
| download | bcm5719-llvm-d78c400b5bfb7904769b0ef9d259c7bb2573d8f8.tar.gz bcm5719-llvm-d78c400b5bfb7904769b0ef9d259c7bb2573d8f8.zip | |
Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.
llvm-svn: 51017
Diffstat (limited to 'llvm/lib/Target/TargetData.cpp')
| -rw-r--r-- | llvm/lib/Target/TargetData.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp index 215a4f6d388..69a8ca902b4 100644 --- a/llvm/lib/Target/TargetData.cpp +++ b/llvm/lib/Target/TargetData.cpp @@ -30,11 +30,10 @@ using namespace llvm; // Handle the Pass registration stuff necessary to use TargetData's. -namespace { - // Register the default SparcV9 implementation... - RegisterPass<TargetData> X("targetdata", "Target Data Layout", false, - true); -} + +// Register the default SparcV9 implementation... +static RegisterPass<TargetData> X("targetdata", "Target Data Layout", false, + true); char TargetData::ID = 0; //===----------------------------------------------------------------------===// @@ -318,6 +317,8 @@ unsigned TargetData::getAlignmentInfo(AlignTypeEnum AlignType, : Alignments[BestMatchIdx].PrefAlign; } +namespace { + /// LayoutInfo - The lazy cache of structure layout information maintained by /// TargetData. Note that the struct types must have been free'd before /// llvm_shutdown is called (and thus this is deallocated) because all the @@ -342,8 +343,10 @@ struct DenseMapLayoutKeyInfo { }; typedef DenseMap<LayoutKey, StructLayout*, DenseMapLayoutKeyInfo> LayoutInfoTy; -static ManagedStatic<LayoutInfoTy> LayoutInfo; +} + +static ManagedStatic<LayoutInfoTy> LayoutInfo; TargetData::~TargetData() { if (LayoutInfo.isConstructed()) { |

