## @file\r
# preprocess source file\r
#\r
-# Copyright (c) 2007 - 2010, Intel Corporation\r
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
#\r
-# All rights reserved. This program and the accompanying materials\r
+# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
# Import Modules\r
#\r
import sys\r
-import os\r
+import Common.LongFilePathOs as os\r
import re\r
import CodeFragmentCollector\r
import FileProfile\r
ComplexTypeDict = {}\r
SUDict = {}\r
\r
-## GetIgnoredDirListPattern() method\r
-#\r
-# Get the pattern of ignored direction list\r
-#\r
-# @return p: the pattern of ignored direction list\r
-#\r
-def GetIgnoredDirListPattern():\r
- p = re.compile(r'.*[\\/](?:BUILD|INTELRESTRICTEDTOOLS|INTELRESTRICTEDPKG|PCCTS)[\\/].*')\r
- return p\r
-\r
## GetFuncDeclPattern() method\r
#\r
# Get the pattern of function declaration\r
def CreateCCodeDB(FileNameList):\r
FileObjList = []\r
ParseErrorFileList = []\r
-\r
+ ParsedFiles = {}\r
for FullName in FileNameList:\r
if os.path.splitext(FullName)[1] in ('.h', '.c'):\r
+ if FullName.lower() in ParsedFiles:\r
+ continue\r
+ ParsedFiles[FullName.lower()] = 1\r
EdkLogger.info("Parsing " + FullName)\r
model = FullName.endswith('c') and DataClass.MODEL_FILE_C or DataClass.MODEL_FILE_H\r
collector = CodeFragmentCollector.CodeFragmentCollector(FullName)\r
try:\r
collector.ParseFile()\r
- except UnicodeError:\r
+ except:\r
ParseErrorFileList.append(FullName)\r
BaseName = os.path.basename(FullName)\r
DirName = os.path.dirname(FullName)\r