]> granicus.if.org Git - clang/commitdiff
my refactoring of builtins changed target-specific builtins to only be
authorChris Lattner <sabre@nondot.org>
Tue, 16 Jun 2009 16:18:48 +0000 (16:18 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 16 Jun 2009 16:18:48 +0000 (16:18 +0000)
registered when PCH wasn't being used.  We should always install (in BuiltinInfo)
information about target-specific builtins, but we shouldn't register any builtin
identifier infos.  This fixes the build of apps that use PCH and target specific
builtins together.

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

clang.xcodeproj/project.pbxproj
include/clang/Basic/Builtins.h
lib/Basic/Builtins.cpp
lib/Lex/Preprocessor.cpp
tools/clang-cc/clang-cc.cpp

index 73ef1beeca379e67a528140548b5d1ab451da3cb..c5098b534beae67388e323b4dd770f686b6b9cd4 100644 (file)
                                GCC_ENABLE_CPP_RTTI = NO;
                                GCC_ENABLE_PASCAL_STRINGS = NO;
                                GCC_ENABLE_SYMBOL_SEPARATION = NO;
+                               GCC_ENABLE_TRIGRAPHS = NO;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
                                GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
                                GCC_OPTIMIZATION_LEVEL = 0;
                                GCC_SYMBOLS_PRIVATE_EXTERN = NO;
                                GCC_THREADSAFE_STATICS = NO;
                                GCC_USE_GCC3_PFE_SUPPORT = NO;
+                               GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
                                INSTALL_PATH = "$(HOME)/bin";
                                OTHER_LDFLAGS = (
                                        "-lLLVMBitWriter",
index 6463a4f6e51bc901723ea4076eaad8a405533409..f770c5089eec5735ea72088d307f859313b6a95a 100644 (file)
@@ -53,13 +53,12 @@ class Context {
   const Info *TSRecords;
   unsigned NumTSRecords;
 public:
-  Context() : TSRecords(0), NumTSRecords(0) {}
+  Context(const TargetInfo &Target);
 
   /// InitializeBuiltins - Mark the identifiers for all the builtins with their
   /// appropriate builtin ID # and mark any non-portable builtin identifiers as
   /// such.
-  void InitializeBuiltins(IdentifierTable &Table, const TargetInfo &Target,
-                          bool NoBuiltins = false);
+  void InitializeBuiltins(IdentifierTable &Table, bool NoBuiltins = false);
 
   /// \brief Popular the vector with the names of all of the builtins.
   void GetBuiltinNames(llvm::SmallVectorImpl<const char *> &Names,
index ebe0514fa0084d2ba6a0302d8dfe369ecaab6530..2662114b4c86f5f17a544d44124709b317881019 100644 (file)
@@ -30,11 +30,15 @@ const Builtin::Info &Builtin::Context::GetRecord(unsigned ID) const {
   return TSRecords[ID - Builtin::FirstTSBuiltin];
 }
 
+Builtin::Context::Context(const TargetInfo &Target) {
+  // Get the target specific builtins from the target.
+  Target.getTargetBuiltins(TSRecords, NumTSRecords);  
+}
+
 /// InitializeBuiltins - Mark the identifiers for all the builtins with their
 /// appropriate builtin ID # and mark any non-portable builtin identifiers as
 /// such.
 void Builtin::Context::InitializeBuiltins(IdentifierTable &Table,
-                                          const TargetInfo &Target,
                                           bool NoBuiltins) {
   // Step #1: mark all target-independent builtins with their ID's.
   for (unsigned i = Builtin::NotBuiltin+1; i != Builtin::FirstTSBuiltin; ++i)
@@ -42,9 +46,6 @@ void Builtin::Context::InitializeBuiltins(IdentifierTable &Table,
         (!NoBuiltins || !strchr(BuiltinInfo[i].Attributes, 'f')))
       Table.get(BuiltinInfo[i].Name).setBuiltinID(i);
 
-  // Get the target specific builtins from the target.
-  Target.getTargetBuiltins(TSRecords, NumTSRecords);
-  
   // Step #2: Register target-specific builtins.
   for (unsigned i = 0, e = NumTSRecords; i != e; ++i)
     if (!TSRecords[i].Suppressed &&
index 0a7d92eb83cfe068c9eaaafed609ffaccae9d129..24ee5d8a8f921f4ccbd037afc645926c60590444 100644 (file)
@@ -51,7 +51,7 @@ Preprocessor::Preprocessor(Diagnostic &diags, const LangOptions &opts,
                            IdentifierInfoLookup* IILookup)
   : Diags(&diags), Features(opts), Target(target),FileMgr(Headers.getFileMgr()),
     SourceMgr(SM), HeaderInfo(Headers), Identifiers(opts, IILookup),
-    CurPPLexer(0), CurDirLookup(0), Callbacks(0) {
+    BuiltinInfo(Target), CurPPLexer(0), CurDirLookup(0), Callbacks(0) {
   ScratchBuf = new ScratchBuffer(SourceMgr);
   CounterValue = 0; // __COUNTER__ starts at 0.
       
index 840f0157cf9800aa8de70e2b85594a68a4f70c61..04b871c4e156d7e0e65f9cc327c9e063d968c017 100644 (file)
@@ -2305,7 +2305,6 @@ int main(int argc, char **argv) {
     
       // Initialize builtin info.
       PP->getBuiltinInfo().InitializeBuiltins(PP->getIdentifierTable(),
-                                              PP->getTargetInfo(),
                                               PP->getLangOptions().NoBuiltin);
     }